Search completed in 1.61 seconds.
5835 results for "Method":
Your results are loading. Please wait...
PaymentMethodChangeEvent.methodName - Web APIs
the read-only methodname property of the paymentmethodchangeevent interface is a string which uniquely identifies the payment handler currently selected by the user.
... the payment handler may be a payment technology, such as apple pay or android pay, and each payment handler may support multiple payment methods; changes to the payment method within the payment handler are described by the paymentmethodchangeevent.
... syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler.
...And 6 more matches
PaymentMethodChangeEvent.methodDetails - Web APIs
the read-only methoddetails property of the paymentmethodchangeevent interface is an object containing any data the payment handler may provide to describe the change the user has made to their payment method.
... syntax details = paymentmethodchangeevent.methodname; value an object containing any data needed to describe the changes made to the payment method.
... the contents vary depending on the actual payment method chosen, so you will need to refer to the methodname property first, then inerpret the methoddetails after that.
...And 5 more matches
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
reason reason: did not find method in cors header ‘access-control-allow-methods’ what went wrong?
... the http method being used by the cors request is not included in the list of methods specified by the response's access-control-allow-methods header.
... this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url specified in the request; if the request is using any other method, this error occurs.
...And 3 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom methods to xbl-defined elements.
... methods in addition to adding script properties to the xbl-defined element, you can also add methods.
... these methods can be called from a script.
...And 29 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
what we really need next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data.
... objective: to learn about handling forms in vue, and by association, events, models, and methods.
...what we actually want to do is run a method on the submit event that will add the new todo to the todoitem data list defined inside app.
...And 24 more matches
NSPR Poll Method
this technical note documents the poll method of prfiledesc.
... the poll method is not to be confused with the pr_poll function.
... the poll method operates on a single netscape portable runtime (nspr) file descriptor, whereas pr_poll operates on a collection of nspr file descriptors.
...And 18 more matches
HTTP request methods - HTTP
WebHTTPMethods
http defines a set of request methods to indicate the desired action to be performed for a given resource.
... although they can also be nouns, these request methods are sometimes referred to as http verbs.
...a request method can be safe, idempotent, or cacheable.
...And 11 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
the reason that the box alignment properties remain detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not held up by box alignment, which has to detail these methods for all layout types.
...they have been renamed and moved to box alignment in order that they can be used in all layout methods — this will ultimately include flexbox.
...understanding block and inline directions is key to new layout methods.
...And 10 more matches
Useful string methods - Learn web development
previous overview: first steps next now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
... objective: to understand that strings are objects, and learn how to use some of the basic methods available on those objects to manipulate strings.
...when you create a string, for example by using let string = 'this is my string'; your variable becomes a string object instance, and as a result has a large number of properties and methods available to it.
...And 8 more matches
PRIOMethods
the table of i/o methods used in a file descriptor.
... syntax #include <prio.h> struct priomethods { prdesctype file_type; prclosefn close; prreadfn read; prwritefn write; pravailablefn available; pravailable64fn available64; prfsyncfn fsync; prseekfn seek; prseek64fn seek64; prfileinfofn fileinfo; prfileinfo64fn fileinfo64; prwritevfn writev; prconnectfn connect; pracceptfn accept; prbindfn bind; prlistenfn listen; prshutdownfn shutdown; prrecvfn recv; prsendfn send; prrecvfromfn recvfrom; prsendtofn sendto; prpollfn poll; pracceptreadfn acceptread; prtransmitfilefn transmitfile; prgetsocknamefn getsockname; prgetpeernamefn getpeername; prgetsockoptfn getsockopt; prsetsockoptfn setsockopt; }; typedef struct priomethods priomethods; parameters file_type type of file represented (tos)...
... description you don't need to know the type declaration for each function listed in the method table unless you are implementing a layer.
...And 7 more matches
PaymentRequest: paymentmethodchange event - Web APIs
paymentmethodchange events are delivered by the payment request api to a paymentrequest object when the user changes payment methods within a given payment handler.
... for example, if the user switches from one credit card to another on their apple pay account, a paymentmethodchange event is fired to let you know about the change.
... bubbles no cancelable no interface paymentmethodchangeevent event handler property onpaymentmethodchange examples let's take a look at an example.
...And 7 more matches
spreadMethod - SVG: Scalable Vector Graphics
the spreadmethod attribute determines how a shape is filled beyond the defined edges of a gradient.
... examples of spreadmethod with linear gradients svg <svg width="220" height="150" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="padgradient" x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> <lineargradient id="reflectgradient" spreadmethod="reflect" x1="33%" x2="67%">...
... <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> <lineargradient id="repeatgradient" spreadmethod="repeat" x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> </defs> <rect fill="url(#padgradient)" x="10" y="0" width="200" height="40"/> <rect fill="url(#reflectgradient)" x="10" y="50" width="200" height="40"/> <rect fill="url(#repeatgradient)" x="10" y="100" width="200" height="40"/> </svg> result notice that the middle third of each gradient is the same.
...And 7 more matches
Object.prototype.__noSuchMethod__ - Archive of obsolete content
the __nosuchmethod__ property used to reference a function to be executed when a non-existent method is called on an object, but this function is no longer available.
... while __nosuchmethod__ has been dropped, the ecmascript 2015 specification has the proxy object, with which you can achieve the below (and more).
... syntax obj.__nosuchmethod__ = fun parameters fun a function that takes the form function (id, args) { .
...And 6 more matches
Method definitions - JavaScript
starting with ecmascript 2015, a shorter syntax for method definitions on objects initializers is introduced.
... it is a shorthand for a function assigned to the method's name.
... } } generator methods generator methods can be defined using the shorthand syntax as well.
...And 6 more matches
Legacy layout methods - Learn web development
in this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project.
... layout and grid systems before css grid layout it may seem surprising to anyone coming from a design background that css didn’t have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal methods to create grid-like designs.
... we now refer to these as "legacy" methods.
...And 5 more matches
PaymentMethodChangeEvent - Web APIs
the paymentmethodchangeevent() constructor creates a new paymentmethodchangeevent object providing details about a paymentmethodchange event.
... 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.
...And 5 more matches
PaymentRequest.onpaymentmethodchange - Web APIs
the paymentrequest event handler onpaymentmethodchange is invoked when the paymentmethodchange is fired, indicating that the user has changed payment methods within a given payment handler.
... syntax paymentrequest.addeventlistener('paymentmethodchange', paymentmethodchangeevent => { ...
... }); paymentrequest.onpaymentmethodchange = function(paymentmethodchangeevent) { ...
...And 5 more matches
PaymentMethodChangeEvent - Web APIs
the paymentmethodchangeevent interface of the payment request api describes the paymentmethodchange event which is fired by some payment handlers when the user switches payment instruments (e.g., a user selects a "store" card to make a purchase while using apple pay).
... constructor paymentmethodchangeevent() creates and returns a new paymentmethodchangeevent object, optionally initialized with values taken from a given paymentmethodchangeeventinit dictionary.
... methoddetails read only secure context an object containing payment method-specific data useful when handling a payment method change.
...And 3 more matches
Comparing Reflect and Object methods - JavaScript
the reflect object, introduced in es2015, is a built-in object that provides methods to interface with javascript objects.
... some of the static functions that exist on reflect also correspond to methods available on object, which predates es2015.
... although some of the methods appear to be similar in their behavior, there are often subtle differences between them.
...And 3 more matches
NPN_HasMethod - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not the specified npobject has a particular method.
... syntax #include <npruntime.h> bool npn_hasmethod(npp npp, npobject *npobj, npidentifier methodname); parameters the function has the following parameters: npp the npp indicating which plugin instance is making the request.
... npobj the object on which to look for the method.
...And 2 more matches
PR_GetDefaultIOMethods
gets the default i/o methods table.
... syntax #include <prio.h> const priomethods* pr_getdefaultiomethods(void); returns if successful, the function returns a pointer to a priomethods structure.
... description after using pr_getdefaultiomethods to identify the default i/o methods table, you can select elements from that table with which to build your own layer's methods table.
...And 2 more matches
PaymentResponse.methodName - Web APIs
the methodname read-only property of the paymentresponse interface returns a string uniquely identifying the payment handler selected by the user.
... this string may be either one of the standardized payment method identifiers or a url used by the payment handler to process payments.
... syntax var methodname = paymentresponse.methodname; value a domstring uniquely identifying the payment handler being used to process the payment.
...And 2 more matches
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’ - HTTP
reason reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ what went wrong?
... the response to the cors request that was sent by the server includes an access-control-allow-methods header which includes at least one invalid method name.
... the access-control-allow-methods header is sent by the server to let the client know what http request methods it supports for cors requests.
...And 2 more matches
Access-Control-Allow-Methods - HTTP
the access-control-allow-methods response header specifies the method or methods allowed when accessing the resource in response to a preflight request.
... header type response header forbidden header name no syntax access-control-allow-methods: <method>, <method>, ...
... access-control-allow-methods: * directives <method> comma-delimited list of the allowed http request methods.
...And 2 more matches
Method - MDN Web Docs Glossary: Definitions of Web-related terms
a method is a function which is a property of an object.
... there are two kind of methods: instance methods which are built-in tasks performed by an object instance, or static methods which are tasks that are called directly on an object constructor.
... note: in javascript functions themselves are objects, so, in that context, a method is actually an object reference to a function.
... learn more learn about it method (computer programming) in wikipedia defining a method in javascript (comparison of the traditional syntax and the new shorthand) technical reference list of javascript built-in methods ...
Static method - MDN Web Docs Glossary: Definitions of Web-related terms
a static method (or static function) is a method defined as a member of an object but is accessible directly from an api object's constructor, rather than from an object instance created via the constructor.
... in a web api, a static method is one which is defined by an interface but can be called without instantiating an object of that type first.
... methods called on object instances are called instance methods.
... examples in the notifications api, the notification.requestpermission() method is called on the actual notification constructor itself — it is a static method: let promise = notification.requestpermission(); the notification.close() method on the other hand, is an instance method — it is called on an specific notification object instance to close the system notification it represents: let mynotification = new notification('this is my notification'); mynotification.close(); ...
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
this is where you want a two-dimensional layout method: you want to control the alignment by row and column, and this is where grid comes in.
...in the future, they may well apply to other layout methods as well.
...the positioning context will be whatever element creates a positioning context as is common to other layout methods.
...don’t be afraid to mix it with other methods of doing layout to get the different effects you need.
Access-Control-Request-Method - HTTP
the access-control-request-method request header is used by browsers when issuing a preflight request, to let the server know which http method will be used when the actual request is made.
... this header is necessary as the preflight request is always an options and doesn't use the same method as the actual request.
... header type request header forbidden header name yes syntax access-control-request-method: <method> directives <method> one of the http request methods, for example get, post, or delete.
... examples access-control-request-method: post specifications specification status comment fetchthe definition of 'access-control-request-method' in that specification.
method - SVG: Scalable Vector Graphics
WebSVGAttributemethod
the method attribute indicates the method by which text should be rendered along the path of a <textpath> element.
... only one element is using this attribute: <textpath> textpath for <textpath>, method indicates the method by which text should be rendered along the path.
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'method' in that specification.
... scalable vector graphics (svg) 1.1 (second edition)the definition of 'method' in that specification.
HTMLFormElement.method - Web APIs
the htmlformelement.method property represents the http method used to submit the <form>.
... unless explicitly specified, the default method is 'get'.
... syntax var string = form.method; form.method = string; example document.forms['myform'].method = 'post'; const formelement = document.createelement("form"); // create a form document.body.appendchild(formelement); console.log(formelement.method); // 'get' specifications specification status comment html living standardthe definition of 'htmlformelement: method' in that specification.
MerchantValidationEvent.methodName - Web APIs
the merchantvalidationevent property methodname is a read-only value which returns a string indicating the payment method identifier which represents the payment handler that requires merchant validation.
... syntax methodid = merchantvalidationevent.methodname; value a read-only domstring which uniquely identifies the payment handler which is requesting merchant validation.
... specifications specification status comment payment request apithe definition of 'merchantvalidationevent.methodname' in that specification.
PaymentRequestEvent.methodData - Web APIs
the methoddata read-only property of the paymentrequestevent interface returns an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.
... syntax var methoddata[] = paymentrequestevent.methoddata value an array of paymentmethoddata objects.
... specifications specification status comment payment handler apithe definition of 'methoddata' in that specification.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
the static method xrwebgllayer.getnativeframebufferscalefactor() returns a floating-point scaling factor by which one can multiply the specified xrsession's resolution to get the native resolution of the webxr device's frame buffer.
...this method of dividing the frame buffer between views is shown in the following diagram.
... that gets us a new xrwebgllayer object representing a rendering surface we can use for the xrsession; we set it as the rendering surface for xrsession by calling its updaterenderstate() method, passing the new gllayer in using the xrrenderstate dictionary's xrrenderstate.baselayer property.
405 Method Not Allowed - HTTP
WebHTTPStatus405
the hypertext transfer protocol (http) 405 method not allowed response status code indicates that the request method is known by the server but is not supported by the target resource.
... the server must generate an allow header field in a 405 response containing a list of the target resource's currently supported methods.
... status 405 method not allowed specifications specification title rfc 7231, section 6.5.5: 405 method not allowed hypertext transfer protocol (http/1.1): semantics and content ...
Methods - Archive of obsolete content
methods adddirectory unpacks an entire subdirectory.
... getfolder returns an object representing a directory, for use with the addfile method.
Input method editor - MDN Web Docs Glossary: Definitions of Web-related terms
an input method editor (ime) is a program that provides a specialized user interface for text input.
... input method editors are used in many situations: to enter chinese, japanese, or korean text using a latin keyboard to enter latin text using a numeric keypad to enter text on a touch screen using handwriting recognition ...
JSFUN_BOUND_METHOD
syntax jsfun_bound_method description this macro exists only for backward compatibility with existing applications.
...jsfun_bound_method is a flag that indicates a method associated with an object is bound to the method's parent, the object on which the method is called.
Request.method - Web APIs
WebAPIRequestmethod
the method read-only property of the request interface contains the request's method (get, post, etc.) syntax var mymethod = request.method; value a bytestring indicating the method of the request.
... example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the method of the request in a variable: var myrequest = new request('flowers.jpg'); var mymethod = myrequest.method; // get specifications specification status comment fetchthe definition of 'method' in that specification.
Methods - Archive of obsolete content
methods dircreate creates a new directory.
Methods - Archive of obsolete content
methods compareto compares the version information specified in this object to the version information specified in the version parameter.
Methods - Archive of obsolete content
methods getstring retrieves a value from a .ini file.
Methods - Archive of obsolete content
methods createkey adds a key.
Methods - Archive of obsolete content
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.getuserdata dom:element...
Index - Web APIs
WebAPIIndex
3 angle_instanced_arrays.drawarraysinstancedangle() angle_instanced_arrays, api, method, reference, webgl, webgl extension the angle_instanced_arrays.drawarraysinstancedangle() method of the webgl api renders primitives from array data like the gl.drawarrays() method.
... 4 angle_instanced_arrays.drawelementsinstancedangle() angle_instanced_arrays, api, method, reference, webgl, webgl extension the angle_instanced_arrays.drawelementsinstancedangle() method of the webgl api renders primitives from array data like the gl.drawelements() method.
... 5 angle_instanced_arrays.vertexattribdivisorangle() angle_instanced_arrays, api, method, reference, webgl, webgl extension the angle_instanced_arrays.vertexattribdivisorangle() method of the webgl api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
...And 1679 more matches
Index - Archive of obsolete content
90 lang/functional functional helper methods.
... 117 test/utils helper methods used in the commonjs unit testing suite.
... 181 downloading files code snippets to download a file, create an instance of nsiwebbrowserpersist and call its nsiwebbrowserpersist.saveuri() method, passing it a url to download and an nsifile instance representing the local file name/path.
...And 241 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
358 tabmodalpromptshowing xul, xul methods, xul reference no summary!
...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.
...this method has a number of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one.
...And 157 more matches
Index
MozillaTechXPCOMIndex
rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method.
...here is the interface, and a description of its use.</t> 10 how to pass an xpcom object to a new window needsexample, needshelp if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.
...that means you can call javascript methods from c++ and vice versa.
...And 151 more matches
WebIDL bindings
there are various helper objects and utility methods in dom/bindings that are also all in the mozilla::dom namespace and whose headers are all exported into mozilla/dom (placed in $objdir/dist/include by the build process).
...the return type of getparentobject doesn't matter other than it must either singly-inherit from nsisupports or have a corresponding tosupports method that can produce an nsisupports from it.
... expose whatever methods the interface needs on mozilla::dom::myinterface.
...And 133 more matches
nsIAnnotationService
method overview void setpageannotation(in nsiuri auri, in autf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setitemannotation(in long long aitemid, in autf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setpageannotationstring(in nsiuri auri, in autf8string aname, in astring avalue, in long ...
... methods setpageannotation() this method sets an annotation for given uri, overwriting any previous annotation with the same url/name.
...for other types, only c++ consumers may use the type-specific methods.
...And 73 more matches
nsINavBookmarksService
toolkit/components/places/nsinavbookmarksservice.idlscriptable the bookmarksservice interface provides methods for managing bookmarked history items.
...to use this service, use: var navbookmarksservice = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); method overview void addobserver(in nsinavbookmarkobserver observer, in boolean ownsweak); void beginupdatebatch(); obsolete since gecko 1.9 void changebookmarkuri(in long long aitemid, in nsiuri anewuri); long long createdynamiccontainer(in long long aparentfolder, in autf8string aname, in astring acontractid, in long aindex); note: renamed from createcontainer in g...
... methods addobserver() this method adds a bookmark observer.
...And 51 more matches
Starting WebLock
for example, an object may be created and have its observe method called at startup, or it may register to be notified prior to xpcom shutdown.
... the method at the core of this interface is observe: void observe(in nsisupports asubject, in string atopic, in wstring adata); there aren't really any restrictions on what the three parameters (asubject, atopic and adata) may represent.
...when the notification is made, the nsiobserverservice broadcasts the notification from the caller of the notifyobserver() to the nsiobserver object's observe() method.
...And 50 more matches
nsIFile
all methods with string parameters have two forms.
...therefore, the utf-16 forms are scriptable, but the "native methods" are not.
... method overview void append(in astring node); void appendnative(in acstring node); native code only!
...And 49 more matches
LiveConnect Overview - Archive of obsolete content
when programming in javascript, you can use a wrapper object to access methods and fields of the java object; calling a method or accessing a property on the wrapper results in a call on the java object.
...the jsobject class provides an interface for invoking javascript methods and examining javascript properties.
...as a javaobject, mystring has access to the public instance methods of java.lang.string and its superclass, java.lang.object.
...And 48 more matches
JavaScript Daemons Management - Archive of obsolete content
this more complex version of it is nothing but a big and scalable collection of methods for the daemon constructor.
...so the minidaemon framework will remain the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it.
... advantages of this approch: abstraction passage of this object to javascript timers (both setinterval and settimeout) optimisation (avoiding closures) modularity the code the code of this framework is split into three files: daemon.js (the core) daemon-safe.js (an extension of the core which adds a replacement of setinterval with a recursive invocation of settimeout) daemon-methods.js (a wide and highly scalable collection of methods) the only independent module is daemon.js: both the daemon-safe.js module and the daemon-methods.js module require daemon.js to work.
...And 39 more matches
Scripting Java
for example, to import the org.mozilla.javascript package you could use importpackage() as follows: $ java org.mozilla.javascript.tools.shell.main js> importpackage(packages.org.mozilla.javascript); js> context.currentcontext; org.mozilla.javascript.context@bb6ab6 occasionally, you will see examples that use the fully qualified name of the package instead of importing using the importpackage() method.
...using a fully qualified name, the above example would look as follows: $ java org.mozilla.javascript.tools.shell.main js> jspackage = packages.org.mozilla.javascript; [javapackage org.mozilla.javascript] js> jspackage.context.currentcontext; org.mozilla.javascript.context@bb6ab6 alternatively, if you want to import just one class from a package you can do so using the importclass() method.
...this works just as in java, with the use of the new operator: js> new java.util.date() thu jan 24 16:18:17 est 2002 if we store the new object in a javascript variable, we can then call methods on it: js> f = new java.io.file("test.txt") test.txt js> f.exists() true js> f.getname() test.txt static methods and fields can be accessed from the class object itself: js> java.lang.math.pi 3.141592653589793 js> java.lang.math.cos(0) 1 in javascript, unlike java, the method by itself is an object and can be evaluated as well as being called.
...And 36 more matches
Bytecode Descriptions
the conversion can call .tostring()/.valueof() methods and can throw.
...the conversion can call .tostring()/.valueof() methods and can throw.
...the conversion can call .tostring()/.valueof() methods and can throw.
...And 35 more matches
HTTP Index - HTTP
WebHTTPIndex
on top of these basic concepts, numerous extensions have appeared over the years, adding new functionality and new semantics by creating new http methods or headers.
... 31 reason: did not find method in cors header ‘access-control-allow-methods’ cors, corsmethodnotfound, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the http method being used by the cors request is not included in the list of methods specified by the response's access-control-allow-methods header.
... this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url specified in the request; if the request is using any other method, this error occurs.
...And 35 more matches
Introduction to XPCOM for the DOM
furthermore, a class can be de declared to be "abstract" if it declares some methods but does not implement them entirely.
... pushing this concept to its maximum, a class can be "purely virtual" if it declares methods without implementing any of them.
...interface to a set of methods that manipulate an object (often represented by a class), without worrying about the details of the implementation.
...And 33 more matches
Mail composition back end
(for detailed information on the listener interfaces, see the listener interfaces section of this document) nsimsgsend the following describes the methods of the nsimsgsend interface.
... all of these methods are asynchronous operations.
... createandsendmessage the createandsendmessage method will create an rfc822 message and send it all in one operation as well as providing the ability to save disk files for later use.
...And 33 more matches
Reading from Files - Archive of obsolete content
while there is only one method to create an input stream, it provides a number of options to control exactly how reading is performed.
...this method will open the file and return a stream.
...the newinputstream method takes two arguments in this example.
...And 32 more matches
nsIWindowsRegKey
method overview void close(); void create(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey createchild(in astring relpath, in unsigned long mode); astring getchildname(in unsigned long index); astring getvaluename(in unsigned long index); unsigned long getvaluetype(in astring name); boolean haschanged(); boo...
... constant value description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods.
...there is no method that is directly equivalent to regqueryvalueex or regsetvalueex.
...And 32 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
an easier method of building a firefox/thunderbird addon for developers who are well-acquainted with ides like netbeans, eclipse, etc.
... true browser.dom.window.dump.enabled (not present in firefox 3.5+) enables use of the dump method for debugging.
... refer to the “javascript debugging methods” sidebar.
...And 30 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
8 ascii glossary, infrastructure ascii (american standard code for information interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form.
... 76 cipher suite cryptography, glossary, security a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code.
...class is a template definition of an object's properties and methods, the "blueprint" from which other more specific instances of the object are drawn.
...And 30 more matches
XPIDL
interfaces may furthermore contain typedefs, natives, methods, constants, or attributes.
... nsqiresult void* void** object should only be used with methods that act like queryinterface autf8string const nsacstring& nsacstring& 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* anyt...
...interfaces are basically a collection of constants, methods, and attributes; in mozilla, these are the primary ways in which javascript code can interact with native c++ code.
...And 30 more matches
CSSPrimitiveValue - Web APIs
an instance of this interface might be obtained from the getpropertycssvalue() method of the cssstyledeclaration interface.
...the value can be obtained by using the getstringvalue() method.
...the value can be obtained by using the getfloatvalue() method.
...And 30 more matches
Object prototypes - Learn web development
in this article, we explain how prototype chains work and look at how the prototype property can be used to add methods to existing constructors.
... objective: to understand javascript object prototypes, how prototype chains work, and how to add new methods onto the prototype property.
... javascript is often described as a prototype-based language — to provide inheritance, objects can have a prototype object, which acts as a template object that it inherits methods and properties from.
...And 29 more matches
Mozilla DOM Hacking Guide
when, in javascript, a client tries to access a dom object or a dom method on a dom object, the js engine asks xpconnect to search for the relevant c++ method to call.
... for example, when we ask for |document.getelementbyid("myid");|, xpconnect will find that |document| is a property of the window object, so it will look on the interface nsidomwindow, and it will find the getdocument() method.
...so xpconnect will then try to find a method named getelementbyid() on the nsidomdocument interface.
...And 29 more matches
An Overview of XPCOM
in component-based programming, a component guarantees that the interfaces it provides will be immutable - that they will provide the same access to the same methods across different versions of the component - establishing a contract with the software clients that use it.
...using a freely available public initialization method, as the example below suggests, can cause problems.
... someclass class initialization class someclass { public: // constructor someclass(); // virtual destructor virtual ~someclass(); // init method void init(); void dosomethinguseful(); }; for this system to work properly, the client programmer must pay close attention to whatever rules the component programmer has established.
...And 29 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
for example, rather than: if (ismozilla || isie5) you would use: if (document.getelementbyid) this would allow other browsers that support that w3c standard method, such as opera or safari, to work without any changes.
...mozilla also does not support the netscape 4 document.layers method and internet explorer's document.all.
... the w3c dom level 1 method gets references to all elements with the same tag name through getelementsbytagname().
...And 28 more matches
XPCOM Objects - Archive of obsolete content
the method you call on cc["some-string"] should either be getservice or createinstance, depending on what you're asking for.
...those two methods always receive the interface identifier as an argument.
... an interface is just a definition of a set of attributes and methods that an object implementing it should have.
...And 25 more matches
Creating the Component Code
includes and constants in weblock1.cpp #include <stdio.h> // may be defined at the project level // in the makefile #define mozilla_strict_api #include "nsimodule.h" #include "nsifactory.h" #include "nsicomponentmanager.h" #include "nsicomponentregistrar.h" // use classes to handle iids // classes provide methods for comparison: equals, etc.
...the variable kifactoryiid, for example, provides methods like equals() that can be used to facilitate comparisons in the code, as in the following example from the mozilla source: using class methods to handle identifiers if (aiid.equals(ns_get_iid(nsisupports))) { *ainstanceptr = (void*)(nsisupports*)this; ns_addref_this(); return ns_ok; } finally, sample_cid is an example of a cid that uniquely identifies the component.
...nsimodule has four methods that must be implemented.
...And 25 more matches
Mozilla internal string guide
this allows for a method (.get()) to access the underlying character buffer.
...common read-only methods: .length() - the number of code units (bytes for 8-bit string classes and char16_ts for 16-bit string classes) in the string.
... common methods that modify the string: .assign(string) - assigns a new value to the string.
...And 25 more matches
Vue conditional rendering: editing existing todos - Learn web development
<button type="submit" class="btn btn__primary"> save <span class="visually-hidden">edit for {{label}}</span> </button> </div> </form> </template> <script> export default { props: { label: { type: string, required: true }, id: { type: string, required: true } }, data() { return { newlabel: this.label }; }, methods: { onsubmit() { if (this.newlabel && this.newlabel !== this.label) { this.$emit("item-edited", this.newlabel); } }, oncancel() { this.$emit("edit-cancelled"); } } }; </script> <style scoped> .edit-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #0b0c0c; display: block; ...
... add isediting below your existing isdone data point: data() { return { isdone: this.done, isediting: false }; } now add your methods inside a methods property, right below your data() property: methods: { deletetodo() { this.$emit('item-deleted'); }, toggletoitemeditform() { this.isediting = true; } } conditionally displaying components via v:if and v:else now we have an isediting flag that we can use to signify that the item is being edited (or not).
... getting back out of edit mode first, we need to add an itemedited() method to our todoitem component's methods.
...And 24 more matches
Following the Android Toasts Tutorial from a JNI Perspective
the java code example above can be done with privileged javascript from firefox for android with the following code: window.nativewindow.toast.show("hello, firefox!", "short"); converting java to jni.jsm the first step is to look at the java code and see all the different types, methods, constructors, and fields that are being used.
... in the toast code we have the following: types - context, charsequence, int, toast, and void methods - maketext, show fields - length_short no constructors are used.
...ed as javascript strings in jni.jsm, and the sig's of the types are as follows: java type signature boolean z byte b char c class/object lclass name in slash notation here; double d float f int i long j short s void v array of type [sig here method format (sig of type of each argument here)sig of the return type here declaring a class/object is done in a special way.
...And 24 more matches
nsIPromptService
its methods should be used in privileged code instead of dom window.alert, window.confirm, and other similar functions.
... note: some of these interface methods use out and inout parameters.
...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 wstrin...
...And 24 more matches
Working with objects - JavaScript
a property's value can be a function, in which case the property is known as a method.
...this chapter describes how to use objects, properties, functions, and methods, and how to create your own objects.
...for example, in the above code, when the key obj is added to the myobj, javascript will call the obj.tostring() method, and use this result string as the new key.
...And 24 more matches
nsIAccessible
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) overview this section provides short overview of methods and attributes of this interface.
... all methods and attributes are grouped by categories.
... nsiaccessible.role to get the role of the accessible nsiaccessible.getstate() to get states of the accessibe nsiaccessible.name, nsiaccessible.value to get the name and the value of the accessible tree navigation you can navigate through the accessible tree by the following methods and attributes.
...And 23 more matches
Debugger - Firefox Developer Tools
new debugger([global, …]) create a debugger object, and apply its adddebuggee method to each of the givenglobal objects to add them as the initial debuggees.
... this method’s return value is ignored.
... this handler method should return a resumption value specifying how the debuggee’s execution should proceed.
...And 23 more matches
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.
... data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message event's data attribute.) the data is copied rather than shared.
...all you need to do is call the worker() constructor, specifying the uri of a script to execute in the worker thread (main.js): var myworker = new worker('worker.js'); sending messages to and from a dedicated worker the magic of workers happens via the postmessage() method and the onmessage event handler.
...And 23 more matches
nsIOutputStream
inherits from: nsisupports last changed in gecko 1.0 an output stream may be "blocking" or "non-blocking" (see the isnonblocking() method).
... method overview void close(); void flush(); boolean isnonblocking(); unsigned long write(in string abuf, in unsigned long acount); unsigned long writefrom(in nsiinputstream afromstream, in unsigned long acount); unsigned long writesegments(in nsreadsegmentfun areader, in voidptr aclosure, in unsigned long acount); native code only!
... methods close() close the stream.
...And 22 more matches
CSSPrimitiveValue.primitiveType - Web APIs
the value can be obtained by using the getstringvalue() method.
...the value can be obtained by using the getfloatvalue() method.
...the value can be obtained by using the getcountervalue() method.
...And 22 more matches
Debugger.Object - Firefox Developer Tools
debugger.object a debugger.object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent.
... the referent's properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters.
... proxyhandler if the referent is a proxy whose handler object was allocated by debuggee code, this is its handler object—the object whose methods are invoked to implement accesses of the proxy's properties.
...And 21 more matches
DevTools API - Firefox Developer Tools
a definition is a js light object that exposes different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool.
... the gdevtools global object provides methods to register a tool definition and to access tool instances.
...to use the gdevtools api from an add-on, it can be imported with following snippet const { gdevtools } = require("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldefinition) registers a new tool and adds a tab to each existing toolbox.
...And 21 more matches
Using XMLHttpRequest - Web APIs
the type of request is dictated by the optional async argument (the third argument) that is set on the xmlhttprequest.open() method.
...however, this method is a "last resort" since if the xml code changes slightly, the method will likely fail.
...however, this method is a "last resort" since if the html code changes slightly, the method will likely fail.
...And 21 more matches
JXON - Archive of obsolete content
this.keylength = nlength; this.attributeslength = nattrlen; // this.domnode = oxmlparent; */ /* object.freeze(this); */ } /* * optional methods...
...the object.freeze() method prevents new properties from being added to it, prevents existing properties from being removed and prevents existing properties, or their enumerability, configurability, or writability, from being changed.
... algorithm #2: a less verbose way here is another, simpler, conversion method, in which nodeattributes are listed under the same object of child nodes but have the “@” prefix (as suggested by the badgerfish convention).
...And 20 more matches
Sending form data - Learn web development
the two most important attributes are action and method.
... how the data is sent depends on the method attribute.
... the method attribute the method attribute defines how data is sent.
...And 20 more matches
Python binding for NSS
the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions.
... method, function and property names are always lower case with words seperated by underscores.
... every module, class, function, and method has associated documentation and is exposed via the standard python methodology.
...And 20 more matches
nsIFaviconService
to use this service, use: var faviconservice = components.classes["@mozilla.org/browser/favicon-service;1"] .getservice(components.interfaces.nsifaviconservice); method overview void addfailedfavicon(in nsiuri afaviconuri); void expireallfavicons(); void getfavicondata(in nsiuri afaviconuri, out autf8string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata); obsolete since gecko 22.0 astring getfavicondataasdataurl(in nsiuri afaviconuri); obsolete since gecko 22.0 nsi...
... methods addfailedfavicon() this method adds a given favicon's uri to the failed favicon cache.
...this cache will also be written to if you use setandloadfaviconforpage() method and it encounters an error while fetching an icon.
...And 20 more matches
Drawing and Event Handling - Plugins
for windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable.
... for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a window.
... drawing plug-ins this section describes the methods and processes you use in drawing both windowed and windowless plug-ins.
...And 20 more matches
Numbers and dates - JavaScript
te value; returned on overflow number.epsilon difference between 1 and the smallest value greater than 1 that can be represented as a number (2.220446049250313e-16) number.min_safe_integer minimum safe integer in javascript (−253 + 1, or −9007199254740991) number.max_safe_integer maximum safe integer in javascript (+253 − 1, or +9007199254740991) methods of number method description number.parsefloat() parses a string argument and returns a floating point number.
... the number prototype provides methods for retrieving information from number objects in various formats.
... the following table summarizes the methods of number.prototype.
...And 20 more matches
Binding Implementations - Archive of obsolete content
introduction bindings can define methods and properties on a bound element using the implementation tag.
... a binding implementation provides a new set of methods and properties that can be invoked directly from the bound element.
... the methods and properties of an implementation can be defined declaratively using method and property tags in xml, or an external implementation (e.g., a binary implementation) can be specified using the src attribute.
...And 19 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 ...
... currently, this method doesn't support 4 or more clauses composition string.
...And 19 more matches
Add to iPhoto
this extension uses a number of methods and data types, as well as constants, from three system frameworks.
... for the sake of organization, i chose to implement each system framework (and, mind you, i only declare the apis i actually use, not all of them) as a javascript object containing all the types and methods that framework's api.
... the core foundation api is implemented by the corefoundation object, which consists of two methods to initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation.
...And 19 more matches
Writing to Files - Archive of obsolete content
this method has a number of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one.
...the newoutputstream method takes two arguments in this example.
...the default character set is 'utf-8' but this can be changed using an additional, yet optional, argument to the newoutputstream method.
...And 18 more matches
Plug-in Development Overview - Gecko Plugin API Reference
write your plug-in code and implement the appropriate plug-in api methods for basic plug-in operation.
... you'll find an overview of the plug-in api methods in this chapter, as well as separate chapters for all of the major functional areas of the plug-in api.
... but when the plug-in is loaded from a well-known directory, a different method must be used.
...And 18 more matches
Gecko info for Windows accessibility vendors
we have chosen a subset of readonly methods in the dom needed for assistive technology vendors.
... ajax: asynchronous javascript and xml ajax is a method of building interactive web applications that process user requests, user actions immediately in real time, unlike an http request, during which users must wait for a whole page to reload or for a new page to load.
... msaa support: iaccessible methods to use msaa with gecko, you'll need the tools and docs that come with the active accessibility 2.0 sdk tools.
...And 18 more matches
Plug-in Development Overview - Plugins
write your plug-in code and implement the appropriate plug-in api methods for basic plug-in operation.
... you'll find an overview of the plug-in api methods in this chapter, as well as separate chapters for all of the major functional areas of the plug-in api.
... but when the plug-in is loaded from a well-known directory, a different method must be used.
...And 18 more matches
Element - Web APIs
WebAPIElement
it only has methods and properties common to all kinds of elements.
... methods inherits methods from its parents node, and its own parent, eventtarget, and implements those of parentnode, childnode, nondocumenttypechildnode, and animatable.
... element.animate() a shortcut method to create and run an animation on an element.
...And 18 more matches
StringView - Archive of obsolete content
the aims of this library are: to create a c-like interface for strings (i.e., an array of character codes — an arraybufferview in javascript) based upon the javascript 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 i...
...in the past, this had to be simulated by treating the raw data as a string and using the charcodeat() method to read the bytes from the data buffer.
...awhole.subarray(nstartidx, nendidx) : awhole; } this.buffer = awhole.buffer; this.bufferview = awhole; this.rawdata = araw; object.freeze(this); } /* constructor's methods */ stringview.loadutf8charcode = function (achars, nidx) { /* the iso 10646 view of utf-8 considers valid codepoints encoded by 1-6 bytes, * while the unicode view of utf-8 in 2003 has limited them to 1-4 bytes in order to * match utf-16's codepoints.
...And 17 more matches
Template and Tree Listeners - Archive of obsolete content
listening for template rebuilds the first of these is the simplest and involves two methods, willrebuild and didrebuild.
... you would implement this object with these two methods if you wish to be notified when the template is rebuilt using the builder's rebuild call.
...the willrebuild method of any listeners will be called before the content is removed, and didrebuild method will be called when the content has been regenerated.
...And 17 more matches
Inheritance in JavaScript - Learn web development
inside here you'll find the same person() constructor example that we've been using all the way through the module, with a slight difference — we've defined only the properties inside the constructor: function person(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; }; the methods are all defined on the constructor's prototype.
...i\'m ' + this.name.first + '.'); }; note: in the source code, you'll also see bio() and farewell() methods defined.
... an updated greeting() method, which sounds a bit more formal than the standard greeting() method — more suitable for a teacher addressing some students at school.
...And 17 more matches
Modularization techniques - Archive of obsolete content
a pure virtual interface is simply a class where every method is defined as pure virtual, that is: virtual int foo(int bar) = 0; pure virtual interfaces provide an easy mechanism for passing function tables between modules that may reside in separate, possibly dynamically loaded, libraries.
... interface interrogation is performed using the queryinterface() method.
... reference counting is performed using the addref() and release() methods.
...And 16 more matches
tabbrowser - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for holding a set of read-only views of web documents.
...eupdown, onbookmarkgroup, onnewtab, tabmodalpromptshowing properties browsers, cangoback, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowseratindex, getbrowserindexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, gotoindex, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloa...
...to change the url, use the loaduri method.
...And 16 more matches
Focus management with Vue refs - Learn web development
to see the value of the ref when we click our "edit" button, add a console.log() to our toggletoitemeditform() method, like so: toggletoitemeditform() { console.log(this.$refs.editbutton); this.isediting = true; } if you activate the "edit" button at this point, you should see an html <button> element referenced in your console.
... vue's $nexttick() method we want to set focus on the "edit" button when a user saves or cancels their edit.
... to do that, we need to handle focus in the todoitem component’s itemedited() and editcancelled() methods.
...And 16 more matches
Adding a new event
each event class should implement following methods manually.
... virtual internalfooevent* asfooevent() moz_override this method should just return this.
... this method is used for retrieving sub class pointer avoiding to use static_cast.
...And 16 more matches
JSAPI User Guide
spidermonkey provides a few core javascript data types—numbers, strings, arrays, objects, and so on—and a few methods, such as array.push.
...it is up to the application developer to decide what objects and methods are exposed to scripts.
...the example below defines a very basic jsclass (named global_class) with no methods or properties of its own.
...And 16 more matches
Finishing the Component
however, some point in the future, the nsifoo interface requires a major change, and methods are reordered, some are added, others are removed.
...when your component runs in a version of gecko in which this interface is updated, your method calls will be routed through a different v-table than the one the component expected, most likely resulting in a crash.
... below, the component is compiled against a version of the nsifoo interface that has three methods.
...And 16 more matches
Using XPCOM Utilities to Make Things Easier
some differ only in whether or not a method is called when the module is created and/or destroyed.
... these three entries constitute the required parameters for the registerfactorylocation method we looked at in the prior chapter.
...furthermore, ns_decl_ appended with any interface name in all caps will declare all of the methods of that interface for you.
...And 16 more matches
nsIJSON
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) note: this interface may only be used from javascript code, with the exception of the legacydecodetojsval() method.
...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.
...deprecated since gecko 2.0 methods decode() obsolete since gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) decodes a json string, returning the javascript object it represents.
...And 16 more matches
nsINavHistoryService
to use this service, use: var historyservice = components.classes["@mozilla.org/browser/nav-history-service;1"] .getservice(components.interfaces.nsinavhistoryservice); method overview astring getpagetitle(in nsiuri auri); void markpageasfollowedbookmark(in nsiuri auri); void markpageasfollowedlink(in nsiuri auri); void markpageastyped(in nsiuri auri); boolean canadduri(in nsiuri auri); long long addvisit(in nsiuri auri, in prtime atime, in nsiuri areferringuri, in long atransitiontype, in boolean aisredirect, in...
... methods getpagetitle() this method retrieves the original title of the page.
... markpageasfollowedbookmark() this method is just like markpageastyped (in nsibrowserhistory, also implemented by the history service), but for bookmarks.
...And 16 more matches
nsIProtocolProxyService
netwerk/base/public/nsiprotocolproxyservice.idlscriptable this interface provides methods to access information about various network proxies.
...to access the service use: var pps = components.classes["@mozilla.org/network/protocol-proxy-service;1"] .getservice(components.interfaces.nsiprotocolproxyservice); method overview deprecated since gecko 18 nsiproxyinfo resolve(in nsiuri auri, in unsigned long aflags); nsicancelable asyncresolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy); nsiproxyinfo getfailoverforproxy(in nsiproxyinfo aproxyinfo, in nsiuri auri, i...
...n nsresult areason); void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); void unregisterfilter(in nsiprotocolproxyfilter afilter); constants constant value description resolve_non_blocking 1<<0 this flag may be passed to the resolve method to request that it fail instead of block the calling thread.
...And 16 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.
...each result will have the four variables referred to defined for it and the values may be retrieved using the result's nsixultemplateresult.getbindingfor() and nsixultemplateresult.getbindingobjectfor() methods.
... the template builder must call initializeforbuilding() before the other methods, except for translateref().
...And 16 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
the setinterval() method, offered on the window and worker interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
...this method is defined by the windoworworkerglobalscope mixin.
...the following ie-specific code demonstrates a method for overcoming this limitation.
...And 16 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
note: interface definition language (idl) is a language for giving standard definitions of objects, methods, and so forth.
...you'll note that even though the file includes an alert method, nothing happens.
... fixme: we should advise against using such method fixme: figure 1: dialog requesting privileges listing 3: grant privileges without manual confirmation for a specific file user_pref("capability.principal.codebase.test.granted", "universalxpconnect"); user_pref("capability.principal.codebase.test.id", "file url"); frequently used xpcom functions let’s take a look at those xpcom functions that are used especially frequently.
...And 15 more matches
MenuModification - Archive of obsolete content
modifying a menu menus have a number of methods which may be used to add and remove items.
... adding items to a menu the appenditem method may be used to append a new item to the end of the popup associated with a menu.
... this method will create a new menuitem element and insert it into the popup.
...And 15 more matches
JSObject - Archive of obsolete content
the jsobject class provides a way to invoke javascript methods and examine javascript properties.
... method summary the netscape.javascript.jsobject class has the following methods: call calls a javascript method.
... the netscape.javascript.jsobject class has the following static method: getwindow gets a jsobject for the window containing the given applet.
...And 15 more matches
Working with Svelte stores - Learn web development
a store is simply an object with a subscribe() method that allows interested parties to be notified whenever the store value changes, and an optional set() method that allows you to set new values for the store.
... then we call the method alert.subscribe(), passing it a callback function as a parameter.
... the subscribe() method also returns a clean-up function, which takes care of releasing the subscription.
...And 15 more matches
Accessing the Windows Registry Using XPCOM
the example above demonstates this using the open() method.
... if you want to create a new key, you can use the create() method, which takes the same parameters as open().
... both of these methods take a root key as the first parameter.
...And 15 more matches
nsICryptoHash
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 acstring finish(in prbool aascii); void init(in unsigned long aalgorithm); void initwithstring(in acstring aalgorithm); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the in...
...it() method to indicate which hashing function to use.
... constant value description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes the hash object and produces the actual hash data.
...And 15 more matches
CanvasRenderingContext2D - Web APIs
see the interface's properties and methods in the sidebar and below.
...this code draws a house: // set line width ctx.linewidth = 10; // wall ctx.strokerect(75, 140, 150, 110); // door ctx.fillrect(130, 190, 40, 60); // roof ctx.beginpath(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.lineto(250, 140); ctx.closepath(); ctx.stroke(); the resulting drawing looks like this: reference drawing rectangles there are three methods that immediately draw rectangles to the canvas.
... drawing text the following methods draw text.
...And 15 more matches
Client-side storage - Learn web development
the storage.setitem() method allows you to save a data item in storage — it takes two parameters: the name of the item, and its value.
... try typing this into your javascript console (change the value to your own name, if you wish!): localstorage.setitem('name','chris'); the storage.getitem() method takes one parameter — the name of a data item you want to retrieve — and returns the item's value.
... the storage.removeitem() method takes one parameter — the name of a data item you want to remove — and removes that item out of web storage.
...And 14 more matches
Mozilla accessibility architecture
in general, the accessibility apis use similar concepts, but use different method, constant and interfaces names.
...they may override some methods, such as init() and shutdown(), and add other methods to support interfaces needed only by the given toolkit.
... for example, nsaccessiblewrap implements the methods in iaccessible, but because it is also an nsaccessible, it only needs to call the nsiaccessible methods in "this" to get at the information it needs.
...And 14 more matches
Displaying Places information using views
results themselves observe places changes, and if on a places change a result determines that its data specifically has changed, it notifies its view by calling an appropriate method of nsinavhistoryresultviewer.
...like all places views, the built-in tree view implements this interface, which provides broad methods such as getting the view's nsinavhistoryresult instance and examining the view's selection.
... finally, the built-in tree view implements several convenience methods and properties of its own.
...And 14 more matches
Using XPCOM Components
the functionality of the cookiemanager component is available through the nsicookiemanager interface, which is comprised of the public methods in the table below.
...when a user selects one of the cookies displayed in the list and then clicks the remove button, the remove method in the nsicookiemanager interface is called.
... the snippet in getting the cookiemanager component in javascript shows how the remove() method from the xpcom cookiemanager component can be called from javascript: getting the cookiemanager component in javascript // xpconnect to cookiemanager // get the cookie manager component in javascript var cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice(); cmgr = cmgr.queryinterface(components.interfaces.nsicookiemanager); // called as part of a largerdeleteallcookies() function function finalizecookiedeletions() { for (var c=0; c<deletedcookies.length; c++) { cmgr.remove(deletedcookies[c].host, ...
...And 14 more matches
Streams - Plugins
the browser calls the plug-in methods npp_newstream, npp_writeready, npp_write, and npp_destroystream to, respectively, create a stream, find out how much data the plug-in can handle, push data into the stream, and delete it.
... normal mode: the browser uses the npp_write method to "push" stream data to the instance incrementally as it is available.
... random-access mode: the plug-in calls the npn_requestread method to "pull" stream data.
...And 14 more matches
Drawing shapes with canvas - Web APIs
in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes.
... path methods methods to set different paths for objects.
...every time this method is called, the list is reset and we can start drawing new shapes.
...And 14 more matches
Using the Payment Request API - Web APIs
the payment request api provides a browser-based method of connecting users and their preferred payment systems and platforms to merchants that they want to pay for goods and services.
...this takes two mandatory parameters and one option parameter: methoddata — an object containing information concerning the payment provider, such as what payment methods are supported, etc.
... so for example, you could create a new paymentrequest instance like so: var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetai...
...And 14 more matches
Symbol - JavaScript
the symbol() function returns a value of type symbol, has static properties that expose several members of built-in objects, has static methods that expose the global symbol registry, and resembles a built-in object class, but is incomplete as a constructor because it does not support the syntax "new symbol()".
...to create symbols available across files and even across realms (each of which has its own global scope), use the methods symbol.for() and symbol.keyfor() to set and retrieve symbols from the global symbol registry.
... finding symbol properties on objects the method object.getownpropertysymbols() returns an array of symbols and lets you find symbol properties on a given object.
...And 14 more matches
this - JavaScript
es5 introduced the bind() method to set the value of a function's this regardless of how it's called, and es2015 introduced arrow functions which don't provide their own this binding (it retains the this value of the enclosing lexical context).
...w; // true // in node: f1() === globalthis; // true in strict mode, however, if the value of this is not set when entering an execution context, it remains as undefined, as shown in the following example: function f2() { 'use strict'; // see strict mode return this; } f2() === undefined; // true in the second example, this should be undefined, because f2 was called directly and not as a method or property of an object (e.g.
...all non-static methods within the class are added to the prototype of this: class example { constructor() { const proto = object.getprototypeof(this); console.log(object.getownpropertynames(proto)); } first(){} second(){} static third(){} } new example(); // ['constructor', 'first', 'second'] note: static methods are not properties of this.
...And 14 more matches
Anatomy of a video game - Game development
modern browsers strive to call methods right as they are needed and idle (or do their other tasks) in the gaps.
...here is an example of a simple main loop: window.main = function () { window.requestanimationframe( main ); // whatever your main loop needs to do }; main(); // start the cycle note: in each of the main() methods discussed here, we schedule a new requestanimationframe before performing our loop contents.
...it will not be attached to any object and main (or main() for methods) will be a valid unused name in the rest of the application, free to be defined as something else.
...And 13 more matches
IPDL Tutorial
each outgoing message is a c++ method which can be called.
... each incoming message is a pure-virtual c++ method which must be implemented: class ppluginparent { public: bool sendinit(const nscstring& pluginpath) { // generated code to send an init() message } bool sendshutdown() { // generated code to send a shutdown() message } protected: /** * a subclass of ppluginparent must implement this method to handle the ready() message.
... because protocol messages are represented as c++ methods, it's easy to forget that they are in fact asynchronous messages: by default the c++ method will return immediately, before the message has been delivered.
...And 13 more matches
Promise
once you have a reference to a promise, you can call its then() method to execute an action when the value becomes available, or when an error occurs.
... method overview promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise, initially in the pending state, and provides references to the resolving functions that can be used to change its state.
...if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing.
...And 13 more matches
Index
34 js::compileoptions jsapi reference, reference, référence(2), spidermonkey some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain.
... 45 js::getfirstargumentastypehint jsapi reference, reference, référence(2), spidermonkey js::getfirstargumentastypehint converts first argument of @@toprimitive method to jstype.
... 104 jsfun_bound_method jsapi reference, obsolete, spidermonkey this macro exists only for backward compatibility with existing applications.
...And 13 more matches
nsIInputStream
inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) an input stream may be "blocking" or "non-blocking" (see the isnonblocking() method).
... method overview unsigned long available();deprecated since gecko 17.0 unsigned long long available(); void close(); boolean isnonblocking(); unsigned long read(in charptr abuf, in unsigned long acount); native code only!
... methods available() determine number of bytes available in the stream.
...And 13 more matches
nsILoginManagerStorage
method overview void addlogin(in nsilogininfo alogin); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, siz...
... methods addlogin() called by the login manager to store a new login.
... countlogins() implement this method to return the number of logins matching the specified criteria.
...And 13 more matches
Component; nsIPrefBranch
for example, if this object is created with the root "browser.startup.", the preferences "browser.startup.page", "browser.startup.homepage", and "browser.startup.homepage_override" can be accessed by simply passing "page", "homepage", or "homepage_override" to the various get/set methods.
... 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 utf8tring getstringpref(in string aprefname, [optional] in utf8string adefaultvalue); void getchildlist(in string astartingat, [optional] out unsigned long acount, [array, size_is(acount), retval] out string achildarray); void getcomplexvalue(in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); ...
... methods addobserver() adds a preference change observer.
...And 13 more matches
nsIXULTemplateBuilder
the condition syntax allows for common conditional handling; additional filtering may be applied by adding a custom filter to a rule with the builder's addrulefilter() method.
...a matching result must have its rulematched() method called.
... when a result no longer matches, the result's hasbeenremoved() method must be called.
...And 13 more matches
Transformations - Web APIs
saving and restoring state before we look at the transformation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings.
...every time the save() method is called, the current drawing state is pushed onto the stack.
... you can call the save() method as many times as you like.
...And 13 more matches
Using Fetch - Web APIs
it also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network.
...to extract the json body content from the response, we use the json() method (defined on the body mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more.
... supplying request options the fetch() method can optionally accept a second parameter, an init object that allows you to control a number of different settings: see fetch() for the full options available, and more details.
...And 13 more matches
PaymentRequest.show() - Web APIs
the paymentrequest interface's show() method instructs the user agent to begin the process of showing and handling the user interface for the payment request to the user.
... for security reasons, the paymentrequest.show() method can't just be initiated at any time.
...once one paymentrequest's show() method has been called, any other call to show() will by rejected with an aborterror until the returned promise has been concluded, either by being fulfilled with a paymentresponse indicating the results of the payment request, or by being rejected with an error.
...And 13 more matches
A simple RTCDataChannel sample - Web APIs
establishing a connection when the user clicks the "connect" button, the connectpeers() method is called.
... first, we call rtcpeerconnection.createoffer() method to create an sdp (session description protocol) blob describing the connection we want to make.
... this method accepts, optionally, an object with constraints to be met for the connection to meet your needs, such as whether the connection should support audio, video, or both.
...And 13 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
myth: msaa is too slow reality: assistive technology vendors have found ways around most of the performance problems related to out-of-process com method calls.
... deciding which msaa features to support msaa methods - cheat sheet for developers the iaccessible interface is used in a tree of iaccessible's, each one representing a data node, similar to a dom.
... here are the methods supported in iaccessible - a minimal implementation would contain those marked "[important]": get_accparent: get the parent of an iaccessible.
...And 13 more matches
Adding preferences to an extension - Archive of obsolete content
after getting the preference branch for our extension, we call the nsisupports.queryinterface() method on it to be able to use the methods of the nsiprefbranch2 interface.
... the next step is to register a preference observer by calling the addobserver() method to establish that whenever any events occur on the preferences, our object (this) receives notification.
... when events occur, such as a preference being altered, our observe() method will be called automatically.
...And 12 more matches
OpenClose - Archive of obsolete content
the openpopup method regardless of the type of popup, you may wish to open the popup programatically.
... to do this, use the popup's openpopup method.
... this method may be used for any type of popup, either a menupopup, a panel, or a tooltip, including ones that can be opened via other means, for instance, a popup attached via the context attribute.
...And 12 more matches
Template Builder Interface - Archive of obsolete content
rebuilding and refreshing a template the main purpose of accessing the builder for an element is to call its 'rebuild' method.
... this method removes any existing generated content and deletes all data in the rule network.
... then, the method recompiles the query and the rules and regenerates the content.
...And 12 more matches
Index - Learn web development
this article doesn't attempt to document all the possible methods.
...then it steps through one method that can work right away for many readers.
... 51 cooperative asynchronous javascript: timeouts and intervals animation, beginner, codingscripting, guide, intervals, javascript, loops, asynchronous, requestanimationframe, setinterval, settimeout, timeouts this tutorial looks at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
...And 12 more matches
JavaScript object basics - Learn web development
object basics an object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.) let's work through an example to understand what they look like.
...the last two items are functions that allow the object to do something with that data, and are referred to as the object's methods.
... dot notation above, you accessed the object's properties and methods using dot notation.
...And 12 more matches
Download
method overview promise start(); promise launch(); promise showcontainingdirectory(); promise cancel(); promise removepartialdata(); promise whensucceeded(); promise finalize([optional] boolean aremovepartialdata); properties attribute type description canceled read only boolean indicates that the download has been canceled.
... this property becomes true as soon as the cancel() method is called, though the stopped property might remain false until the cancellation request has been processed.
...this can be done using the removepartialdata() or the finalize() methods.
...And 12 more matches
nsIHttpChannel
inherits from: nsichannel last changed in gecko 1.3 to create an http channel, use nsiioservice with a http uri, for example: var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var ch = ios.newchannel("https://www.example.com/", null, null); method overview void getoriginalresponseheader(in acstring aheader, in nsihttpheadervisitor avisitor); acstring getrequestheader(in acstring aheader); acstring getresponseheader(in acstring header); boolean isnocacheresponse(); boolean isnostoreresponse(); void redirectto(in nsiuri anewuri); void setemptyrequestheader(in acstring aheader)...
... requestmethod acstring set or get the http request method (default is "get").
...however, after setting the upload data, it may be necessary to set the request method explicitly.
...And 12 more matches
nsIWindowWatcher
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 nsid...
... methods getchromeforwindow() retrieve the chrome window mapped to the given dom window.
...since dom windows lack a (public) means of retrieving their corresponding chrome, this method will do that.
...And 12 more matches
Dragging and Dropping Multiple Items - Web APIs
caution: all of the methods and properties with a moz prefix (such as mozsetdataat() are gecko specific interfaces.
... mozilla supports the ability to drag multiple items using some additional non-standard methods.
... these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or remove.
...And 12 more matches
Using the User Timing API - Web APIs
this document shows how to create mark and measure performance entry types and how to use user timing methods (which are extensions of the performance interface) to retrieve and remove entries from the browser's performance timeline.
... creating a performance mark the performance.mark() method is used to create a performance mark.
... the method takes one argument, the name of the mark, as shown in the following example.
...And 12 more matches
Classes - JavaScript
class body and method definitions the body of a class is the part that is in curly brackets {}.
... this is where you define class members, such as methods or constructor.
... constructor the constructor method is a special method for creating and initializing an object created with a class.
...And 12 more matches
Appendix D: Loading Scripts - Archive of obsolete content
flexibility: script tags provide a means to specify the character set and javascript version of the scripts to be loaded, which many other methods do not.
... <?xml version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="script-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript;version=1.8" src="overlay.js"/> </overlay> evalinsandbox the components.utils.evalinsandbox method may be used to load arbitrary code into components.utils.sandbox objects.
...this is the method used by jetpack's securable module system to load nearly all executable code.
...And 11 more matches
Custom XUL Elements with XBL - Archive of obsolete content
with xbl you can define new elements and define their properties, attributes, methods and event handlers.
...this code gets the dom object that corresponds to the xshelloperson tag, allowing you access to its methods and properties.
... in this case we're calling the remove method, which we will discuss later on.
...And 11 more matches
Elements - Archive of obsolete content
a xbl binding can add anonymous content, fields, properties, methods, and event handlers to html/xml elements.
...in the latter case all methods and handlers will be blocked, but the anonymous content and styling will be still used.
... implementation <!entity % implementation-content "(method|property)*"> <!element implementation %implementation-content;> <!attlist implementation id id #implied name cdata #implied implements cdata #implied > the implementation element describes the set of methods and properties that are attached to the bound element.
...And 11 more matches
Commands - Archive of obsolete content
you can also invoke a command by calling the docommand method either of the command element or an element attached to the command such as a button.
...the command dispatcher contains methods for retrieving controllers for commands and for retrieving and modifying the focus.
...a controller is expected to implement four methods, which are listed below: supportscommand (command) this method should return true if the controller supports a command.
...And 11 more matches
Tree View Details - Archive of obsolete content
the tree will query the view for each row by calling its getlevel method to find out the level of that row.
... in addition to the getlevel method, there is a hasnextsibling function which, given a row, should return true if there is another row afterwards at the same level.
... the getparentindex method is expected to return the parent row of a given row, that is, the row before it with a lower nesting value.
...And 11 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().
...now we will see how components can also expose methods and variables.
... these frameworks, by default, basically re-run all our javascript on every change against this virtual dom, and apply different methods to cache expensive calculations and optimize execution.
...And 11 more matches
Setting up your own test automation environment - Learn web development
in terms of what string to use inside the .forbrowser() method for other browsers, see the browser enum reference page.
...this needs to have the forbrowser() method chained onto it to specify what browser you want to test with this builder, and the build() method to actually build it (see the builder class reference for detailed information on these features).
... let driver = new webdriver.builder() .forbrowser('firefox') .build(); note that it is possible to set specific configuration options for browsers to be tested, for example you can set a specific version and os to test in the forbrowser() method: let driver = new webdriver.builder() .forbrowser('firefox', '46', 'mac') .build(); you could also set these options using an environment variable, for example: selenium_browser=firefox:46:mac let's create a new test to allow us to explore this code as we talk about it.
...And 11 more matches
Embedding Tips
get thensiwebnavigation interface on your webbrowser and call the loaduri method with the appropriate uri and flags.
... this interface also has methods for reloading, stopping a load and going back and forward in the history.
... implement the nsiwebprogresslistener interface and register it with the appropriate web browser object via the nsiwebbrowser::addwebbrowserlistener() method.
...And 11 more matches
mozIStorageConnection
method overview void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistoragestatement clone([optional] in boolean areadonly); void close(); void committransaction(); void createaggregatefunction(in autf8string afunctionname, in long anuma...
... methods asyncclose() asynchronously closes a database connection, allowing all pending asynchronous statements to complete first.
... exceptions thrown ns_error_unexpected thrown if the method was called on a thread other than the one that opened the connection.
...And 11 more matches
nsIBrowserHistory
to use this service, use: var browserhistory = components.classes["@mozilla.org/browser/nav-history-service;1"] .getservice(components.interfaces.nsibrowserhistory); method overview void addpagewithdetails(in nsiuri auri, in wstring atitle, in long long alastvisited); obsolete since gecko 15.0 void markpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void removeallpages(); ...
...fy); 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.
... methods addpagewithdetails() obsolete since gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) note: this method was removed in gecko 15.0.
...And 11 more matches
nsIThread
last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method overview void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type description prthread prthread the nspr thread object corresponding to the nsithread.
... methods shutdown() shuts down the thread.
...during the execution of this method call, events for the current thread may continue to be processed.
...And 11 more matches
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 nsitreecolu...
... note: renamed from progressundetermined in gecko 1.8 progress_none 3 note: renamed from progressnone in gecko 1.8 drop_before -1 drop_on 0 drop_after 1 indropbefore 0 obsolete since gecko 1.8 indropon 1 obsolete since gecko 1.8 indropafter 2 obsolete since gecko 1.8 methods candrop() methods used by the drag feedback code to determine if a drag is allowable at the current location.
...And 11 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 11 more matches
RTCPeerConnection - Web APIs
it provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
...also included is a list of any ice candidates that may already have been generated by the ice agent since the offer or answer represented by the description was first instantiated.getdefaulticeservers() the getdefaulticeservers() method of the rtcpeerconnection interface returns an array of objects based on the rtciceserver dictionary, which indicates what, if any, ice servers the browser will use by default if none are provided to the rtcpeerconnection in its rtcconfiguration.
...angethe onsignalingstatechange event handler property of the rtcpeerconnection interface specifies a function to be called when the signalingstatechange event occurs on an rtcpeerconnection interface.ontrack the rtcpeerconnection property ontrack is an eventhandler which specifies a function to be called when the track event occurs, indicating that a track has been added to the rtcpeerconnection.methodsalso inherits methods from: eventtargetaddicecandidate()when a web site or app using rtcpeerconnection receives a new ice candidate from the remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ice agent by calling rtcpeerconnection.addicecandidate().addstream() the obsolete rtcpeerconnection method addstream() adds a mediastream as a local source o...
...And 11 more matches
Using readable streams - Web APIs
this is done using the readablestream.getreader() method: // fetch the original image fetch('./tortoise.png') // retrieve its body as readablestream .then(response => response.body) .then(body => { const reader = body.getreader(); invoking this method creates a reader and locks it to the stream — no other reader may read this stream until this reader is released, e.g.
...e reduced by one step, as response.body is synchronous and so doesn't need the promise: // fetch the original image fetch('./tortoise.png') // retrieve its body as readablestream .then(response => { const reader = response.body.getreader(); reading the stream now you’ve got your reader attached, you can read data chunks out of the stream using the readablestreamdefaultreader.read() method.
... the first object can contain up to five members, only the first of which is required: start(controller) — a method that is called once, immediately after the readablestream is constructed.
...And 11 more matches
Using writable streams - Web APIs
the first object can contain up to four members, all of which are optional: start(controller) — a method that is called once, immediately after the writablestream is constructed.
... inside this method, you should include code that sets up the stream functionality, e.g.
... write(chunk,controller) — a method that is called repeatedly every time a new chunk is ready to be written to the underlying sink (specified in the chunk parameter).
...And 11 more matches
WritableStream.WritableStream() - Web APIs
syntax var writablestream = new writablestream(underlyingsink[, queuingstrategy]); parameters underlyingsink an object containing methods and properties that define how the constructed stream instance will behave.
... underlyingsink can contain the following: start(controller) optional this is a method, called immediately when the object is constructed.
... the contents of this method are defined by the developer, and should aim to get access to the underlying sink.
...And 11 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
additionally, for http request methods that can cause side-effects on server data (in particular, http methods other than get, or post with certain mime types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with the http options request method, and then, upon "approval" from the server, sending the actual request.
...a “simple request” is one that meets all the following conditions: one of the allowed methods: get head post apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-langu...
... preflighted requests unlike “simple requests” (discussed above), "preflighted" requests first send an http request by the options method to the resource on the other domain, to determine if the actual request is safe to send.
...And 11 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
overview javascript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods.
...just try parsing the string "10.2abc" with each method by yourself in the console and you'll understand the differences better.
...they have methods as well that allow you to manipulate the string and access information about the string: 'hello'.charat(0); // "h" 'hello, world'.replace('world', 'mars'); // "hello, mars" 'hello'.touppercase(); // "hello" other types javascript distinguishes between null, which is a value that indicates a deliberate non-value (and is only accessible through the null keyword), and undefined, which is a valu...
...And 11 more matches
Functions - JavaScript
a method is a function that is a property of an object.
... read more about objects and methods in working with objects.
... it turns out that functions are themselves objects—and in turn, these objects have methods.
...And 11 more matches
String - JavaScript
some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the indexof() method, or extracting substrings with the substring() method.
...the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed.
...in javascript, you just use the less-than and greater-than operators: let a = 'a' let b = 'b' if (a < b) { // true console.log(a + ' is less than ' + b) } else if (a > b) { console.log(a + ' is greater than ' + b) } else { console.log(a + ' and ' + b + ' are equal.') } a similar result can be achieved using the localecompare() method inherited by string instances.
...And 11 more matches
Bookmarks - Archive of obsolete content
the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders.
...rvice as is the case with nearly all interfaces, before you can use the bookmarks service, you need to get access to it: var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksservice.createfolder() method.
... creating a new bookmark to create a new bookmark, use the nsinavbookmarksservice.insertbookmark() method.
...And 10 more matches
Preferences - Archive of obsolete content
note: this article doesn't cover all available methods for manipulating preferences; please refer to the xpcom reference pages listed in resources section for the complete list of methods.
... the interfaces dealing with preferences are fairly well documented, so using the methods not mentioned here should be straightforward.
...there are six methods in nsiprefbranch that read and write preferences: getboolpref(), setboolpref(), getcharpref(), setcharpref(), getintpref(), and setintpref().
...And 10 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
the frozen string api does not have (or need) nsxpidlstring: - nsxpidlstring value; + nsstring value; ptr->gettermethod(getter_copies(value)); - const prunichar *strvalue = value; + // nsstring doesn't cast directly to prunichar*, use .get()+ const prunichar *strvalue = value.get(); the frozen string api doesn't accept a length for .truncate().
...all these functions are now available via the new string api - appendutf16toutf8(srcstring, deststring); + deststring.append(ns_convertutf16toutf8(srcstring)); the signatures of the find methods differ between the two apis.
... if you are only finding a single character, prefer the findchar method.
...And 10 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
most of these methods are specific to a particular site or codebase.
... hashchange and popstate events most ajax-heavy sites update the url when they significantly change their content, either via a change to the fragment identifier (hash) or more recently via the history.pushstate method.
...event listeners for those events are the preferred method for detecting dom modifications when feasible.
...And 10 more matches
Observer Notifications - Archive of obsolete content
the interface has only one method observe() which takes three parameters.
... this example code shows you what an implementation of the nsiobserver interface looks like: let testobserver = { observe : function(asubject, atopic, adata) { if (atopic == "xulschoolhello-test-topic") { window.alert("data received: " + adata); } } } in order for this observer to work, you need to use the observer service that provides methods for you to add, remove, notify and enumerate observers.
... adding an observer to the observer service is simple, invoking the addobserver method with three parameters.
...And 10 more matches
browser - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a xul <browser> element represents a frame which is expected to contain a view of a web document.
... it is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page.
... get firefox most of the properties and methods of the browser will rarely be used and can only be called from chrome urls.
...And 10 more matches
Introduction to CSS layout - Learn web development
by understanding what each method is designed for you will be in a good place to understand which is the best layout tool for each task.
... the methods that can change how elements are laid out in css are as follows: the display property — standard values such as block, inline or inline-block can change how elements behave in normal flow, for example making a block-level element behave like an inline element (see types of css boxes for more information).
... we also have entire layout methods that are switched on via specific display values, for example css grid and flexbox, which alter how elements inside the element they are set on are laid out.
...And 10 more matches
Graceful asynchronous programming with Promises - Learn web development
in the first example, we'll use the fetch() method to fetch an image from the web, the blob() method to transform the fetch response's raw body contents into a blob object, and then display that blob inside an <img> element.
... inside your <script> element, add the following line: let promise = fetch('coffee.jpg'); this calls the fetch() method, passing it the url of the image to fetch from the network as a parameter.
... to respond to the successful completion of the operation whenever that occurs (in this case, when a response is returned), we invoke the .then() method of the promise object.
...And 10 more matches
Creating Sandboxed HTTP Connections
nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri.
... to create an nsiuri from an string, we use the newuri method of nsiioservice: // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); once the nsiuri has been created, a nsichannel can be generated from it using nsiioservice's newchannelfromuri method: // get a channel for that nsiuri var channel = ioservice.newchannelfromuri(uri); to initiate the connection, the asyncopen method is called.
... it takes two arguments: a listener and a context that is passed to the listener's methods.
...And 10 more matches
Manipulating bookmarks using Places
the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders.
...rvice as is the case with nearly all interfaces, before you can use the bookmarks service, you need to get access to it: var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksservice.createfolder() method.
... creating a new bookmark to create a new bookmark, use the nsinavbookmarksservice.insertbookmark() method.
...And 10 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
this array is read-only, and the interface does not provide any methods that will allow adding and removing members.
...the methods that modify the array have been broken out into nsimutablearray.
...the method enumerate() returns a nsisimpleenumerator which accesses all the elements in the array.
...And 10 more matches
nsIDOMChromeWindow
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.
... methods beginwindowmove() on some operating systems, we must allow the window manager to handle window dragging.
... this method tells the window manager to start dragging the window.
...And 10 more matches
nsIDOMEvent
method overview boolean deserialize(in constipcmessageptr amsg, out voidptr aiter); violates the xpcom interface guidelines void duplicateprivatedata(); native code only!
...800000 locate 0x01000000 move 0x02000000 resize 0x04000000 forward 0x08000000 help 0x10000000 back 0x20000000 text 0x40000000 alt_mask 0x00000001 control_mask 0x00000002 shift_mask 0x00000004 meta_mask 0x00000008 methods violates the xpcom interface guidelines deserialize() boolean deserialize( in constipcmessageptr amsg, out voidptr aiter ); parameters amsg aiter return value native code only!duplicateprivatedata void duplicateprivatedata(); parameters none.
...this method will be removed in future releases, see bug 691151.
...And 10 more matches
nsITransactionManager
inherits from: nsisupports last changed in gecko 1.7 method overview void addlistener(in nsitransactionlistener alistener); void beginbatch(); void clear(); void dotransaction(in nsitransaction atransaction); void endbatch(); nsitransactionlist getredolist(); nsitransactionlist getundolist(); nsitransaction peekredostack(); nsitransaction peekundostack(); void redotransaction(); void removelistener(in nsitransactionlistener alistener); void undotransaction(); attributes attribute type description maxtransactioncount long sets the maximum number of transaction items the transaction manager will maintain at any ti...
...this method will prune the necessary number of transactions on the undo and redo stacks if the value specified is less than the number of items that exist on both the undo and redo stacks.
... methods addlistener() adds a listener to the transaction manager's notification list.
...And 10 more matches
Debugger.Frame - Firefox Developer Tools
every handler method called while the debuggee is running in a given frame is given the same frame object.
...ace whatever properties it likes on its debugger.frame instances, without worrying about interfering with other debuggers.) when the debuggee pops a stack frame (say, because a function call has returned or an exception has been thrown from it), the debugger.frame instance referring to that frame becomes inactive: its live property becomes false, and accessing its other properties or calling its methods throws an exception.
... (note that the debuggee is not considered an “immediate caller” of handler methods it triggers.
...And 10 more matches
console - Web APIs
WebAPIConsole
for example: console.log("failed to open the specified link") this page documents the methods available on the console object and gives a few usage examples.
... methods console.assert() log a message and stack trace to console if the first argument is false.
...you may use string substitution and additional arguments with this method.
...And 10 more matches
Drag Operations - Web APIs
to set a drag data item within the datatransfer, use the setdata() method.
...to do this, call the setdata() method multiple times with different formats.
... you can clear the data using the cleardata() method, which takes one argument: the type of the data to remove.
...And 10 more matches
Payment processing concepts - Web APIs
the payer authenticates themselves, then authorizes payment, as required by the payment method.
... payment method the instrument by which payment is submitted, such as a credit card or online payment service.
... payment method provider an organization that provides the technology needed to submit payments using a given payment method.
...And 10 more matches
Using DTMF with WebRTC - Web APIs
hasaddtrack because some browsers have not yet implemented rtcpeerconnection.addtrack(), therefore requiring the use of the obsolete addstream() method, we use this boolean to determine whether or not the user agent supports addtrack(); if it doesn't, we'll fall back to addstream().
...andidate = handlereceivericeevent; if (hasaddtrack) { receiverpc.ontrack = handlereceivertrackevent; } else { receiverpc.onaddstream = handlereceiveraddstreamevent; } navigator.mediadevices.getusermedia(mediaconstraints) .then(gotstream) .catch(err => log(err.message)); } after creating the rtcpeerconnection for the caller (callerpc), we look to see if it has an addtrack() method.
...this variable will let the example operate even on browsers not yet implementing the newer addtrack() method; we'll do so by falling back to the older addstream() method.
...And 10 more matches
Migrating from webkitAudioContext - Web APIs
changes to the creator methods three of the creator methods on webkitaudiocontext have been renamed in audiocontext.
... these are simple renames that were made in order to improve the consistency of these method names on audiocontext.
... if your code uses either of these names, like in the example below : // old method names var gain = context.creategainnode(); var delay = context.createdelaynode(); var js = context.createjavascriptnode(1024); you can simply rename the methods to look like this: // new method names var gain = context.creategain(); var delay = context.createdelay(); var js = context.createscriptprocessor(1024); the semantics of these methods remain the same in the renamed versions.
...And 10 more matches
Twitter - Archive of obsolete content
(it's easy!) methods each method in twitter's api maps to a method here.
... for example, the twitter method for tweeting, statuses/update, maps to jetpack.lib.twitter.statuses.update().
... most of twitter's methods are supported, but not all.
...And 9 more matches
prefwindow - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a specialized window used for preference dialogs.
... you can open a preference window using a window's opendialog method as with other dialogs.
... attributes buttonalign, buttondir, buttonorient, buttonpack, buttons, defaultbutton, lastselected, onbeforeaccept, ondialogaccept, ondialogcancel, ondialogdisclosure, ondialoghelp, onload, onunload, title, type properties buttons, currentpane, defaultbutton, lastselected, preferencepanes, type methods acceptdialog, addpane, canceldialog, centerwindowonscreen, getbutton, opensubdialog, openwindow, showpane examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="saveoptions" label="backups"> <preferences> <preference id="pref-backup" name="myapp...
...And 9 more matches
NPN_Invoke - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary invokes a method on the given npobject.
... syntax #include <npruntime.h> bool npn_invoke(npp npp, npobject *npobj, npidentifier methodname, const npvariant *args, uint32_t argcount, npvariant *result); parameters the function has the following parameters: npp the npp indicating which plugin wants to call the method on the object.
... npobj the object on which to invoke a method.
...And 9 more matches
Using the W3C DOM - Archive of obsolete content
instead, use the w3c dom properties and methods (examples in the next section).
... these are supported by internet explorer too so there is no need to use msie-specific attributes and methods.
... accessing elements with the w3c dom the basic method for referencing elements in an html page is document.getelementbyid().
...And 9 more matches
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
a function signature (or type signature, or method signature) defines input and output of functions or methods.
... a signature can include: parameters and their types a return value and type exceptions that might be thrown or passed back information about the availability of the method in an object-oriented program (such as the keywords public, static, or prototype).
...a signature in javascript can still give you some information about the method: myobject.prototype.myfunction(value) the method is installed on an object called myobject.
...And 9 more matches
Manipulating documents - Learn web development
using methods available on this object you can do things like return the window's size (see window.innerwidth and window.innerheight), manipulate the document loaded into that window, store data specific to that document on the client-side (for example using a local database or other storage mechanism), attach an event handler to the current window, and more.
...inside your script element, add the following line: const link = document.queryselector('a'); now we have the element reference stored in a variable, we can start to manipulate it using properties and methods available to it (these are defined on interfaces like htmlanchorelement in the case of <a> element, its more general parent interface htmlelement, and node — which represents all nodes in a dom).
... there are older methods available for grabbing element references, such as: document.getelementbyid(), which selects an element with a given id attribute value, e.g.
...And 9 more matches
Object building practice - Learn web development
the first part of the script looks like so: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); const width = canvas.width = window.innerwidth; const height = canvas.height = window.innerheight; this script gets a reference to the <canvas> element, then calls the getcontext() method on it to give us a context on which we can start to draw.
... this handles the properties, but what about the methods?
... drawing the ball first add the following draw() method to the ball()'s prototype: ball.prototype.draw = function() { ctx.beginpath(); ctx.fillstyle = this.color; ctx.arc(this.x, this.y, this.size, 0, 2 * math.pi); ctx.fill(); } using this function, we can tell the ball to draw itself onto the screen, by calling a series of members of the 2d canvas context we defined earlier (ctx).
...And 9 more matches
Browser API
api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's state, interited by the htmliframeelement interface.
... browser api interfaces to support the requirement of a browser <iframe>, the htmliframeelement dom interface has been extended with new methods that give the <iframe> some super powers.
... navigation methods the following navigation methods allow navigation through the browsing history of the <iframe>.
...And 9 more matches
HTTP Cache
//github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicachestorageservice.idl "@mozilla.org/netwerk/cache-storage-service;1" provides methods accessing “storage” objects – see nsicachestorage below – giving further access to cache entries – see nsicacheentry more below – per specific url.
... currently we have 3 types of storages, all the access methods return an nsicachestorage object: memory-only (memorycachestorage): stores data only in a memory cache, data in this storage are never put to disk disk (diskcachestorage): stores data on disk, but for existing entries also looks into the memory-only storage; when instructed via a special argument also primarily looks into application caches application cache (appcachestorage): when a consumer has a specific nsiapplicationcache (i.e.
... a particular app cache version in a group) in hands, this storage will provide read and write access to entries in that application cache; when the app cache is not specified, this storage will operate over all existing app caches the service also provides methods to clear the whole disk and memory cache content or purge any intermediate memory structures: clear – after it returns, all entries are no longer accessible through the cache apis; the method is fast to execute and non-blocking in any way; the actual erase happens in background purgefrommemory – removes (schedules to remove) any intermediate cache data held in memory for faster access (more about the intermediate cache below) nsiloadcontextinfo distinguishes the scope of the st...
...And 9 more matches
Extending a Protocol
to make this tutorial less abstract (more fun!), we are going to implement a js method called echo() on the navigator interface.
... the method will take one argument, a domstring, which we will pass to the parent process.
... implementing the navigator.echo() in your favorite editor, open dom/webidl/navigator.webidl at the end of the file, add: partial interface navigator { [throws] promise<domstring> echo(domstring astring); }; now we need to implement the echo() method in c++, so open up ./dom/base/navigator.h and let's add the method definition, so under public:: already_addrefed<promise> echo(const nsastring& astring, errorresult& arv); we use nsastring& as the domstring comes in from js as utf-16.
...And 9 more matches
DeferredTask.jsm
firefox 28 note interface was changed in firefox 28, and old methods were removed.
... method overview bool ispending();obsolete since gecko 28 void start();obsolete since gecko 28 void flush();obsolete since gecko 28 void cancel();obsolete since gecko 28 void arm(); void disarm(); promise finalize(); attributes isarmed boolean indicates whether the task is currently requested to start again later, rega...
... methods ispending obsolete since gecko 28 check the current task state.
...And 9 more matches
imgIContainer
it also provides methods for drawing images onto thebes contexts.
...as a service: var imgicontainer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); method overview void addrestoredata([array, size_is(acount), const] in char data, in unsigned long acount); native code only!
... obsolete since gecko 2.0 void setframeblendmethod(in unsigned long framenumber, in print32 ablendmethod); obsolete since gecko 2.0 void setframedisposalmethod(in unsigned long framenumber, in print32 adisposalmethod); obsolete since gecko 2.0 void setframehasnoalpha(in unsigned long framenumber); obsolete since gecko 2.0 void setframetimeout(in unsigned long framenumber, in print32 atimeout); obsolete since gecko 2...
...And 9 more matches
nsICacheEntryDescriptor
inherits from: nsicacheentryinfo last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void close(); void doom(); void doomandfailpendingrequests(in nsresult status); string getmetadataelement(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsioutputstream openoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get t...
... methods close() this method explicitly closes the descriptor (optional).
...doom() this method dooms the cache entry this descriptor references in order to slate it for removal.
...And 9 more matches
nsINavBookmarkObserver
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method overview void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folde...
... void onitemvisited(in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in long long aparentid, in acstring aguid, in acstring aparentguid); void onseparatoradded(in print64 parent, in print32 index); obsolete since gecko 1.9 void onseparatorremoved(in print64 parent, in print32 index); obsolete since gecko 1.9 methods onbeforeitemremoved() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409.
... this method notifies this observer that an item is about to be removed.
...And 9 more 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.
... inherits from: nsisupports last changed in gecko 1.9.0 method overview boolean candrop(in long index, in long orientation); void ondrop(in long row, in long orientation); void ontoggleopenstate(in long index); void oncycleheader(in nsitreecolumn column); void oncyclecell(in long row, in nsitreecolumn column); void onselectionchanged(); void onperformaction(in wstring action); void onperformactiononrow(in wstring action, in long row); void onperformactiononcell(in wstring action, in long row, in nsitreecolumn column); constants constant value description drop_before -1 the drag operation wishes to insert the dragged item before the indicated row.
... methods candrop() implement this method to report whether or not a drop is permitted onto the specified location.
...And 9 more matches
nsIXPCScriptable
for example, callers must guarantee that they set the *_retval of the various methods that return a boolean to pr_true before making the call.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void precreate(in nsisupports nativeobj, in jscontextptr cx, in jsobjectptr globalobj, out jsobjectptr parentobj); void create(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool addproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool delproperty(in nsixpconnectwrappednative wrapper, in js...
... constants constant value description want_precreate 1 << 0 want_create 1 << 1 want_postcreate 1 << 2 want_addproperty 1 << 3 want_delproperty 1 << 4 want_getproperty 1 << 5 want_setproperty 1 << 6 want_enumerate 1 << 7 want_newenumerate 1 << 8 indicates that the object wants to have its newenumerate method called.
...And 9 more matches
AudioWorkletProcessor.process - Web APIs
the process() method of an audioworkletprocessor-derived class implements the audio processing algorithm for the audio processor worklet.
... although the method is not a part of the audioworkletprocessor interface, any implementation of audioworkletprocessor must provide a process() method.
... the method is called synchronously from the audio rendering thread, once for each block of audio (also known as a rendering quantum) being directed through the processor's corresponding audioworkletnode.
...And 9 more matches
DirectoryEntrySync - Web APIs
it includes methods for creating, reading, looking up, and recursively removing files in a directory.
... example the getfile() method returns a fileentrysync, which represents a file in the file system.
... var fileentry = fs.root.getfile('seekrits.txt', {create: true}); the getdirectory() method returns a directoryentrysync, which represents a file in the file system.
...And 9 more matches
EventTarget.addEventListener() - Web APIs
the eventtarget method addeventlistener() sets up a function that will be called whenever the specified event is delivered to the target.
... return value undefined usage notes the event listener callback the event listener can be specified as either a callback function or an object that implements eventlistener, whose handleevent() method serves as the callback function.
... the callback function itself has the same parameters and return value as the handleevent() method; that is, the callback accepts a single parameter: an object based on event describing the event that has occurred, and it returns nothing.
...And 9 more matches
Performance API - Web APIs
methods the performance interface has two methods.
... the now() method returns a domhighrestimestamp whose value that depends on the navigation start and scope.
... the tojson() method returns a serialization of the performance object, for those attributes that can be serialized.
...And 9 more matches
Rendering and the WebXR frame animation callback - Web APIs
before you can render the virtual environment, you need to establish a webxr session by creating an xrsession using the navigator.xr.requestsession() method; you also need to associate the session with a framebuffer and perform other setup tasks.
...this is done by calling the xrsession method requestanimationframe().
...nsform(viewerstartposition, viewerstartorientation)); animationframerequestid = xrsession.requestanimationframe(mydrawframe); } } after getting a reference space for the immersive world, this creates an offset reference space representing the position and orientation of the viewer by creating an xrrigidtransform representing that position and orientation, then calling the xrreferencespace method getoffsetreferencespace().
...And 9 more matches
Window.open() - Web APIs
WebAPIWindowopen
the window interface's open() method loads the specified resource into the new or existing browsing context (window, <iframe> or tab) with the specified name.
...the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requirements.
... description the open() method creates a new secondary browser window, similar to choosing new window from the file menu.
...And 9 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
the settimeout() method of the windoworworkerglobalscope mixin (and successor to window.settimeout()) sets a timer which executes a function or specified piece of code once the timer expires.
...example: settimeout(function(arg1){}.bind(undefined, 10), 1000); the "this" problem when you pass a method to settimeout() (or any other function, for that matter), it will be invoked with a this value that may differ from your expectation.
... see the following example: myarray = ['zero', 'one', 'two']; myarray.mymethod = function (sproperty) { alert(arguments.length > 0 ?
...And 9 more matches
Index - HTTP
WebHTTPHeadersIndex
9 access-control-allow-methods cors, http, reference, header the access-control-allow-methods response header specifies the method or methods allowed when accessing the resource in response to a preflight request.
... 12 access-control-max-age cors, http, reference, header the access-control-max-age response header indicates how long the results of a preflight request (that is the information contained in the access-control-allow-methods and access-control-allow-headers headers) can be cached.
... 14 access-control-request-method cors, http, reference, header the access-control-request-method request header is used when issuing a preflight request to let the server know which http method will be used when the actual request is made.
...And 9 more matches
Public class fields - JavaScript
syntax class classwithinstancefield { instancefield = 'instance field' } class classwithstaticfield { static staticfield = 'static field' } class classwithpublicinstancemethod { publicmethod() { return 'hello world' } } examples public static fields public static fields are useful when you want a field to exist only once per class, not on every class instance you create.
... class classwithstaticfield { static basestaticfield = 'base static field' static anotherbasestaticfield = this.basestaticfield static basestaticmethod() { return 'base static method output' } } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = super.basestaticmethod() } console.log(classwithstaticfield.anotherbasestaticfield) // expected output: "base static field" console.log(subclasswithstaticfield.substaticfield) // expected output: "base static method output" public instance fields public instance ...
...just as in public instance methods, if you're in a subclass you can access the superclass prototype using super.
...And 9 more matches
ui/sidebar - Archive of obsolete content
once you've done that, you can show the sidebar by calling the sidebar's show() method.
... you can hide the sidebar by calling its hide() method.
...from firefox 33 onwards you can pass a browserwindow into these methods, and they will then operate on the specified window.
...And 8 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
r.server2.username", env_user); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); //smtp general lockpref("mail.smtp.defaultserver", "smtp1"); lockpref("mail.smtpserver.smtp1.auth_method", 0); lockpref("mail.smtpserver.smtp1.hostname", "smtp-int.int-evry.fr"); lockpref("mail.smtpserver.smtp1.port", 25); lockpref("mail.smtpserver.smtp1.try_ssl", 0); lockpref("mail.smtpserver.smtp1.username", ""); lockpref("mail.smtpservers", "smtp1"); lockpref("mail.startup.enabledmailcheckonce", true); lockpref("mailnews.quotingprefs.version", 1); lockpref("mailnews.ui.threadpane.version", 5); /...
...gs defaultpref("mail.server.server1.hostname", "myimap.server.com" ); defaultpref("mail.server.server1.name", userinfo.mail ); defaultpref("mail.server.server1.port", 993 ); defaultpref("mail.server.server1.sockettype", 3 ); defaultpref("mail.server.server1.type", "imap" ); defaultpref("mail.server.server1.username", userinfo.mail ); // smtp server settings defaultpref("mail.smtpserver.smtp1.authmethod", 3 ); defaultpref("mail.smtpserver.smtp1.description", "my company name" ); defaultpref("mail.smtpserver.smtp1.hostname", "mysmtp.server.com" ); defaultpref("mail.smtpserver.smtp1.port", 465 ); defaultpref("mail.smtpserver.smtp1.try_ssl", 3 ); defaultpref("mail.smtpserver.smtp1.username", userinfo.mail ); // glue it all together defaultpref("mail.account.account1.identities", "id1" ); defaultpr...
... my tests were on windows vista, and i noticed at least one difference, it is that paths changed; now the profile is in (for my procacci user sample): c:\users\procacci\appdata\roaming\thunderbird\profiles\v6we4uku.default start in debug mode in comand line interface: debug with displayerror() here's the result, i used the displayerror() method ( not the best way :-( see bug 206294 ) to show environment and ldap variables in order to check that it worked fine.
...And 8 more matches
Dynamically modifying XUL-based user interface - Archive of obsolete content
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.
...the most well known dom method is probably document.getelementbyid(), which returns an element, given its id.
... you may also have used other calls, such as element.setattribute(), or, if you wrote an extension, the addeventlistener() method.
...And 8 more matches
Document Object Model - Archive of obsolete content
the dom structure may be examined and modified using various methods provided for this purpose.
...although there is only ever one document associated with a window at a time, you may load additional documents using various methods.
...you can refer to the properties and methods of the global object without having to qualify them with an object.
...And 8 more matches
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is safe if it doesn't alter the state of the server.
... in other words, a method is safe if it leads to a read-only operation.
... several common http methods are safe: get, head, or options.
...And 8 more matches
Object-oriented JavaScript for beginners - Learn web development
notice that it has all the features you'd expect in a function, although it doesn't return anything or explicitly create an object — it basically just defines properties and methods.
... notice also the this keyword being used here as well — it is basically saying that whenever one of these object instances is created, the object's name property will be equal to the name value passed to the constructor call, and the greeting() method will use the name value passed to the constructor call too.
...you can now see that we have two new objects on the page, each of which is stored under a different namespace — when you access their properties and methods, you have to start calls with person1 or person2; the functionality contained within is neatly packaged away so it won't clash with other functionality.
...And 8 more matches
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's state, interited by the htmliframeelement interface.
... on in the code we implement two simple event listeners to move the browser back and forward in history when the relevant buttons are pressed: back.addeventlistener('touchend',function() { browser.goback(); }); fwd.addeventlistener('touchend',function() { browser.goforward(); }); the functions can be handled using the browser api htmliframeelement.goback() and htmliframeelement.goforward() methods.
... note that promise versions of browser api dom request methods also exist, so you can use async promise style syntax if you so wish.
...And 8 more matches
CustomizableUI.jsm
areas are registered using the registerarea method and unregistered using the unregisterarea method.
...not all event handler methods need to be defined.
... method overview void addlistener(alistener); void removelistener(alistener); void registerarea(aareaid, aproperties); void registertoolbarnode(atoolbar, aexistingchildren); void registermenupanel(apanel); void unregisterarea(aareaid, adestroyplacements); void addwidgettoarea(awidgetid, aareaid, [optional] aposition); void removewid...
...And 8 more matches
NetUtil.jsm
to use these utilities, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/netutil.jsm"); once you've imported the module, you can then use its methods.
... method overview nsiasyncstreamcopier asynccopy(nsiinputstream asource, nsioutputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ioservice nsiioservice returns a reference to nsiioservice.
... methods asynccopy() the asynccopy() method performs a simple asynchronous copy of data from a source input stream to a destination output stream.
...And 8 more matches
Tutorial: Embedding Rhino
exiting the context expose java apis using java apis implementing interfaces adding java objects using javascript objects from java using javascript variables calling javascript functions javascript host objects defining host objects counter example counter's constructors class name dynamic properties defining javascript "methods" adding counter to runscript runscript: a simple embedding about the simplest embedding of rhino possible is the runscript example.
...the tostring method converts any javascript value to a string.
...we'll go through it method by method below.
...And 8 more matches
JS_InitClass
all instances of the new class will inherit these methods via the prototype chain.
... (this is the javascript equivalent of public, non-static methods in c++ or java.) static_ps jspropertyspec * either null or a pointer to the first element of an array of jspropertyspecs, terminated by the null jspropertyspec.
...(this is the javascript equivalent of public static methods in c++ or java.) description js_initclass initializes a jsclass and (optionally) makes it visible to javascript code.
...And 8 more matches
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
there are two ways of getting the input stream: by calling the channel's .open() method for a synchronous read, or by calling the channel's .asyncopen() method with an nsistreamlistener object.
... you can get an nsichannel object from the io service's newchannel(spec, charset, baseuri) method or its .newchannelfromuri(uri) method.
...if everything goes well, calling the stream's .finish() method overwrites the original file with the new file.
...And 8 more matches
nsXPIDLCString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to adopt data allocated with ns_alloc, such as "out string" parameters in xpidl.
... names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const char* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequa...
... methods constructors void nsxpidlcstring() - source void nsxpidlcstring(const nsxpidlcstring&) - source parameters nsxpidlcstring& str operator const char* char* operator const char*() const - source operator[] char operator[](print32) const - source parameters print32 i char operator[](pruint32) const - source parameters pruint32 i operator= nsxpidlcstring& opera...
...And 8 more matches
nsXPIDLString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to adopt data allocated with ns_alloc, such as "out string" parameters in xpidl.
... names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const prunichar* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii...
... methods constructors void nsxpidlstring() - source void nsxpidlstring(const nsxpidlstring&) - source parameters nsxpidlstring& str operator const prunichar* prunichar* operator const prunichar*() const - source operator[] prunichar operator[](print32) const - source parameters print32 i prunichar operator[](pruint32) const - source parameters pruint32 i operator= ...
...And 8 more matches
nsIComponentRegistrar
xpcom/components/nsicomponentregistrar.idlscriptable this interface provides methods to access and modify the xpcom component registry.
... inherits from: nsisupports last changed in gecko 1.0 method overview void autoregister(in nsifile aspec); void autounregister(in nsifile aspec); string cidtocontractid(in nscidref aclass); nscidptr contractidtocid(in string acontractid); nsisimpleenumerator enumeratecids(); nsisimpleenumerator enumeratecontractids(); boolean iscidregistered(in nscidref aclass); boolean iscontractidregistered(in string acontractid); void registerfactory(in nscidref aclass, in string aclassname, in string acontractid, in nsifactory afactory); void registerfactorylocation(in nscidref aclass, in string aclassname, in string acontractid, in nsifile afile, in string aloaderstr, in string atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactoryloc...
...ation(in nscidref aclass, in nsifile afile); methods autoregister() register a component (.manifest) file or all component files in a directory.
...And 8 more matches
nsILivemarkService
to use this service, use: var livemarkservice = components.classes["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); method overview long long createlivemark(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index); long long createlivemarkfolderonly(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index); nsiuri getfeeduri(in long long container); long long getlivemarkidforfeeduri(in nsiuri afeeduri); ...
...nsiuri getsiteuri(in long long container); boolean islivemark(in long long folder); void reloadalllivemarks(); void reloadlivemarkfolder(in long long folderid); void setfeeduri(in long long container, in nsiuri feeduri); void setsiteuri(in long long container, in nsiuri siteuri); void start(); void stopupdatelivemarks(); methods createlivemark() creates a new livemark.
... createlivemarkfolderonly() this method also creates a new livemark but use this method during startup to avoid http traffic.
...And 8 more matches
nsIWindowMediator
implemented by: @mozilla.org/appshell/window-mediator;1 as a service: var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); method overview void addlistener(in nsiwindowmediatorlistener alistener); boolean calculatezposition(in nsixulwindow inwindow, in unsigned long inposition, in nsiwidget inbelow, out unsigned long outposition, out nsiwidget outbelow); native code only!
... methods addlistener() register a listener for window status changes.
...note this method is advisory only: it changes nothing either in windowmediator's internal state or with the window.
...And 8 more matches
Storage
closing a connection to close a connection on which only synchronous transactions were performed, use the mozistorageconnection.close() method.
... if you performed any asynchronous transactions, you should instead use the mozistorageconnection.asyncclose() method.
... binding one set of parameters if you only have one row to insert, or are using the synchronous api you'll need to use this method.
...And 8 more matches
Debugger.Object - Firefox Developer Tools
debugger.object a debugger.object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent.
... the referent’s properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters.
... function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects.
...And 8 more matches
Applying styles and colors - Web APIs
colors up until now we have only seen methods of the drawing context.
...we use the arc() method to draw circles instead of squares.
...<br> <form onsubmit="return draw();"> <label>miter limit</label> <input type="number" size="3" id="miterlimit"/> <input type="submit" value="redraw"/> </form> </td> </tr> </table> document.getelementbyid('miterlimit').value = document.getelementbyid('canvas').getcontext('2d').miterlimit; draw(); screenshotlive sample using line dashes the setlinedash method and the linedashoffset property specify the dash pattern for lines.
...And 8 more matches
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().
... using other canvas elements just as with normal images, we access other canvas elements using either the document.getelementsbytagname() or document.getelementbyid() method.
... some disadvantages of this method are that your image is not cached, and for larger images the encoded url can become quite long.
...And 8 more matches
Introduction to the DOM - Web APIs
for example, the standard dom specifies that the getelementsbytagname method in the code below must return a list of all the <p> elements in the document: const paragraphs = document.getelementsbytagname("p"); // paragraphs[0] is the first <p> element // paragraphs[1] is the second <p> element, etc.
... alert(paragraphs[0].nodename); all of the properties, methods, and events available for manipulating and creating web pages are organized into objects (for example, the document object that represents the document itself, the table object that implements the special htmltableelement dom interface for accessing html tables, and so forth).
...your dom programming may be something as simple as the following, which displays an alert message by using the alert() function from the window object, or it may use more sophisticated dom methods to actually create new content, as in the longer example below.
...And 8 more matches
HTMLInputElement - Web APIs
the htmlinputelement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements.
... formmethod string: returns / sets the element's formmethod attribute, containing the http method that the browser uses to submit the form.
... this overrides the method attribute of the parent form.
...And 8 more matches
HTMLMediaElement - Web APIs
the htmlmediaelement interface adds to htmlelement the properties and methods needed to support basic media-related capabilities that are common to audio and video.
... methods this interface also inherits methods from its ancestors htmlelement, element, node, and eventtarget.
...a separate copy of the data is returned each time the method is called.
...And 8 more matches
The HTML DOM API - Web APIs
each node is based on the node interface, which provides properties for getting information about the node as well as methods for creating, deleting, and organizing nodes within the dom.
... in order to expand upon the functionality of the core htmlelement interface to provide the features needed by a specific element, the htmlelement class is subclassed to add the needed properties and methods.
...htmlcanvaselement augments the htmlelement type by adding properties such as height and methods like getcontext() to provide canvas-specific features.
...And 8 more matches
Starting up and shutting down a WebXR session - Web APIs
to find out if a given mode is supported, simply call the xrsystem method issessionsupported().
...to obtain an xrsession, you call your xrsystem's requestsession() method, which returns a promise that resolves with an xrsession if it's able to establish one successfully.
... customizing the session in addition to the display mode, the requestsession() method can take an optional object with initialization parameters to customize the session.
...And 8 more matches
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.
... the checkvalidity() method returns a boolean indicating whether the element's value passes its constraints.
... (this is typically done by the user-agent when determining which of the css pseudo-classes, :valid or :invalid, applies.) in contrast, the reportvalidity() method reports any constraint failures to the user.
...And 8 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none.
... methods none.
... additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype the encoding method to use when submitting the form data formmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the results of submitting the form height the height, in css pixels, at which...
...And 8 more matches
Details of the object model - JavaScript
a class defines all of the properties that characterize a certain set of objects (considering methods and fields in java, or members in c++, to be properties).
...in that definition you can specify special methods, called constructors, to create instances of the class.
... a constructor method can specify initial values for the instance's properties and perform other processing appropriate at creation time.
...And 8 more matches
Indexed collections - JavaScript
however, you can use the predefined array object and its methods to work with arrays in your applications.
... the array object has methods for manipulating arrays in various ways, such as joining, reversing, and sorting them.
... in es2015, you can use the array.of static method to create arrays with single element.
...And 8 more matches
Regular expressions - JavaScript
these patterns are used with the exec() and test() methods of regexp, and with the match(), matchall(), replace(), replaceall(), search(), and split() methods of string.
... using regular expressions in javascript regular expressions are used with the regexp methods test() and exec() and with the string methods match(), replace(), search(), and split().
... these methods are explained in detail in the javascript reference.
...And 8 more matches
Inheritance and the prototype chain - JavaScript
inheriting "methods" javascript does not have "methods" in the form that class-based languages define them.
...an inherited function acts just as any other property, including property shadowing as shown above (in this case, a form of method overriding).
...// o ---> object.prototype ---> null var b = ['yo', 'whadup', '?']; // arrays inherit from array.prototype // (which has methods indexof, foreach, etc.) // the prototype chain looks like: // b ---> array.prototype ---> object.prototype ---> null function f() { return 2; } // functions inherit from function.prototype // (which has methods call, bind, etc.) // f ---> function.prototype ---> object.prototype ---> null with a constructor a "constructor" in javascript is "just" a function that happens to be called with ...
...And 8 more matches
Date - JavaScript
note: it's important to keep in mind that while the time value at the heart of a date object is utc, the basic methods to fetch the date and time or its components all work in the local (i.e.
... date format and time zone conversions there are a number of methods available to obtain a date in various formats, as well as to perform time zone conversions.
... in addition to methods to read and alter individual components of the local date and time (such as getday() and sethours()), there are also versions of the same methods that read and manipulate the date and time using utc (such as getutcday() and setutchours()).
...And 8 more matches
context-menu - Archive of obsolete content
({ label: "edit image", context: cm.selectorcontext("img"), contentscript: 'self.on("click", function (node, data) {' + ' self.postmessage(node.src);' + '});', onmessage: function (imgsrc) { openimageeditor(imgsrc); } }); updating a menu item's label each menu item must be created with a label, but you can change its label later using a couple of methods.
... the simplest method is to set the menu item's label property.
...in these cases you can use the second method.
...And 7 more matches
ui/button/toggle - Archive of obsolete content
you can generate click and change events programmatically with the button's click() method.
... attaching panels to buttons you can attach panels to buttons by passing the button as the position option to the panel's show() method or the panel's constructor: var { togglebutton } = require('sdk/ui/button/toggle'); var panels = require("sdk/panel"); var self = require("sdk/self"); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onchange: handlechange }); var panel = panels.panel({ contenturl: self.data.url("panel.html"), onhide: handlehide }); function handlechange(state) { if (state.checked) { panel.show({ position: button }); } } function handlehide() { button.state('window', {checked: false}); } disabling buttons you can disable a butto...
... label = "my default" w1 t1 > displays "my default" t2 > displays "my default" w2 t3 > displays "my t3 label" t4 > displays "my w2 label" setting the properties on the button instance sets the button's global state: button.label = "my new label"; you can set state to be specific to a window or tab using the button's state() method.
...And 7 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.
... the open method takes two required parameters: the http request method and the url to send the request.
... the http request method can be "get", "post" or "put".
...And 7 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
the most technically sound method of achieving this, and the only acceptable way of changing preferences such that they are automatically restored on add-on uninstall, is to make such changes in the default preference branch, as explained below.
...the following example bootstrap.js file illustrates the method: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // import the services module.
...while the former is the simpler method, it does not support complex descriptions containing suggestion urls or separate keyword search urls.
...And 7 more matches
MMgc - Archive of obsolete content
there are a few methods that you may need to call directly, such as alloc and free.
... gc::alloc, gc::free the alloc and free methods are garbage-collected analogs for malloc and free.
...void gcobject::method() { gc* gc = mmgc::gc::getgc(this); ...
...And 7 more matches
JavaScript Client API - Archive of obsolete content
in this case, it is highly recommended to use the utils.makeguid() helper to generate new guids: let newguid = utils.makeguid(); your store object must implement the following methods: itemexists(id) createrecord(id, collection) changeitemid(oldid, newid) getallids() wipe() create(record) update(record) remove(record) you may also find it useful to override other methods of the base implementation, for example applyincomingbatch if the underlying storage for your data supports batch operations.
... createrecord the createrecord( id, collection ) method gets called by the engine to request a new record for an item with a given guid.
...this is the method that the engine will call the first time it syncs, in order to get a complete inventory of what data there is that will need to be uploaded to the server.
...And 7 more matches
listbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a list of items where one or more of the items may be selected.
...there are numerous methods which allow the items in the listbox to be retrieved and modified.
... attributes disabled, disablekeynavigation, preference, rows, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeynavigation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <lis...
...And 7 more matches
NPN_InvokeDefault - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary invokes the default method, if one exists, on the given npobject.
... syntax #include <npruntime.h> bool npn_invokedefault(npp npp, npobject *npobj, const npvariant *args, uint32_t argcount, npvariant *result); parameters the function has the following parameters: npp the npp indicating which plugin wants to call the default method on the object.
... npobj the object on which to invoke the default method.
...And 7 more matches
Using workers in extensions - Archive of obsolete content
so we need to move the refreshinformation() method from the stockwatcher2.js file into a separate file that will host the worker thread.
... if there is no data field, the refreshinformation() method is called to fetch the latest information about the stock and pass it back to the main thread.
... the refreshinformation() method is fairly similar to the previous versions, with two notable exceptions: if the ticker symbol has not been set yet, an exception is thrown (lines 4-6).
...And 7 more matches
Archived JavaScript Reference - Archive of obsolete content
do not use it!array.observe()the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects.
...you can use the more general proxy object instead.array.unobserve()the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers.
... you can use the more general proxy object instead.arraybuffer.transfer()the static arraybuffer.transfer() method returns a new arraybuffer whose contents have been taken from the oldbuffer's data and then is either truncated or zero-extended by newbytelength.
...And 7 more matches
JavaArray - Archive of obsolete content
created by any java method which returns an array.
... in addition, you can create a javaarray with an arbitrary data type using the newinstance method of the array class: public static object newinstance(class componenttype, int length) throws negativearraysizeexception description the javaarray object is an instance of a java array that is created in or passed to javascript.
... in javascript 1.4 and later, the methods of java.lang.object are inherited by javaarray.
...And 7 more matches
Writing JavaScript for XHTML - Archive of obsolete content
even the plain old alert() method is gone.
... solution: use or convert to lower case for methods like getelementsbytagname(), passing the name in lower case will work in both html and xhtml.
...this method does not exist in xmldocuments anymore.
...And 7 more matches
HTML parser threading
that method call doesn't yet cause anything to be parsed, though.
...the nsistreamlistener methods (onstartrequest, ondataavailable and onstoprequest) are called on the main thread.
...passing data to the parser thread nshtml5streamparser gets some of its methods called on the main thread and some called on the parser thread.
...And 7 more matches
Downloads.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
...example (using task.jsm): try { yield downloads.fetch(sourceuri, targetfile); } catch (ex if ex instanceof downloads.error && ex.becausetargetfailed) { console.log("unable to write to the target file, ignoring the error."); } methods createdownload() creates a new download object.
... this download method does not provide user interface or the ability to cancel or restart the download programmatically.
...And 7 more matches
SpiderMonkey 31
migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey must now be initialized before it can be used, using the newly-repurposed js_init method.
... after this method is called, normal jsapi operations are permitted.
... when all jsapi operation has completed, the corresponding js_shutdown method (currently non-mandatory, but highly recommended as it may become mandatory in the future) uninitializes spidermonkey, cleaning up memory and allocations performed by js_init.
...And 7 more matches
NS_ConvertASCIItoUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign ...
... methods constructors void ns_convertasciitoutf16(const char*) - source parameters char* acstring void ns_convertasciitoutf16(const char*, pruint32) - source parameters char* acstring pruint32 alength void ns_convertasciitoutf16(const nsacstring_internal&) - source parameters nsacstring_internal& acstring operator= nsautostring& operator=(const nsautostring&) - source parameters nsauto...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
NS_ConvertUTF16toUTF8
class declaration a helper class that converts a utf-16 string to utf-8 method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseeq...
... methods constructors void ns_convertutf16toutf8(const prunichar*) - source a helper class that converts a utf-16 string to utf-8 parameters prunichar* astring void ns_convertutf16toutf8(const prunichar*, pruint32) - source parameters prunichar* astring pruint32 alength void ns_convertutf16toutf8(const nsastring_internal&) - source parameters nsastring_internal& astring operator= ...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
NS_ConvertUTF8toUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign ...
... methods constructors void ns_convertutf8toutf16(const char*) - source parameters char* acstring void ns_convertutf8toutf16(const char*, pruint32) - source parameters char* acstring pruint32 alength void ns_convertutf8toutf16(const nsacstring_internal&) - source parameters nsacstring_internal& acstring operator= nsautostring& operator=(const nsautostring&) - source parameters nsautostr...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
NS_LossyConvertUTF16toASCII
class declaration a helper class that converts a utf-16 string to ascii in a lossy manner method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsasc...
... methods constructors void ns_lossyconvertutf16toascii(const prunichar*) - source a helper class that converts a utf-16 string to ascii in a lossy manner parameters prunichar* astring void ns_lossyconvertutf16toascii(const prunichar*, pruint32) - source parameters prunichar* astring pruint32 alength void ns_lossyconvertutf16toascii(const nsastring_internal&) - source parameters nsastri...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsAdoptingCString
method overview constructors operator= operator const char* operator[] get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data ...
... methods constructors void nsadoptingcstring() - source void nsadoptingcstring(char*, pruint32) - source parameters char* str pruint32 length void nsadoptingcstring(const nsadoptingcstring&) - source parameters nsadoptingcstring& str operator= nsadoptingcstring& operator=(const nsadoptingcstring&) - source parameters nsadoptingcstring& str nsxpidlcstring& operator=(const nsxp...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsAdoptingString
method overview constructors operator= operator const prunichar* operator[] get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length...
... methods constructors void nsadoptingstring() - source void nsadoptingstring(prunichar*, pruint32) - source parameters prunichar* str pruint32 length void nsadoptingstring(const nsadoptingstring&) - source parameters nsadoptingstring& str operator= nsadoptingstring& operator=(const nsadoptingstring&) - source parameters nsadoptingstring& str nsxpidlstring& operator=(const nsx...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsAutoString
names: nsautostring for wide characters nscautostring for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat begin...
... methods constructors void nsautostring() - source constructors void nsautostring(prunichar) - source parameters prunichar c void nsautostring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsautostring(const nsautostring&) - source parameters nsautostring& str void nsautostring(const nsastring_internal&) - source parameters nsastring_int...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsCAutoString
names: nsautostring for wide characters nscautostring for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring ...
... methods constructors void nscautostring() - source constructors void nscautostring(char) - source parameters char c void nscautostring(const char*, pruint32) - source parameters char* data pruint32 length void nscautostring(const nscautostring&) - source parameters nscautostring& str void nscautostring(const nsacstring_internal&) - source parameter...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsCString
method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading begi...
... methods constructors void nscstring() - source constructors void nscstring(char) - source parameters char c void nscstring(const char*, pruint32) - source parameters char* data pruint32 length void nscstring(const nscstring&) - source parameters nscstring& str void nscstring(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple void nscstring(const nsacst...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsDependentCString
method overview constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appen...
... methods constructors nsdependentcstring(const char*, const char*) - source parameters char* start a pointer to the start of the string.
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsDependentString
method overview constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint app...
... methods constructors void nsdependentstring(const prunichar*, const prunichar*) - source constructors parameters prunichar* start prunichar* end void nsdependentstring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsdependentstring(const prunichar*) - source parameters prunichar* data void nsdependentstring(const nsastring_internal&) - source ...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsFixedCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char...
... methods constructors void nsfixedcstring(char*, pruint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (optional) the length of the string already contained in the buffer parameters char* data pruint32 storagesize void nsfixedcstring(char*, pruint32, pruin...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsFixedString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign ...
... methods constructors void nsfixedstring(prunichar*, pruint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (optional) the length of the string already contained in the buffer parameters prunichar* data pruint32 storagesize void nsfixedstring(prunichar*, pruint32, pruin...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsPromiseFlatCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char...
... methods constructors void nspromiseflatcstring(const nsacstring_internal&) - source parameters nsacstring_internal& str void nspromiseflatcstring(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple operator= nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsacstring...
...@return offset in string, or knotfound parameters nscstring& astring prbool aignorecase print32 aoffset print32 acount print32 find(const char*, prbool, print32, print32) const - source parameters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsPromiseFlatString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign ...
... methods constructors void nspromiseflatstring(const nsastring_internal&) - source parameters nsastring_internal& str void nspromiseflatstring(const nssubstringtuple&) - source parameters nssubstringtuple& tuple operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& ope...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
nsString
method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting ...
... methods constructors void nsstring() - source constructors void nsstring(prunichar) - source parameters prunichar c void nsstring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsstring(const nsstring&) - source parameters nsstring& str void nsstring(const nssubstringtuple&) - source parameters nssubstringtuple& tuple void nsstring(co...
...ecase print32 aoffset print32 acount print32 find(const nsaflatstring&, print32, print32) const - source parameters nsaflatstring& astring print32 aoffset print32 acount print32 find(const prunichar*, print32, print32) const - source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...And 7 more matches
mozIStorageService
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) see mozistorageconnection method overview nsifile backupdatabasefile(in nsifile adbfile, in astring abackupfilename, [optional] in nsifile abackupparentdirectory); mozistorageconnection opendatabase(in nsifile adatabasefile); mozistorageconnection openspecialdatabase(in string astoragekey); mozistorageconnection openunshareddatabase(in nsifile adatabasefile); methods ...
...backupdatabasefile() this method makes a backup of the specified file.
... the database should not be open, or you should ensure that no database activity is happening when you call this method.
...And 7 more matches
nsIAccessibleText
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void addselection(in long startoffset, in long endoffset); nsiaccessible getattributerange(in long offset, out long rangestartoffset, out long rangeendoffset); obsolete since gecko 1.9.1 wchar getcharacteratoffset(in long offset); void getcharacterextents(in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype); long getoffsetatpoint(in long x, in long y, in unsigned long coordtype); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long coord...
... constant value description coord_type_screen 0 coord_type_window 1 methods addselection() void addselection( in long startoffset, in long endoffset ); parameters startoffset endoffset getattributerange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) get the accessible and start/end offsets around the given offset.
... getselectionbounds() void getselectionbounds( in long selectionnum, out long startoffset, out long endoffset ); parameters selectionnum startoffset endoffset gettext() string methods may need to return multibyte-encoded strings, since some locales can not be encoded using 16-bit chars.
...And 7 more matches
nsIAsyncInputStream
if the stream implements nsiasyncinputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes readable or closed (via the asyncwait() method).
...method overview void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the under...
... methods asyncwait() asynchronously wait for the stream to be readable or closed.
...And 7 more matches
nsIAsyncOutputStream
if the stream implements nsiasyncoutputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method).
...method overview void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the u...
... methods asyncwait() asynchronously wait for the stream to be writable or closed.
...And 7 more matches
nsIChannel
method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable.
...this means that: the stream listener this channel will be notifying was initially passed to the asyncopen() method of some other channel this channel's uri is a better identifier of the resource being accessed than this channel's originaluri.
... methods asyncopen() asynchronously open this channel.
...And 7 more matches
nsIMsgFolder
check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp.
... inherits from: nsisupports method overview void startfolderloading(); void endfolderloading(); void updatefolder(in nsimsgwindow awindow); nsimsgfilterlist getfilterlist(in nsimsgwindow msgwindow); void setfilterlist(in nsimsgfilterlist filterlist); void forcedbclosed(); void delete(); void deletesubfolders(in nsisupportsarray folders, in nsimsgwindow msgwindow); void propagatedelete(in nsimsgfolder folder, in boolean deletestorage,in nsimsgwindow msgwindow); void recursivedelete(in boolean deletestorage, in nsimsgwindow msgwindow); void createsubfolder(in astring foldername, in nsimsgwindow msgwindow); nsimsgfolder addsubfolder(in astring foldername); ...
... uri acstring readonly: old nsifolder properties and methods.
...And 7 more matches
nsINavHistoryResultObserver
method overview void batching(in boolean atogglemode); void containerclosed(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containeropened(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containerstatechanged(in nsinavhistorycontainerresultnode acontainernode, in unsign...
... methods batching() lets the observer know when a batch operation in places is about to start or end.
...note: this method was deprecated in gecko 2.0 and removed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8).
...And 7 more matches
nsIXPConnect
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to access the xpconnect service, use code like this: nsresult rv; nscomptr<nsixpconnect> xpconnect = do_getservice(nsixpconnect::getcid(), &rv); if (ns_succeeded(rv)) { /* use the object */ } method overview void addjsholder(in voidptr aholder, in nsscriptobjecttracerptr atracer); native code only!
... obsolete since gecko 2.0 methods native code only!addjsholder root js objects held by aholder.
...if the caller intends to use the return value from this call, the caller is responsible for rooting the jsval before making a call to this method.
...And 7 more matches
xptcall FAQ
xptcall is a small low level xpcom method call library.
...it is used to facilitate cross language and cross thread method calls.
... xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces.
...And 7 more matches
The libmime module
one of the methods provided by this parser is the ability to emit an html representation of the data stream.
...the parent classes) and then we define the class object using the mimedefclass macro: #include "foobar.h" #define mime_superclass parentlclass mimedefclass(foobar, foobarclass, foobarclass, &mime_superclass); the definition of mime_superclass is just to move most of the knowlege of the exact class hierarchy up to the file's header, instead of it being scattered through the various methods; see below.
... method declarations we will be putting function pointers into the class object, so we declare them here.
...And 7 more matches
FileSystemEntrySync - Web APIs
it includes methods for working with files—including copying, moving, removing, and reading files—as well as information about the file it points to—including the file name and its path from the root to the entry.
... basic concepts the filesystementrysync interface includes methods that you would expect for manipulating files and directories, but it also include a really handy method for getting a url of the entry: tourl().
... 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); directoryen...
...And 7 more matches
HTMLInputElement.stepDown() - Web APIs
the htmlinputelement.stepdown([n]) method decrements the value of a numeric type of <input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter.
... the method, when invoked, decrements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified.
... <!-- decrements by intervals of 900 seconds (15 minute) --> <input type="time" max="17:00" step="900"> <!-- decrements by intervals of 7 days (one week) --> <input type="date" max="2019-12-25" step="7"> <!-- decrements by intervals of 12 months (one year) --> <input type="month" max="2019-12" step="12"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set within the form control.
...And 7 more matches
HTMLSelectElement - Web APIs
these elements also share all of the properties and methods of other html elements via the htmlelement interface.
... methods this interface inherits the methods of htmlelement, and of element and node.
...this method is now implemented on htmlelement.
...And 7 more matches
Using IndexedDB - Web APIs
this article documents the types of objects used by indexeddb, as well as the methods of the asynchronous api (the synchronous api was removed from spec).
... the second parameter to the open method is the version of the database.
...the method takes a name of the store, and a parameter object.
...And 7 more matches
Microdata DOM API - Web APIs
the document.getitems(typenames) method provides access to the top-level microdata items.
... methods document .
... the document.getitems(typenames) method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types.
...And 7 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
pc.onicecandidate = ({candidate}) => signaler.send({candidate}); this simply takes the candidate member of this ice event and passes it through to the signaling channel's send() method to be sent over the signaling server to the remote peer.
...this method is invoked each time a message arrives from the signaling server.
... if the newly-set remote description is an offer, we ask webrtc to select an appropriate local configuration by calling the rtcpeerconnection method setlocaldescription() without parameters.
...And 7 more matches
Signaling and video calling - Web APIs
each entry in connectionarray is a websocket object, so we can just call its send() method directly.
...every ice candidate describes a method that the sending peer is able to use to communicate.
... candidate the sdp candidate string, describing the proposed connection method.
...And 7 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
we can use the baseaudiocontext.createperiodicwave method to use this custom wave with an oscillator.
...to do so, we need to pass real and imaginary values into the baseaudiocontext.createperiodicwave() method.: let wave = audioctx.createperiodicwave(wavetable.real, wavetable.imag); note: in our example the wavetable is held in a separate javascript file (wavetable.js), because there are so many values.
...let's create a simple one so we get used to the methods we need to create an envelope with the web audio api.
...And 7 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
the fetch() method of the windoworworkerglobalscope mixin starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response is available.
... windoworworkerglobalscope is implemented by both window and workerglobalscope, which means that the fetch() method is available in pretty much any context in which you might want to fetch resources.
... the fetch() method is controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrieving.
...And 7 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
you could start by simply enhancing elements in your design with grid, that could otherwise display using an older method.
... overwriting of legacy methods with grid layout works surprisingly well, due to the way grid interacts with these other methods.
...5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { overflow: hidden; margin: 0 -10px; padding: 0; list-style: none; } .wrapper li { float: left; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } <div class="wrapper"> <ul> <li class="card"><h2>one</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="card"><h2>two</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="card"><h2>three</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="card"><h2>four</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="...
...And 7 more matches
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
this method is non-conforming, use css color property in conjunction with the :active pseudo-class instead.
...this method is non-conforming, use css background property on the element instead.
...this method is non-conforming, use css background-color property on the element instead.
...And 7 more matches
Redirections in HTTP - HTTP
code text method handling typical use case 301 moved permanently get methods unchanged.
... 308 permanent redirect method and body not changed.
... [1] the specification did not intend to allow method changes, but there are existing user agents that do change their method.
...And 7 more matches
Object.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of the specified object.
... description javascript calls the valueof method to convert an object to a primitive value.
... you rarely need to invoke the valueof method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected.
...And 7 more matches
Object - JavaScript
description nearly all objects in javascript are instances of object; a typical object inherits properties (including methods) from object.prototype, although these properties may be shadowed (a.k.a.
... changes to the object prototype object are seen by all objects through prototype chaining, unless the properties and methods subject to those changes are overridden further along the prototype chain.
... deleting a property from an object there isn't any method in an object itself to delete its own properties (such as map.prototype.delete()).
...And 7 more matches
Promise - JavaScript
this lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future.
...when either of these options happens, the associated handlers queued up by a promise's then method are called.
... as the promise.prototype.then() and promise.prototype.catch() methods return promises, they can be chained.
...And 7 more matches
Introduction to using XPath in JavaScript - XPath
document.evaluate this method evaluates xpath expressions against an xml based document (including html documents), and returns a xpathresult object, which can be a single node or a set of nodes.
... the existing documentation for this method is located at document.evaluate, but it is rather sparse for our needs at the moment; a more comprehensive examination will be given below.
...the function can be either: created by using the creatensresolver method of a xpathevaluator object.
...And 7 more matches
dev/panel - Archive of obsolete content
however it can send messages to the panel document using the postmessage method of panel.
... two-way messaging the panel document does not have an equivalent postmessage method, so if you want your panel document to communicate back to the add-on, you can use channel messaging.
... when the user opens a panel and the panel is created, the framework calls the panel's setup method.
...And 6 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
also, because it works with the javascript in extensions and firefox itself, the debugger can be a good way to learn about design methods.
...note that in this file, the method names serve as the test names.
... in junit and similar packages, methods containing tests that start with testhoge are recognized as tests.
...And 6 more matches
Space Manager High Level Design - Archive of obsolete content
the primary classes that interact with the space manager are: nsblockreflowstate nsblockframe nsboxtoblockadaptor the general interaction model is to create a space manager for a block frame in the context of a reflow, and to associate it with the blockreflowstate so it is passed down to child frames' reflow methods.
...if so, the vertical space that has been affected (including both the float's old region and the float's new region) is noted in the internal nsintervalset as potential float damage (the method is includeindamage).
...bandrects are a linked list (provided by prcliststr super-class) and also provide some geometry-management methods (splitvertically, splithorizontally) and some methods that query or manipulate the frames associated with the band (isoccupiedby, addframe, removeframe).
...And 6 more matches
Focus and Selection - Archive of obsolete content
we want to use a capturing event handler, so the addeventlistener method needs to be used.
... it registers a capturing event handler with the window which will call the setfocusedelement method.
... this method gets the focused element from the command dispatcher and sets a label to its tag name.
...And 6 more matches
Manipulating Lists - Archive of obsolete content
« previousnext » the xul listbox provides a number of specialized methods.
... list manipulation the listbox element provides numerous methods to retrieve and manipulate its items.
... these three methods are also available for several other xul elements and work in the same manner.
...And 6 more matches
editor - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a frame which is expected to contain an editable document.
...if you do not set the editortype attribute on an editor, you must enable editing using the makeeditable method.
... call the makeeditable method to make the document loaded in the editor editable.
...And 6 more matches
panel - Archive of obsolete content
ArchiveMozillaXULpanel
« xul reference home [ examples | attributes | properties | methods | related ] a panel is a used as a temporary floating popup window that may contain any type of content.
...a panel may also be opened via a script using the openpopup method.
... the panel is closed when the user clicks outside the panel, presses escape or when the panel's hidepopup method is called.
...And 6 more matches
NPAPI plugin reference - Archive of obsolete content
browser-side plug-in api this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to request information, tell the browser to repaint part of the window, and so forth.
... the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in.
... npapi plug-in side api this chapter describes methods in the plug-in api that are available from the plug-in object; these allow plug-ins to interact with the browser.
...And 6 more matches
Adobe Flash - Archive of obsolete content
it can also access javascript methods from within the plugin.
... this article explains how javascript can be used to access methods from within the flash plugin, as well as how a feature called fscommands can be used to access javascript functions from within the flash animation.
...the description string is broken into an array of constituent strings based on an invocation of the match method with a regular expression that assumes that the string format will be in the format flash major rminor where major can be a major revision such as "5" or "6" and minor is the subsidiary version number.
...And 6 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.
... this test takes that idea to the extreme and tests a large number of properties and methods to determine the level of support a browser has for particular standards and reports a rating as the percentage of names the browser defines.
... 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 6 more matches
Reference - Archive of obsolete content
if it's not in a standard, and that sun doc is corrent, then it should probably go in the window object methods.
... --jonnyq i've already added those methods in the methods listing, but i haven't defined them yet.
... unfortunately there is not an [easy] method to download content/packages of content off of devmo for 'local' browsing/viewing/printing, yet.
...And 6 more matches
Bounding volume collision detection with THREE.js - Game development
once instantiated, they have methods available to do intersection tests against other volumes.
...box3 / sphere both box3 and sphere have a containspoint method to do this test.
...box3 the box3.intersectsbox method is available for performing this test.
...And 6 more matches
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.
...without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the important thing to remember is that the framework is setting up helpful methods to speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually.
... note: you can read the building monster wants candy article for the in-depth introduction to the basic phaser-specific functions and methods.
...And 6 more matches
Responsive design - Learn web development
flexible layout before responsive design a number of approaches were developed to try to solve the downsides of the liquid or fixed-width methods of building websites.
... in 2004 cameron adams wrote a post entitled resolution dependent layout, describing a method of creating a design that could adapt to different screen resolutions.
...modern css layout methods are inherently responsive, and we have new things built into the web platform to make designing responsive sites easier.
...And 6 more matches
Arrays - Learn web development
some useful array methods in this section we'll look at some rather useful array-related methods that allow us to split strings into array items and vice versa, and add new items into arrays.
...to do this, we can use the split() method.
... note: okay, this is technically a string method, not an array method, but we've put it in with arrays as it goes well here.
...And 6 more matches
Adding features to our bouncing balls demo - Learn web development
the ball draw(), update(), and collisiondetect() method definitions should be able to stay exactly the same as they were before.
... defining evilcircle()'s methods evilcircle() should have four methods, as described below.
... draw() this method has the same purpose as ball()'s draw() method: it draws the object instance on the canvas.
...And 6 more matches
Using Vue computed properties - Learn web development
these work similarly to methods, but only re-run when one of their dependencies changes.
...computed properties work similarly to methods, but only re-run when one of their dependencies changes.
... to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously.
...And 6 more matches
mach
the decorators are: @commandprovider this is a class decorator that tells mach that this class contains methods that implement mach commands.
... @command this is a method decorator that tells mach that this method implements a mach command.
... @commandargument this is a method decorator that tells mach about an argument to a mach command.
...And 6 more matches
Error codes returned by Mozilla APIs
these components usually provide an initialization method, often called init, which must be called before other methods are used.
... ns_error_not_implemented (0x80004001) this error is caused by methods which are not implemented.
... ns_error_illegal_value (0x80070057) an argument supplied to a method was not valid, for instance a null value was supplied as an argument which does not allow null values, or a value was out of range.
...And 6 more matches
OS.File for the main thread
this example also shows the resolve value of open (an instance of os.file, this is a file, so you can do any of the methods on it found here), write (a number indicating bytes written), and close (undefined, meaning there is no resolve value).
...', valopen); var txttoappend = 'append some text \n'; var txtencoded = new textencoder().encode(txttoappend); valopen.write(txtencoded).then(valwrite => { console.log('valwrite:', valwrite); valopen.close().then(valclose => { console.log('valclose:', valclose); console.log('successfully appended'); }); }); }); global object os.file method overview promise<file> open(in string path, [optional] in object mode, [optional] in object options); promise<object> openunique(in string path, [optional] in object options); promise<void> copy(in string sourcepath, in string destpath, [optional] in object options); promise<bool> exists(in string path); promise<string> getcurrentdirectory(); ...
...path, in date|number accessdate, in date|number modificationdate); promise<void> setpermissions(in string path, in object options ); promise<file.info> stat(in string path, [optional] in object options); promise<void> unixsymlink(in string targetpath, in string createpath); promise<void> writeatomic(in string path, in arrayview data, in object options); methods os.file.open() use method os.file.open() to open a file.
...And 6 more matches
JSAPI reference
these functions may call javascript methods.
... js_getmethod obsolete since jsapi 23 js_getmethodbyid obsolete since jsapi 23 a spidermonkey extension allows a native function to return an lvalue—that is, a reference to a property of an object: js_setcallreturnvalue2 obsolete since javascript 1.8.5 id a jsid is an identifier for a property or method of an object.
...y 38 js::propertyspecnameequalsid added in spidermonkey 38 js::propertyspecnametopermanentid added in spidermonkey 38 js_getreservedslot js_setreservedslot struct jsextendedclass obsolete since javascript 1.8.5 struct jsobjectops obsolete since javascript 1.8.5 struct jsxmlobjectops obsolete since javascript 1.8.5 struct jsproperty obsolete since jsapi 16 adding native properties and methods to classes: jsnative struct jsfunctionspec js_fs added in spidermonkey 1.8 js_fn added in spidermonkey 1.8 js_sym_fn added in spidermonkey 38 js_fninfo added in spidermonkey 17 js_self_hosted_fn added in spidermonkey 31 js_self_hosted_sym_fn added in spidermonkey 38 js_sym_fnspec added in spidermonkey 38 js_fnspec added in spidermonkey 31 js_fs_end added in spidermonkey 1.8 struct ...
...And 6 more matches
Language bindings
more specifically, an xpcom language binding: enables access to xpcom objects from that language (where access means reading/writing/creating xpcom objects as well as calling methods on them).
...the scriptable methods on the nsicomponentmanager interface can be called directly on this object.components.resultscomponents.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value.components.returncodecomponents.stackcomponents.stack is a read only pr...
... components.utils.getglobalforobjectthis method is used to determine the global object with which an object is associated.
...And 6 more matches
mozIStorageStatement
method overview void initialize(in mozistorageconnection adbconnection, in autf8string asqlstatement); obsolete since gecko 1.9.1 void finalize(); mozistoragestatement clone(); autf8string getparametername(in unsigned long aparamindex); unsigned long getparameterindex(in autf8string aname); autf8string getcolumnname(in unsigned long acolumnindex); unsigned long getcolumnindex(in autf8string...
... methods initialize() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this method has been removed for gecko 1.9.1.
...this method exists back to gecko 1.8.0.
...And 6 more matches
nsIChannelEventSink
these methods are called before onstartrequest.
... note: prior to gecko 2.0, redirect handling was synchronous, using the onchannelredirect() method.
... starting in gecko 2.0, that method no longer exists, and instead the asynconchannelredirect() method is called; this uses a callback to handle redirects asynchronously.
...And 6 more matches
nsIIOService
inherits from: nsisupports last changed in gecko 1.2 this interface duplicates many of the nsiprotocolhandler methods in a protocol handler independent way (for example newuri() inspects the scheme in order to delegate creation of the new uri to the appropriate protocol handler).
... implemented by @mozilla.org/network/io-service;1 as a service: var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); method overview boolean allowport(in long aport, in string ascheme); acstring 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 aloadingp...
... methods allowport() checks if a port number is banned.
...And 6 more matches
nsIMsgMessageService
inherits from: nsisupports method overview void copymessage(in string asrcuri, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiu...
... aurllistener, in boolean aconvertdata, in string aadditionalheader); nsiuri streamheaders(in string amessageuri, in nsistreamlistener aconsumer, in nsiurllistener aurllistener [optional] in boolean alocalonly); boolean ismsginmemcache(in nsiuri aurl, in nsimsgfolder afolder, out nsicacheentrydescriptor acacheentry); nsimsgdbhdr messageuritomsghdr(in string uri); methods copymessage() pass in the uri for the message you want to have copied.
...you always can use streammessage to get the eml string representation of the message and then write it using file i/o methods.
...And 6 more matches
nsIThreadObserver
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void afterprocessnextevent(in nsithreadinternal thread, in unsigned long recursiondepth); void ondispatchedevent(in nsithreadinternal thread); void onprocessnextevent(in nsithreadinternal thread, in boolean maywait, in unsigned long recursiondepth); methods afterprocessnextevent() called by the nsithread method nsithread.processnextevent() after an event is processed.
... this method is only called on the target thread.
... note: it is valid to change the thread's observer during a call to this method.
...And 6 more matches
nsITransaction
inherits from: nsisupports last changed in gecko 1.7 method overview void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient state.
... this attribute is checked by the transaction manager after the transaction's execute() method is called.
... if the transient state is false, a reference to the transaction is held by the transaction manager so that the transactions' undotransaction() and redotransaction() methods can be called.
...And 6 more matches
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface.
...the invoke functionality requires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); calling code is expected to supply an array of nsxptcvariant structs.
...the platform specific code then builds a call frame and invokes the method indicated by the index methodindex on the xpcom interface that.
...And 6 more matches
Working with data
you can always get a pointer to the c value using the cdata object's address() method.
... you can work around this by serializing these values using the tostring() method and comparing using the resulting string.
... converting c strings to javascript the cdata object provides the readstring() method, which reads bytes from the specified string and returns a new javascript string object representing that string.
...And 6 more matches
Debugger.Script - Firefox Developer Tools
the debugger interface constructs debugger.script objects as scripts of debuggee code are uncovered by the debugger: via the onnewscript handler method; via debugger.frame’s script properties; via the functionscript method of debugger.object instances; and so on.
... debugger.script objects for webassembly are uncovered via onnewscript when a new webassembly module is instantiated and via the findscripts method on debugger instances.
...many properties and methods below throw.
...And 6 more matches
AudioNode - Web APIs
WebAPIAudioNode
creating an audionode there are two ways to create an audionode: via the constuctor and via the factory method.
... // constructor const analysernode = new analysernode(audioctx, { fftsize: 2048, maxdecibels: -25, mindecibels: -60, smoothingtimeconstant: 0.5, }); // factory method const analysernode = audioctx.createanalyser(); analysernode.fftsize = 2048; analysernode.maxdecibels = -25; analysernode.mindecibels = -60; analysernode.smoothingtimeconstant = 0.5; you are free to use either constructors or factory methods, or mix both, however there are advantages to using the constructors: all parameters can be set during construction time and don't need to be set individually.
...while the actual processing is done internally by the browser and cannot be altered, you could write a wrapper around an audio node to provide custom properties and methods.
...And 6 more matches
CSS Typed Object Model API - Web APIs
cssstylevalue.parse(property, csstext) the parse() method of the cssstylevalue interface allows a cssnumericvalue to be constructed from a css string.
... cssstylevalue.parseall() the parseall() method of the cssstylevalue interface sets all occurences of a specific css property to the specified valueand returns an array of cssstylevalue objects, each containing one of the supplied values.
... stylepropertymap.set() method of stylepropertymap interface that changes the css declaration with the given property to the value given.
...And 6 more matches
Examples of web and XML development using the DOM - Web APIs
however, stopevent also calls an event object method, event.stoppropagation, which keeps the event from bubbling any further up into the dom.
...but the stopevent method has stopped propagation, and so after the data in the table is updated, the event phase is effectively ended, and an alert box is displayed to confirm this.
...n load() { elem = document.getelementbyid("tbl1"); elem.addeventlistener("click", stopevent, false); } </script> </head> <body onload="load();"> <table id="t-daddy" onclick="alert('hi');"> <tr id="tbl1"> <td id="c1">one</td> </tr> <tr> <td id="c2">two</td> </tr> </table> </body> </html> example 6: getcomputedstyle this example demonstrates how the window.getcomputedstyle method can be used to get the styles of an element that are not set using the style attribute or with javascript (e.g., elt.style.backgroundcolor="rgb(173, 216, 230)").
...And 6 more matches
Using files from web applications - Web APIs
x.tofixed(3) + " " + amultiples[nmultiple] + " (" + nbytes + " bytes)"; } // end of optional code document.getelementbyid("filenum").innerhtml = nfiles; document.getelementbyid("filesize").innerhtml = soutput; } document.getelementbyid("uploadinput").addeventlistener("change", updatesize, false); </script> </body> </html> using hidden file input elements using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected.
... you can do this by styling the input element with display:none and calling the click() method on the <input> element.
... using a label element to trigger a hidden file input element to allow opening the file picker without using javascript (the click() method), a <label> element can be used.
...And 6 more matches
FileHandle API - Web APIs
the filehandle.open() method provides such an object which can be readonly or readwrite.
... writing there are three possible writing operations on a locked file: write : it's an arbitrary writing method which starts writing in the file at the lockedfile.location byte.
...the lockedfile interface provides a readastext method and a readasarraybuffer method.
...And 6 more matches
HTML Drag and Drop API - Web APIs
datatransfer objects also have methods to add or remove items to the drag's data.
...the datatransferitem object also has methods to get the drag item's data.
...the list object has methods to add a drag item to the list, remove a drag item from the list, and clear the list of all drag items.
...And 6 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 (id...
... methods add() stores the given value into this object store, optionally with the specified key.
... any add( in any value, in optional any key ) raises (idbdatabaseexception); parameters returns exceptions this method can raise a idbdatabaseexception with the following codes: value the value to store into the index.
...And 6 more matches
LocalFileSystem - Web APIs
the methods are implemented by window and worker objects.
... basic concepts this section includes a few key concepts for the methods.
... you can call the method more than once if you want to create two file systems: one that's temporary and one that's persistent.
...And 6 more matches
PaymentRequest.PaymentRequest() - Web APIs
syntax var paymentrequest = new paymentrequest(methoddata, details, [options]); parameters methoddata contains an array of identifiers for the payment methods the merchant web site accepts and any associated payment method specific data.
... each item in the array contains the following fields: supportedmethods for early implementations of the spec, this was a sequence of identifiers for payment methods that the merchant website accepts.
... 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.
...And 6 more matches
User Timing API - Web APIs
this document provides an overview of the mark and measure performance event types including the four user timing methods that extend the performance interface.
... for more details and example code regarding these two performance event types and the methods, see using the user timing api.
... creating a performance mark the performance.mark() method is used to create a performance mark.
...And 6 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
rtcpeerconnection and rtp each rtcpeerconnection has methods which provide access to the list of rtp transports that service the peer connection.
...these are returned by the rtcpeerconnection.gettransceivers() method, and each mid and transceiver share a one-to-one relationship, with the mid being unique for each rtcpeerconnection.
...this enormously simplifies and makes far more readable the code dealing with the promises returned by webrtc methods.
...And 6 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
as much as possible, standard cinematographic techniques are used, since the viewer has likely grown up watching films using those techniques, and has subconscious expectations that a film or animation will follow those methods.
... there are two techniques in 3d graphics that can create similar though not identical results, and whose methods apply more easily in different situations.
...using the glmatrix library we've used previously, this can be performed using the rotatey() method on the mat4 class, which represents a standard 4x4 matrix.
...And 6 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
there is only one way to create an xrpose, and that's using the getpose() method on an animation frame as given using an xrframe object.
... this means that most frequently, you'll be using poses within your frame rendering code, which is executed as a callback from the xrframe method requestanimationframe().
... the only way to obtain a pose that adapts positional information from one space to another is through the xrframe object received by your frame rendering callback function specified when you called the xrsession method requestanimationframe().
...And 6 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
the module aims to create a consistent method of alignment across all of css.
... note: the documentation for each layout method will detail how box alignment is applied there.
... older alignment methods css traditionally had very limited alignment capabilities.
...And 6 more matches
Getting Started - Developer guides
then, mozilla, safari, and other browsers followed, implementing an xmlhttprequest object that supported the methods and properties of microsoft's original activex object.
...}; next, after declaring what happens when you receive the response, you need to actually make the request, by calling the open() and send() methods of the http request object, like this: httprequest.open('get', 'http://www.example.org/some.file', true); httprequest.send(); the first parameter of the call to open() is the http request method – get, post, head, or another method supported by your server.
... keep the method all-capitals as per the http standard, otherwise some browsers (like firefox) might not process the request.
...And 6 more matches
Cross-browser audio basics - Developer guides
manipulating the audio element with javascript in addition to being able to specify various attributes in html, the <audio> element comes complete with several properties and methods that you can manipulate via javascript.
...ocument.createelement('audio'); if (myaudio.canplaytype('audio/mpeg')) { myaudio.setattribute('src','audiofile.mp3'); } if (myaudio.canplaytype('audio/ogg')) { myaudio.setattribute('src','audiofile.ogg'); } alert('play'); myaudio.play(); alert('stop'); myaudio.pause(); alert('play from 5 seconds in'); myaudio.currenttime = 5; myaudio.play(); let's explore the available properties and methods in more detail.
... play the play() method is used to tell the audio to play.
...And 6 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
required for accessibility autocomplete all hint for form autofill feature autofocus all automatically focus the form control when the page is loaded capture file media capture input method in file upload controls checked radio, checkbox whether the command or control is checked dirname text, search name of form field to use for sending the element's directionality in form submission disabled all whether the form control is disabled form all associates the control with a form element formaction image, submit ...
...url to use for form submission formenctype image, submit form data set encoding type to use for form submission formmethod image, submit http method to use for form submission formnovalidate image, submit bypass form control validation for form submission formtarget image, submit browsing context for form submission height image same as height attribute for <img>; vertical dimension list almost all value of the id attribute of the <datalist> of autocomplete options max numeric types maximum value maxlength password, search, tel, text, url maximum length (number of characters) of value min numeric types minimum value minlength password, search, tel, te...
... <form action="page.html" method="post"> <label>fruit: <input type="text" name="fruit" dirname="fruit.dir" value="cherry"></label> <input type="submit"/> </form> <!-- page.html?fruit=cherry&fruit.dir=ltr --> when the form above is submitted, the input cause both the name / value pair of fruit=cherry and the dirname / direction pair of fruit.dir=ltr to be sent.
...And 6 more matches
HTTP response status codes - HTTP
WebHTTPStatus
the meaning of the success depends on the http method: get: the resource has been fetched and is transmitted in the message body.
... 307 temporary redirect the server sends this response to direct the client to get the requested resource at another uri with same method that was used in the prior request.
... this has the same semantics as the 302 found http response code, with the exception that the user agent must not change the http method used: if a post was used in the first request, a post must be used in the second request.
...And 6 more matches
Closures - JavaScript
this has obvious parallels to object-oriented programming, where objects allow you to associate data (the object's properties) with one or more methods.
... consequently, you can use a closure anywhere that you might normally use an object with only a single method.
... emulating private methods with closures languages such as java allow you to declare methods as private, meaning that they can be called only by other methods in the same class.
...And 6 more matches
Iterators and generators - JavaScript
specifically, an iterator is any object which implements the iterator protocol by having a next() method that returns an object with two properties: value the next value in the iteration sequence.
...when a value is consumed by calling the generator's next method, the generator function executes until it encounters the yield keyword.
... in order to be iterable, an object must implement the @@iterator method.
...And 6 more matches
Meta programming - JavaScript
traps the methods that provide property access.
... handler / trap interceptions invariants handler.getprototypeof() object.getprototypeof() reflect.getprototypeof() __proto__ object.prototype.isprototypeof() instanceof getprototypeof method must return an object or null.
... if target is not extensible, object.getprototypeof(proxy) method must return the same value as object.getprototypeof(target).
...And 6 more matches
Private class fields - JavaScript
syntax class classwithprivatefield { #privatefield } class classwithprivatemethod { #privatemethod() { return 'hello world' } } class classwithprivatestaticfield { static #private_static_field } examples private static fields private fields are accessible on the class constructor from inside the class declaration itself.
... the limitation of static variables being called by only static methods still holds.
... class classwithprivatestaticfield { static #private_static_field static publicstaticmethod() { classwithprivatestaticfield.#private_static_field = 42 return classwithprivatestaticfield.#private_static_field } } console.assert(classwithprivatestaticfield.publicstaticmethod() === 42) private static fields are added to the class constructor at class evaluation time.
...And 6 more matches
static - JavaScript
the static keyword defines a static method for a class.
... static methods aren't called on instances of the class.
... syntax static methodname() { ...
...And 6 more matches
Array.prototype.every() - JavaScript
the every() method tests whether all elements in the array pass the test implemented by the provided function.
... description the every method executes the provided callback function once for each element present in the array until it finds the one where callback returns a falsy value.
... if such an element is found, the every method immediately returns false.
...And 6 more matches
Array.prototype.push() - JavaScript
the push() method adds one or more elements to the end of an array and returns the new length of the array.
... return value the new length property of the object upon which the method was called.
... description the push method appends values to an array.
...And 6 more matches
Function.prototype.apply() - JavaScript
the apply() method calls a function with a given this value, and arguments provided as an array (or an array-like object).
... note that this may not be the actual value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object, and primitive values will be boxed.
...with apply, you can write a method once, and then inherit it in another object, without having to rewrite the method for the new object.
...And 6 more matches
Object.create() - JavaScript
the object.create() method creates a new object, using an existing object as the prototype of the newly created object.
... var obj = object.create({ a: 1, b: 2 }); > console.log(object.entries(obj)); // shows "[]" some non-solutions a good solution for the missing object-methods is not immediately apparent.
... adding the missing object-method directly from the standard-object does not work: ocn = object.create( null ); // create "null" object (same as before) ocn.tostring = object.tostring; // since new object lacks method then try assigning it directly from standard-object > ocn.tostring // shows "tostring() { [native code] }" -- missing method seems to be there now > ocn.tostring == object.tostring // shows "true" -- method seems to be same as the standard object-method > ocn.tostring() // error: function.prototype.tostring requires that 'this' be a function adding the missing object-method directly to new object's "prototype" does not work either, since the new object does not have a real prototype (which is really the cause of all these problems) and one cannot be directly added: ocn = ...
...And 6 more matches
Object.defineProperty() - JavaScript
the static method object.defineproperty() defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
... description this method allows a precise addition to or modification of a property on an object.
... normal property addition through assignment creates properties which show up during property enumeration (for...in loop or object.keys method), whose values may be changed, and which may be deleted.
...And 6 more matches
String.prototype.substring() - JavaScript
the substring() method returns the part of the string between the start and end indexes, or to the end of the string.
...g.substring(1, 0)) // displays 'mozill' console.log(anystring.substring(0, 6)) // displays 'lla' console.log(anystring.substring(4)) console.log(anystring.substring(4, 7)) console.log(anystring.substring(7, 4)) // displays 'mozilla' console.log(anystring.substring(0, 7)) console.log(anystring.substring(0, 10)) using substring() with length property the following example uses the substring() method and length property to extract the last characters of a particular string.
... this method may be easier to remember, given that you don't need to know the starting and ending indices as you would in the above examples.
...And 6 more matches
Iteration protocols - JavaScript
in order to be iterable, an object must implement the @@iterator method, meaning that the object (or one of the objects up its prototype chain) must have a property with a @@iterator key which is available via constant symbol.iterator: property value [symbol.iterator] a zero-argument function that returns an object, conforming to the iterator protocol.
... whenever an object needs to be iterated (such as at the beginning of a for...of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated.
... note that when this zero-argument function is called, it is invoked as a method on the iterable object.
...And 6 more matches
Property accessors - JavaScript
it's typical when speaking of an object's properties to make a distinction between properties and methods.
... however, the property/method distinction is little more than a convention.
... a method is simply a property that can be called (for example, if it has a reference to a function instance as its value).
...And 6 more matches
Codecs used by WebRTC - Web media technologies
other requirements for the purposes of supporting switching between portrait and landscape orientations, there are two methods that can be used.
...in rfc 3389, a method for providing an appropriate filler to use during silences.
...the most efficient way is to use the static method rtcrtpsender.getcapabilities() (or the equivalent rtcrtpreceiver.getcapabilities() for a receiver), specifying the type of media as the input parameter.
...And 6 more matches
Promises - Archive of obsolete content
notifyuser(xhr.responsetext); }); downloading remote files nearly all previous methods of downloading remote files have been superseded by the much simpler downloads.jsm module.
... iconurl, version, loadgroup)); }, getinstallforfile: function getinstallforfile(url, mimetype) { return new promise(accept => this.addonmanager.getinstallforfile(url, accept, mimetype)); }, getallinstalls: function getallinstalls() { return new promise(accept => this.addonmanager.getallinstalls(accept)); }, _replacemethod: function replacemethod(method, callback) { object.defineproperty(this, method, { enumerable: true, configurable: true, value: key => { return new promise(accept => this.addonmanager[method](key, addon => accept(callback(addon)))); } }); }, }; for (let method ...
...of ["getaddonbyid", "getaddonbysyncguid"]) aom._replacemethod(method, addon => aom.addon(addon)); for (let method of ["getalladdons", "getaddonsbyids", "getaddonsbytypes", "getaddonswithoperationsbytypes"]) aom._replacemethod(method, addons => addons.map(aom.addon)); aom._replacemethod("getinstallsbytypes", installs => installs); components.utils.import("resource://gre/modules/addonmanager.jsm", aom); example usage: task.spawn(function* () { // get an extension instance, and its data directory.
...And 5 more matches
Basics - Archive of obsolete content
methods info()this method does stuff.
... log(stringstring)this method writes a notification message to the console.
... stringthe message to add to the consolestring console.log("hello world!"); arn()this method does stuff.
...And 5 more matches
Space Manager Detailed Design - Archive of obsolete content
*/ void clearregions(); /** * methods for dealing with the propagation of float damage during * reflow.
... void* operator new(size_t asize); void operator delete(void* aptr, size_t asize); a static method is used to shutdown the space manager recycling.
... this method deletes all of the space mangers in the recycler,and prevents further recycling.
...And 5 more matches
execute - Archive of obsolete content
method of install object syntax int execute ( string xpisourcepath [, boolean blocking]); int execute ( string xpisourcepath, string args [, boolean blocking]); parameters the execute method has the following parameters: xpisourcepath the pathname of the file to extract and execute.
...the blocking parameter is not available as part of this method in versions of netscape before 6.1/mozilla 0.9.3.
... description the execute method extracts the named file from the xpi file to a temporary file name.
...And 5 more matches
richlistbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content.
... attributes disabled, disablekeynavigation, preference, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeynavigation, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richl...
... suppressonselect type: boolean if this attribute is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods.
...And 5 more matches
toolbar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container which typically contains a row of buttons.
... the chromeclass-toolbar class may be used to create a toolbar where its visibility depends on the toolbar flag when opening the window with the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name.
... if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() method.
...And 5 more matches
Old Proxy API - Archive of obsolete content
proxy factory the object or method that creates intercessive proxies.
... traps the methods that provide property access.
... fundamental traps emulated javascript code handler method description object.getownpropertydescriptor(proxy, name) getownpropertydescriptor: function(name) -> propertydescriptor | undefined should return a valid property descriptor object, or undefined to indicate that no property with name exists in the emulated object.
...And 5 more matches
RDF in Mozilla FAQ - Archive of obsolete content
datasources may be loaded via the rdf service using the getdatasource() method.
... you can either create an rdf/xml datasource using the rdf service's getdatasource() method: // get the rdf service var rdf = components .classes["@mozilla.org/rdf/rdf-service;1"] .getservice(components.interfaces.nsirdfservice); // ...and from it, get the datasource.
... you can force an rdf/xml datasource (or any datasource that supports nsirdfremotedatasource) to reload using the refresh() method of nsirdfremotedatasource.
...And 5 more matches
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
this class will contain native methods callable from javascript.
... this class should also inherit from nsiclassinfo and implement its methods to be able to request all necessary privileges from the mozilla security manager (see example 2).
... how to call plugin native methods the following html code will do the job:</p> this should be changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to build and install having the built mozilla tree is probably not necessary, but building the plugin with a scriptable instance interface will require mozilla headers and the xpcom compatible idl compiler -- xpidl.exe.
...And 5 more matches
CSS layout - Learn web development
at the end of the lessons is an assessment to help you check your understanding of layout methods, by laying out a webpage.
... flexbox flexbox is a one-dimensional layout method for laying out items in rows or columns.
... multiple-column layout the multiple-column layout specification gives you a method of laying content out in columns, as you might see in a newspaper.
...And 5 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
previous overview: asynchronous next this tutorial looks at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
...interestingly enough, this means that you can use either method to clear a settimeout() or setinterval().
... the method takes as an argument a callback to be invoked before the repaint.
...And 5 more matches
Fetching data from the server - Learn web development
add the following below your previous lines inside your updatedisplay() function: let request = new xmlhttprequest(); next, you need to use the open() method to specify what http request method to use to request the resource from the network, and what its url is.
... we'll just use the get method here and set the url as our url variable.
... request.onload = function() { poemdisplay.textcontent = request.response; }; the above is all set up for the xhr request — it won't actually run until we tell it to, which is done using the send() method.
...And 5 more matches
JavaScript Tips
var uniquename = { _privatemember: 3, publicmember: "a string", init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; xpconnect don't use object methods and properties more than you have to.
... don't call methods that you don't have to.
... don't query interfaces unless you need to access methods and properties of that interface.
...And 5 more matches
Addon
instances can be created using the many getaddon methods on the addonmanager object.
... the interface can represent many different kinds of add-ons and as such, some of the methods and properties are considered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons.
... api consumers should take care to verify the existence of these methods or properties before relying on them.
...And 5 more matches
AddonManager
the majority of the methods are asynchronous meaning that results are delivered through callbacks passed to the method.
... the callbacks will be called just once but that may be before or after the method returns.
...to do so many methods of the addonmanager take the add-on types as parameters.
...And 5 more matches
JNI.jsm
unlike c from js-ctypes, defining constants is not a manual magic number method in jni, it is declared the same way we define functions, except in jni they are called fields.
... method overview cdata getforthread(); cdata loadclass(cdata ajenv, string aclassfullyqualifiedname, [optional] object adeclares); cdata newstring(cdata ajenv, string astr); string readstring(cdata ajenv, cdata ajavastring); void unloadclasses(); methods getforthread() blah blah cdata getforthread(); parameters this function does not take any arguments.
...a required object that contains up to five fields of key names: constructors, fields, static_fields, methods, and static_methods.
...And 5 more matches
Deferred
a deferred object is returned by the obsolete promise.defer() method to provide a new promise along with methods to change its state.
...for example, the equivalent of var deferred = promise.defer(); dosomething(function cb(good) { if (good) deferred.resolve(); else deferred.reject(); }); return deferred.promise; would be return new promise(function(resolve, reject) { dosomething(function cb(good) { if (good) resolve(); else reject(); }); }); method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
... methods resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise.
...And 5 more matches
XPCOMUtils.jsm
to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/xpcomutils.jsm"); using xpcomutils exposing a javascript class as a component using these utility methods requires four key steps: import xpcomutils.jsm, as explained previously.
... constructor the constructor is a simple method that handles any required initialization tasks.
... notice that the queryinterface() method implemented by the component simply calls the generateqi() method provided by the xpcomutils code module.
...And 5 more matches
Memory reporting
methods ...
... size_t mystring::sizeofexcludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(mbuffer); } size_t mystring::sizeofincludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(this) + sizeofexcludingthis(amallocsizeof); } (note that sizeofexcludingthis and sizeofincludingthis aren't overrides of methods on a global base class that is common to all reporters.
...that said, note that for some classes these methods may be virtual.) mfbt/memoryreporting.h defines mozilla::mallocsizeof as follows: typedef size_t (*mallocsizeof)(const void* p); functions with this signature measure the size of p by asking the heap allocator how big it is (via moz_malloc_usable_size).
...And 5 more matches
JS::CallArgs
(3nd argument of jsnative) methods methods of js::callargs method description bool requireatleast(jscontext *cx, const char *fnname, unsigned required) returns true if there are at least required arguments passed in.
... methods inherited from js::callargsbase method description unsigned length() const returns the number of arguments..
... methods inherited from js::detail::callreceiverbase method description jsobject &callee() const returns the function being called, as an object.
...And 5 more matches
JS::Value
the different representations are visible using the separate int32/double methods but do not affect observable semantics (ignoring performance).
...(note that both -0 and +0 are allowed, and the latter may sometimes be stored using the int32_t representation.) js::value further provides these methods combining various aspects of the above methods: js::objectornullvalue(jsobject*) returns an object value corresponding to the given non-null pointer, or a null value if the pointer is null.
... js::value is not inherently type-safe it is an error to call any accessor method on a value of a non-matching type: val.toint32() must only be called if val.isint32(), val.tostring() must only be called if val.isstring(), and so on.
...And 5 more matches
JSClass
a c/c++ program can use a jsclass with the js_initclass and js_newobject apis to create objects that have custom methods and properties implemented in c/c++.
... enumerate jsenumerateop method for enumerating object properties.
... checkaccess jscheckaccessop optional method for access checks.
...And 5 more matches
nsIClipboard
inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) method overview void emptyclipboard(in long awhichclipboard); void forcedatatoclipboard(in long awhichclipboard); obsolete since gecko 1.8 void getdata(in nsitransferable atransferable, in long awhichclipboard); boolean hasdatamatchingflavors([array, size_is(alength)] in string aflavorlist, in unsigned long alength, in long awhichclipboard); void setdata(in nsitransferable atransferable, in nsiclipboardowner anowner, in long awhichclipboard); boolean supportsse...
... methods emptyclipboard() this method empties the clipboard and notifies the clipboard owner.
... forcedatatoclipboard() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) some platforms support deferred notification for putting data on the clipboard this method forces the data onto the clipboard in its various formats this may be used if the application going away.
...And 5 more matches
nsIEditor
« xpcom api reference editor/nsieditor.idlscriptable provides methods and attributes used when editing page content.
... 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); selected content removal void deleteselection(in short action, in short stripwrappers); document info a...
...nd file methods void resetmodificationcount(); long getmodificationcount(); void incrementmodificationcount(in long amodcount); void incrementmodificationcount(in long amodcount); transaction methods void dotransaction(in nsitransaction txn); void enableundo(in boolean enable); void undo(in unsigned long count); void canundo(out boolean isenabled, out boolean canundo); void redo(in unsigned long count); void canredo(out boolean isenabled, out boolean canredo); void begintransaction(); void endtransaction(); void beginplaceholdertransaction(in nsiatom name); void endplaceholdertransaction(); boolean shouldtxnsetselection(); void setshouldtxnsetse...
...And 5 more matches
nsIEffectiveTLDService
the methods below implement the public suffix algorithm in full, including the implicit "*" rule.
... method overview acstring getbasedomain(in nsiuri auri, [optional] in pruint32 aadditionalparts); acstring getbasedomainfromhost(in autf8string ahost, [optional] in pruint32 aadditionalparts); acstring getpublicsuffix(in nsiuri auri); acstring getpublicsuffixfromhost(in autf8string ahost); methods getbasedomain() returns the base domain of a uri; that is, the...
...only use this method if this is not the case.
...And 5 more matches
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 findlogi...
...g ahost); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); methods addlogin() stores a new login in the login manager.
... note: this method is provided for use only by the formfillcontroller, which calls it directly.
...And 5 more matches
nsIScriptableIO
for example: io.getfile("profile", "cookies.txt"); from an xpcom component, however, you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant a...
...base, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissions); nsiuri newuri(in nsivariant auri); methods getfile() retrieves a reference to a file or directory on disk.
... the file does not have to exist already; this method simply creates the file reference which may then be passed to the newinputstream() or newoutputstream() method to open the file for reading or writing.
...And 5 more matches
nsISupports proxies
about xpcom proxies a proxy, in this context, is a stub object which enables a method of any class which is derived from nsisupports and has a typelib to be called on any in-process thread.
...it has two entry points: ns_imethod getproxyforobject(nsieventqueue *destqueue, const nsiid & iid, nsisupports *object, print32 proxytype, void * *result); ns_imethod getproxy(nsieventqueue *destqueue, const nsiid & cid, nsisupports *aouter, const nsiid & ii...
... proxy_sync acts just like a function call in that it blocks the calling thread until the the method is invoked on the destination thread.
...And 5 more matches
nsITransactionListener
inherits from: nsisupports last changed in gecko 1.7 method overview void didbeginbatch(in nsitransactionmanager amanager, in nsresult aresult); void diddo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult adoresult); void didendbatch(in nsitransactionmanager amanager, in nsresult aresult); void didmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge, in boolean adidmerge, in nsresult amergeresult); void didredo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aredoresult); void didundo(in nsitransactionmanager amanager, in nsit...
... in nsitransaction atransaction); boolean willendbatch(in nsitransactionmanager amanager); boolean willmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge); boolean willredo(in nsitransactionmanager amanager, in nsitransaction atransaction); boolean willundo(in nsitransactionmanager amanager, in nsitransaction atransaction); methods didbeginbatch() called after a nsitransactionmanager begins a batch.
...diddo() called after a nsitransactionmanager calls the nsitransaction.dotransaction() method of a transaction.
...And 5 more matches
nsIZipWriter
to create an instance, use: var zipwriter = components.classes["@mozilla.org/zipwriter;1"] .createinstance(components.interfaces.nsizipwriter); method overview void addentrychannel(in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue); void addentrydirectory(in autf8string azipentry, in prtime amodtime, in boolean aqueue); void addentryfile(in autf8string azipentry, in print32 acompression, in nsifile afile, in boolean aqueue); void addentrystream(i...
... compression_fastest 1 use the fastest compression method when adding the file to the archive.
... compression_default 6 use the default compression method when adding the file to the archive.
...And 5 more matches
XPCOM
rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method.
...that means you can call javascript methods from c++ and vice versa.
... for more information on the workings of xpcom look elsewhere.how to pass an xpcom object to a new windowif you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.interfacing with the xpcom cycle collectorthis is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
...And 5 more matches
Working with ArrayBuffers
pixelbuffer.tostring(); // "ctypes.uint8_t.ptr(ctypes.uint64("0x352e0000"))" var imgwidth = 400; var imgheight = 400; var myimgdat = new imagedata(imgwidth, imgheight); method 1: passing arraytype cdata to uint8clampedarray.prototype.set one method is to get into a js-ctypes array, and then set it into the imagedata, as illustrated by the following code example.
... method 2: manually handled another strategy is to handle it manually, as illustrated by the following code example: var casted = ctypes.cast(pixelbuffer.address(), ctypes.uint8_t.array(myimgdata.data.length).ptr).contents; // myimgdat.data.length is imgwidth * imgheight *4 because per pixel there is r, g, b, a numbers /** method a **/ for (var nindex = 0; nindex < casted.length; nindex = nindex + 4) ...
...{ // casted.length is same as myimgdat.data.length var r = casted[nindex]; var g = casted[nindex + 1]; var b = casted[nindex + 2]; var a = casted[nindex + 3]; myimgdat.data[nindex] = r; myimgdat.data[nindex + 1] = g; myimgdat.data[nindex + 2] = b; myimgdat.data[nindex + 3] = a; } /***** or do the below which uses the .set method *****/ /** method b **/ var normalarr = []; for (var nindex = 0; nindex < cast.length; nindex = nindex + 4) { // casted.length is same as myimgdat.data.length var r = casted[nindex]; var g = casted[nindex + 1]; var b = casted[nindex + 2]; var a = casted[nindex + 3]; normalarr.push(r); normalarr.push(g); normalarr.push(b); normalarr.push(a); } myimgdat.data.set(normalarr); the preceding example, howeve...
...And 5 more matches
Version, UI, and Status Information - Plugins
to accomplish this, the plug-in calls the npn_status method to display your message on the status line.
...you should use a different method to display messages that the user needs to see, such as error messages.
... the plug-in calls the npn_useragent method to retrieve the contents of the user_agent field.
...And 5 more matches
Using the CSS Typed Object Model - Web APIs
the css typed om makes css manipulation more logical and performant by providing object features (rather than cssom string manipulation), providing access to types, methods, and an object model for css values.
...<dd> for each for (const [prop, val] of defaultcomputedstyles) { // properties const cssproperty = document.createelement('dt'); cssproperty.appendchild(document.createtextnode(prop)); styleslist.appendchild(cssproperty); // values const cssvalue = document.createelement('dd'); cssvalue.appendchild(document.createtextnode(val)); styleslist.appendchild(cssvalue); } the computedstylemap() method returns a stylepropertymapreadonly object containing the size property, which indicates how many properties are in the map.
... .get() method / custom properties let's update our example to only retrieve a few properties and values.
...And 5 more matches
Manipulating video using canvas - Web APIs
the javascript code the javascript code in processor.js consists of three methods.
... initializing the chroma-key player the doload() method is called when the xhtml document initially loads.
... this method's job is to prepare the variables needed by the chroma-key processing code, and to set up an event listener so we can detect when the user starts playing the video.
...And 5 more matches
Pixel manipulation with canvas - Web APIs
st colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); const [redindex, greenindex, blueindex, alphaindex] = colorindices; you may also access the size of the pixel array in bytes by reading the uint8clampedarray.length attribute: var numbytes = imagedata.data.length; creating an imagedata object to create a new, blank imagedata object, you should use the createimagedata() method.
... there are two versions of the createimagedata() method: var myimagedata = ctx.createimagedata(width, height); this creates a new imagedata object with the specified dimensions.
... var myimagedata = ctx.createimagedata(anotherimagedata); getting the pixel data for a context to obtain an imagedata object containing a copy of the pixel data for a canvas context, you can use the getimagedata() method: var myimagedata = ctx.getimagedata(left, top, width, height); this method returns an imagedata object representing the pixel data for the area of the canvas whose corners are represented by the points (left,top), (left+width, top), (left, top+height), and (left+width, top+height).
...And 5 more matches
Document - Web APIs
WebAPIDocument
t x="266" y="1" width="80" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">document</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} the document interface describes the common properties and methods for any kind of document.
... methods this interface also inherits from the node and eventtarget interfaces.
... extension for html documents the document interface for html documents inherit from the htmldocument interface or, since html5, is extended for such documents: document.clear() in majority of modern browsers, including recent versions of firefox and internet explorer, this method does nothing.
...And 5 more matches
Introduction to the File and Directory Entries API - Web APIs
in contrast, the synchronous api does not use callbacks because the api methods return values.
... global methods of the asynchronous and synchronous apis.
... the asynchronous api has the following global methods: requestfilesystem() and resolvelocalfilesystemurl().
...And 5 more matches
HTMLInputElement.stepUp() - Web APIs
the htmlinputelement.stepup() method increments the value of a numeric type of <input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set.
... the method, when invoked, increments the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified.
...0 second (15 minute) increments: <input type="time" min="09:00" step="900"> datetime-local 1 (day) same day of the week: <input type="datetime-local" min="019-12-25t19:30" step="7"> number 1 0.1 increments <input type="number" min="0" step="0.1" max="10"> range 1 increments by 2: <input type="range" min="0" step="2" max="10"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set on the form control.
...And 5 more matches
Working with the History API - Web APIs
html5 introduced the pushstate() and replacestate() methods for add and modifying history entries, respectively.
... these methods work in conjunction with the onpopstate event.
... example of pushstate() method suppose http://mozilla.org/foo.html executes the following javascript: let stateobj = { foo: "bar", } history.pushstate(stateobj, "page 2", "bar.html") this will cause the url bar to display http://mozilla.org/bar.html, but won't cause the browser to load bar.html or even check that bar.html exists.
...And 5 more matches
IDBIndexSync - Web APIs
method overview any add (in any value, in optional any key) raises (idbdatabaseexception); any get (in any key) raises (idbdatabaseexception); any getobject (in any key) raises (idbdatabaseexception); void opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); void openobjectcursor (in optional idbkeyrange range,...
... methods add() stores the given value into this index, optionally with the specified key.
... any add( in any value, in optional any key ) raises (idbdatabaseexception); parameters returns exceptions this method can raise a idbdatabaseexception with the following code: value the value to store into the index.
...And 5 more matches
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.
... methods abort() call this method to signal a need to cancel the effects of the operations performed by this transaction.
... when this method is called, the browser ignores all the changes performed to the objects of this database since this transaction was created.
...And 5 more matches
Capabilities, constraints, and settings - Web APIs
once the script knows whether the property or properties it wishes to use are supported, it can then check the capabilities of the api and its implementation by examining the object returned by the track's getcapabilities() method; this object lists each supported constraint and the values or range of values which are supported.
... finally, the track's applyconstraints() method is called to configure the api as desired by specifying the values or ranges of values it wishes to use for any of the constrainable properties about which it has a preference.
... the track's getconstraints() method returns the set of constraints passed into the most recent call to applyconstraints().
...And 5 more matches
Node - Web APIs
WebAPINode
methods in addition to the properties below, node inherits methods from its parent, eventtarget.
... obsolete methods node.getuserdata() allows a user to get some domuserdata from the node.
... living standard added the following methods: getrootnode() dom4the definition of 'node' in that specification.
...And 5 more matches
Using Performance Timeline - Web APIs
performance extensions performance timeline extends the performance object with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria.
... the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype().
...performance.mark not supported"); return; } // create some performance entries via the mark() and measure() methods performance.mark("begin"); do_work(50000); performance.mark("end"); do_work(50000); performance.measure("measure1", "begin", "end"); // use getentries() to iterate all entries var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("all entry[" + i + "]"); print_perf_entry(p[i]); } // use getentries(name, entrytype) to get specific entries p = per...
...And 5 more matches
Pointer Lock API - Web APIs
the pointer lock api (formerly called mouse lock api) provides input methods based on the movement of the mouse over time (i.e., deltas), not just the absolute position of the mouse cursor in the viewport.
... method/properties overview this section provides a brief description of each property and method related to the pointer lock specification.
... requestpointerlock() the pointer lock api, similar to the fullscreen api, extends dom elements by adding a new method, requestpointerlock().
...And 5 more matches
ReadableStream.ReadableStream() - Web APIs
syntax var readablestream = new readablestream(underlyingsource[, queuingstrategy]); parameters underlyingsource an object containing methods and properties that define how the constructed stream instance will behave.
... underlyingsource can contain the following: start(controller) this is a method, called immediately when the object is constructed.
... the contents of this method are defined by the developer, and should aim to get access to the stream source, and do anything else required to set up the stream fuctionality.
...And 5 more matches
Inputs and input sources - Web APIs
the information for each input source includes which hand it's held in (if applicable), what targeting method it uses, xrspaces that can be used to draw the targeting ray and to find the targeted object or location as well as to draw objects in the user's hands, and profile strings specifying the preferred way to represent the controller in the user's viewing area as well as how the input operates.
...this gaze input method is fairly simple, and doesn't need any special controls, as it will be based on the facing direction reported by the headset or whatever device is used to determine what direction the viewer's face is pointing in.
... you can easily obtain the target ray corresponding to the targetrayspace from within the drawing handler for a given frame using xrframe's getpose() method.
...And 5 more matches
Window - Web APIs
WebAPIWindow
that said, even in a tabbed browser, some properties and methods still apply to the overall window that contains the tab, such as resizeto() and innerheight.
... methods this interface inherits methods from the eventtarget interface and implements methods from windoworworkerglobalscope and eventtarget.
... window.stop() this method stops window loading.
...And 5 more matches
WorkerGlobalScope - Web APIs
it is a regular performance object, except that only a subset of its property and methods are available to workers.
... methods this interface inherits methods from the eventtarget interface and windoworworkerglobalscope and windoweventhandlers mixins.
... standard methods workerglobalscope.importscripts() imports one or more scripts into the worker's scope.
...And 5 more matches
XMLHttpRequest.sendAsBinary() - Web APIs
the obsolete xmlhttprequest method sendasbinary() is a variant of the send() method that sends binary data.
... the send() method now supports binary data and should now be used instead.
... this method makes it possible to read and upload any type of file and to stringify the raw data.
...And 5 more matches
<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.
...t"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form.
... formenctype a string that identifies the encoding method to use when submitting the form data to the server.
...And 5 more matches
Equality comparisons and sameness - JavaScript
toprimitive(a) attempts to convert its object argument to a primitive value, by attempting to invoke varying sequences of a.tostring and a.valueof methods on a.
... same-value equality is provided by the object.is method.
...even if your requirements involve having comparisons between two nan values evaluate to true, generally it is easier to special-case the nan checks (using the isnan method available from previous versions of ecmascript) than it is to work out how surrounding computations might affect the sign of any zeros you encounter in your comparison.
...And 5 more matches
Array.prototype.map() - JavaScript
the map() method creates a new array populated with the results of calling a provided function on every element in the calling array.
...let lenvalue be the result of calling the get internal // method of o with the argument "length".
...let kpresent be the result of calling the hasproperty internal // method of o with argument pk.
...And 5 more matches
Array - JavaScript
description arrays are list-like objects whose prototype has methods to perform traversal and mutation operations.
...element', 'this is the second element', 'this is the last element'] console.log(arr[0]) // logs 'this is the first element' console.log(arr[1]) // logs 'this is the second element' console.log(arr[arr.length - 1]) // logs 'this is the last element' array elements are object properties in the same way that tostring is a property (to be specific, however, tostring() is a method).
... several of the built-in array methods (e.g., join(), slice(), indexof(), etc.) take into account the value of an array's length property when they're called.
...And 5 more matches
Function.prototype.bind() - JavaScript
the bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.
...the arguments to the internal method are a this value and a list containing the arguments passed to the function by a call expression.
... when a bound function is called, it calls internal method [[call]] on [[boundtargetfunction]], with following arguments call(boundthis, ...args).
...And 5 more matches
Function.name - JavaScript
(function() {}).name; // "" (() => {}).name; // "" inferred function names variables and methods can infer the name of an anonymous function from its syntactic position (new in ecmascript 2015).
... let f = function() {}; let object = { somemethod: function() {} }; console.log(f.name); // "f" console.log(object.somemethod.name); // "somemethod" you can define a function with a name in a function expression: let object = { somemethod: function object_somemethod() {} }; console.log(object.somemethod.name); // logs "object_somemethod" try { object_somemethod } catch(e) { console.log(e); } // referenceerror: object_somemethod is not defined the name property is read-only and cannot be changed by the assigment operator: example below contradicts with what is said at the beginning of this section and doesn't work as described.
... let object = { // anonymous somemethod: function() {} }; object.somemethod.name = 'othermethod'; console.log(object.somemethod.name); // somemethod to change it, use object.defineproperty().
...And 5 more matches
Object.prototype.toString() - JavaScript
the tostring() method returns a string representing the object.
... description every object has a tostring() method that is automatically called when the object is to be represented as a text value or when an object is referred to in a manner in which a string is expected.
... by default, the tostring() method is inherited by every object descended from object.
...And 5 more matches
Web Components
register your new custom element using the customelementregistry.define() method, passing it the element name to be defined, the class or function in which its functionality is specified, and optionally, what element it inherits from.
... if required, attach a shadow dom to the custom element using element.attachshadow() method.
... add child elements, event listeners, etc., to the shadow dom using regular dom methods.
...And 5 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
creating an xsltprocessor to start, you need to create an xsltprocessor object: var processor = new xsltprocessor(); specifying the stylesheet before you can use it, you must import a stylesheet with the xsltprocessor.importstylesheet() method.
... transforming the document you can use the xsltprocessor.transformtodocument() or xsltprocessor.transformtofragment() methods to transform a document using the imported xslt stylesheet.
... transformtodocument xsltprocessor.transformtodocument() takes one argument, the source node to transform, and returns a new document with the results of the transformation: var newdocument = processor.transformtodocument(domtobetransformed); the resultant object depends on the output method of the stylesheet: html - htmldocument xml - xmldocument text - xmldocument with a single root element <transformiix:result> with the text as a child transformtofragment you can also use xsltprocessor.transformtofragment() which will return a documentfragment node.
...And 5 more matches
Classes and Inheritance - Archive of obsolete content
we will show how to make inheritance work correctly with respect to constructors, prototypes, and the instanceof operator, and how to override methods in subclasses.
...the method draw is defined on instances of shape, so we definitely want it to be defined on instances of circle.
... circle.prototype = object.create(shape.prototype); now when javascript looks for the method draw on an instance of circle, it first looks for it on the object itself.
...And 4 more matches
page-mod - Archive of obsolete content
if you supply the scripts as separate files in the "data" directory, you specify them using with a url, typically constructed using the url() method of the self module's data object: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: data.url("my-script.js") }); var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: [data.url("jquery-1.7.min.js"), ...
... to stop a page-mod from making any more modifications, call its destroy() method.
... using the attach method of the tab object, you can attach a set of content scripts to a particular tab.
...And 4 more matches
panel - Archive of obsolete content
if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method.
...to do this, save the html in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var mypanel = require("sdk/panel").panel({ contenturl: require("sdk/self").data.url("myfile.html") }); mypanel.show(); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
...you can position the panel by passing a position to the panel's constructor or to its show() method.
...And 4 more matches
ui/button/action - Archive of obsolete content
you can generate click events programmatically with the button's click() method.
... you can set state to be specific to a window or tab using the button's state() method.
... destroying buttons when you've finished with a button, destroy it by calling its destroy() method.
...And 4 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
xul display methods xul is used almost exclusively in mozilla applications like firefox and thunderbird, and extensions for them, but other web browsers based on firefox or the gecko engine, and even web-based content also used xul.
... for example, there is the mozilla amazon browser, which helps with shopping at amazon, and the presentation method in xul, a tool for writing and displaying presentations to try out the code samples in this chapter, save them as text files with .xul extensions and drag and drop them into the firefox browser window.
... fixme: explain how setting this option and use next listings if we want to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_url.xul another way, as shown in listing 1, is to use the window.opendialog() method, which can be used only within a xul window.
...And 4 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
there won't be any problems if various add-ons override the same function (using this method).
... note: it is not safe to remove such an override again, as this method constitutes in a single-linked function chain.
...again, this is a problem with the "string-patch" method, too.
...And 4 more matches
Creating a Microsummary - Archive of obsolete content
specifying the output type since the xslt transform sheet will generate a text microsummary, we should indicate this with the xslt <output> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> </transform> </template> </generator> using a simple xslt <template> the xslt processor transforms documents by comparing each xslt <template> element in the transform sheet to a set of nodes in the document.
...icrosummary for the spread firefox page, we only need to use a single <template> element that matches the root node of the document and is processed once: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> <template match="/"> </template> </transform> </template> </generator> including the download count to include the download count in the output of the xslt transform sheet, we need to add an xslt <value-of> element to the template whose select attribute contains an xpath expression that points to the node containing the count.
... add a <value-of> element to the xslt <template> element whose select attribute contains that xpath expression: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> <template match="/"> <value-of select="id('download-count')"/> </template> </transform> </template> </generator> adding text to include the label fx downloads in the microsummary, we need to add an xslt <text> element to the xslt <template> element whose content is the text we want to add.
...And 4 more matches
addDirectory - Archive of obsolete content
method of install object syntax public int adddirectory ( string xpisourcepath); public int adddirectory ( string registryname, string xpisourcepath, object localdirspec, string relativelocalpath); public int adddirectory ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath); public int adddirectory ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); public int adddirectory ( string registryname, installversion version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); parameters t...
...he adddirectory method has the following parameters: registryname the pathname in the client version registry for the root directory of the files that are to be installed.this parameter can be an absolute pathname (beginning with a /) or a relative pathname, (not beginning with a slash).
...a relative pathname is appended to the registry name of the package as specified by the package parameter to the initinstall method.this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
...And 4 more matches
addFile - Archive of obsolete content
method of install object syntax public int addfile ( string registryname, installversion version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); public int addfile ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath, boolean forceupdate); public int addfile ( string xpisourcepath); public int addfile ( string registryname, string xpisourcepath, object localdirspec, string relativelocalpath); public int addfile ( string registryname, string version, string...
... xpisourcepath, object localdirspec, string relativelocalpath); parameters the addfile method has the following parameters: registryname the pathname in the client version registry about the file.
...typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.typically, relative pathnames are relative to the main pathname specified in the initinstall method.
...And 4 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
note also that when you call methods on the install--as you do so often in installation scripts (getfolder, initinstall, addfile, and performinstall are all examples of common install object methods)--the install object is implicit; like the window object in regular web page scripts, the install object does not need to be prefixed to the method.
...the initinstall() method on the install object creates a new installation for the specified software and version.
... in the browser.xpi installation, this function appears at line 20: var err = initinstall("netscape seamonkey", "browser", "6.0.0.2000110807"); if you call a method on the install object before initinstall(), you will get an error.
...And 4 more matches
PopupEvents - Archive of obsolete content
this will occur regardless of how the popup is opened, either from user interaction or from a script calling the openpopup or openpopupatscreen methods.
...<panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).tolocaleformat('%t')"> <label value="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener.
...the preventdefault method will stop this from happening and the popup will not be opened.
...And 4 more matches
Tree Widget Changes - Archive of obsolete content
the tree and view methods no longer take ids as arguments when columns are used.
... the nsitreeboxobject.getpagecount() method has been renamed to make it clearer what it does.
... the invalidateprimarycell(row) method has been removed, instead use nsitreeboxobject.invalidatecell() like this invalidatecell(row, tree.columns.getprimarycolumn()).
...And 4 more matches
XBL Example - Archive of obsolete content
to set the page, a method 'setpage' is called which will be defined later.
... setpage method now let's define the 'setpage' method.
... <method name="setpage"> <parameter name="newidx"/> <body> <![cdata[ var thedeck=document.getanonymousnodes(this)[0].childnodes[0]; var totalpages=this.childnodes.length; if (newidx<0) return 0; if (newidx>=totalpages) return totalpages; thedeck.setattribute("selectedindex",newidx); document.getanonymousnodes(this)[0].childnodes[1].childnodes[1] .setattribute("value",(newidx+1)+" of "+totalpages); return newidx; ]]> </body> </method> this function is called setpage and takes one parameter newidx.
...And 4 more matches
wizard - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to construct a step-by-step wizard found in some applications to guide users through a task.
... attributes firstpage, lastpage, pagestep, title, windowtype properties canadvance, canrewind, currentpage, onfirstpage, onlastpage, pagecount, pageindex, pagestep, title, wizardpages methods advance, cancel, extra1, extra2, getbutton, getpagebyid, goto, rewind examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function checkcode(){ document.getelementbyid('thewizard').canadvance = (document.getel...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagna...
...And 4 more matches
calICalendarView - Archive of obsolete content
because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implementations are particularly well suited to xbl.
...this explains the need for the fairly large list off attributes and methods that must be implemented, so that outside code can be able to gain a decent picture of the current state of those nodes.
... it should be noted, however, that the methods and attributes implemented by a calicalendarview need not behave in any predictable fashion.
...And 4 more matches
nsIContentPolicy - Archive of obsolete content
method overview short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in n...
... type_xbl 9 indicates an xbl binding request, triggered either by -moz-binding css property or the document.addbinding() method.
... type_fetch 20 indicates a load initiated by the globalfetch.fetch() method, which is available as a global in both window and worker contexts.
...And 4 more matches
Processing XML with E4X - Archive of obsolete content
} working with xml objects xml objects provide a number of methods for inspecting and updating their contents.
...operator accesses all children no matter how deeply nested: alert(person..*.length()); // 11 the length() method here returns 11 because both elements and text nodes are included in the resulting xmllist.
... objects representing xml elements provide a number of useful methods, some of which are illustrated below: todo: add all of the methods to the javascript reference, link from here alert(person.name.text()) // bob smith var xml = person.name.toxmlstring(); // a string containing xml var personcopy = person.copy(); // a deep copy of the xml object var child = person.child(1); // the second child node; in this case the <likes> element working with xmllists in addition to the xml object, e4x introduces an xmllist object.
...And 4 more matches
JavaObject - Archive of obsolete content
created by any java method which returns an object type.
... methods inherits public methods from the java class of which it is an instance.
... the javaobject also inherits methods from java.lang.object and any other superclass.
...And 4 more matches
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state.
... in other words, an idempotent method should not have any side-effects (except for keeping statistics).
... implemented correctly, the get, head, put, and delete method are idempotent, but not the post method.
...And 4 more matches
Supporting older browsers - Learn web development
previous overview: css layout next in this module, we recommend using flexbox and grid as the main layout methods for your designs.
... however, there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used.
... creating fallbacks in css css specifications contain information that explains what the browser does when two layout methods are applied to the same item.
...And 4 more matches
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 const...
... the constraint validation api also makes the following methods available on the above elements.
...if the element is invalid, this method also fires an invalid event on the element.
...And 4 more matches
Your first form - Learn web development
the <form> element all forms start with a <form> element, like this: <form action="/my-handling-form-page" method="post"> </form> this element formally defines a form.
...all of its attributes are optional, but it's standard practice to always set at least the action and method attributes: the action attribute defines the location (url) where the form's collected data should be sent when it is submitted.
... the method attribute defines which http method to send the data with (usually get or post).
...And 4 more matches
Drawing graphics - Learn web development
this is done using the htmlcanvaselement.getcontext() method, which for basic usage takes a single string as a parameter representing the type of context you want to retrieve.
...add the following lines at the bottom of your javascript: ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); here we are setting a fill color using the canvas' fillstyle property (this takes color values just like css properties do), then drawing a rectangle that covers the entire area of the canvas with thefillrect method (the first two parameters are the coordinates of the rectangle's top left hand corner; the last two are the width and height you want the rectangle drawn at — we told you those width and height variables would be useful)!
... we'll be using some common methods and properties across all of the below sections: beginpath() — start drawing a path at the point where the pen currently is on the canvas.
...And 4 more matches
Introduction to web APIs - Learn web development
when calling a method from a library, the developer is in control.
... they are based on objects your code interacts with apis using one or more javascript objects, which serve as containers for the data the api uses (contained in object properties), and the functionality the api makes available (contained in object methods).
...the most obvious ones are: audiocontext, which represents an audio graph that can be used to manipulate audio playing inside the browser, and has a number of methods and properties available to manipulate that audio.
...And 4 more matches
Third-party APIs - Learn web development
for example: let map = l.mapquest.map('map', { center: [53.480759, -2.242631], layers: l.mapquest.tilelayer('map'), zoom: 12 }); here we are creating a variable to store the map information in, then creating a new map using the mapquest.map() method, which takes as its parameters the id of a <div> element you want to display the map in ('map'), and an options object containing the details of the particular map we want to display.
... in this case we specify the coordinates of the center of the map, a map layer of type map to show (created using the mapquest.tilelayer() method), and the default zoom level.
...you can expand the controls available using the map.addcontrol() method; add this to your code, inside the window.onload handler: map.addcontrol(l.mapquest.control()); the mapquest.control() method just creates a simple full-featured control set, and it is placed in the top-right hand corner by default.
...And 4 more matches
A first splash into JavaScript - Learn web development
this is a method that takes two input values (called arguments) — the type of event we are listening out for (in this case click) as a string, and the code we want to run when the event occurs (in this case the checkguess() function).
...now let's look at the loop in our number guessing game — the following can be found inside the resetgame() function: const resetparas = document.queryselectorall('.resultparas p'); for (let i = 0 ; i < resetparas.length ; i++) { resetparas[i].textcontent = ''; } this code creates a variable containing a list of all the paragraphs inside <div class="resultparas"> using the queryselectorall() method, then it loops through each one, removing the text content of each.
...add the following line just below the let resetbutton; line near the top of your javascript, then save your file: guessfield.focus(); this line uses the focus() method to automatically put the text cursor into the <input> text field as soon as the page loads, meaning that the user can start typing their first guess right away, without having to click the form field first.
...And 4 more matches
Eclipse CDT
to quickly find the definition of an enum, class, method, etc.
... to see the callers of a method (and their callers, etc.), select the method and use the context menu to select "open call hierarchy".
... to see the overrides of a virtual method, select that method's name in an editor window and select "open type hierarchy" or, "quick type hierarchy" from the context menu.
...And 4 more matches
Interfacing with the Add-on Repository
starting a request to start a search of the repository, you can use either of the following methods: searchaddons() queries the add-on repository for add-ons matching given search criteria.
...the callback object needs to implement the searchcallback interface, providing the methods that get called when a search either fails or completes successfully.
... handling failed requests the callback object must have a searchfailed() method; this gets called when a repository search fails to execute.
...And 4 more matches
JS_ShutDown
this method should be called after all other jsapi data has been properly cleaned up: every jsruntime created with js_newruntime must have been destroyed with js_destroyruntime, every jscontext created with js_newcontext must have been destroyed with js_destroycontext, and so on.
... calling this method before all other resources have been destroyed has undefined behavior.
... failure to call this method, at present, has no adverse effects other than leaking memory.
...And 4 more matches
Places Developer Guide
bookmarks the toolkit bookmarks service is nsinavbookmarksservice: var bookmarks = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); this service provides methods for adding, editing and deleting items in the bookmarks collection.
...// create a bookmark observer var observer = { onbeginupdatebatch: function() { // this method is notified when a batch of changes are about to occur.
... note: the method importhtmlfromfiletofolder() method was removed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11).
...And 4 more matches
Interfacing with the XPCOM cycle collector
the traverse and unlink methods on the helper object are not magic; they are programmer-supplied and must be correct, or else the collector will fail.
...or your class may have a complicated ownership structure, such that the simple ns_impl_cycle_collection_n macros are insufficient; in this case you might need to implement the traverse and unlink methods of your helper class manually.
... manually implementing the traverse and unlink methods each field that may contain cycle collected objects needs to be passed to the cycle collector, so it can detect cycles that pass through those fields.
...And 4 more matches
IAccessibleHyperlink
iaccessibleaction.nactions() is one greater than the maximum value for the indices used with the methods of this interface.
...none of the iaccessibleaction methods would be implemented on the first level hyperlink objects.
... the second level hyperlink objects would implement the iaccessibleaction methods.
...And 4 more matches
nsIAppShellService
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/appshell/appshellservice;1 as a service: var appshellservice = components.classes["@mozilla.org/appshell/appshellservice;1"] .getservice(components.interfaces.nsiappshellservice); method overview void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only!
...obsolete since gecko 1.8 methods closetoplevelwindow() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) close a window.
... createtoplevelwindow() this method creates a window, which will be initially invisible.
...And 4 more matches
nsIBrowserSearchService
to access this service, use: var browsersearchservice = components.classes["@mozilla.org/browser/search-service;1"] .getservice(components.interfaces.nsibrowsersearchservice); attempting to use any method or attribute of this interface before init() has completed will force the service to fall back to a slower, synchronous, initialization.
... method overview void addengine(in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback); void addenginewithdetails(in astring name, in astring iconurl, in astring alias, in astring description, in astring method, in astring url); void getdefaultengines([optional] out unsigned long enginecount, [retval, array, size_is(engin...
... methods addengine() adds a new search engine from the file at the supplied uri, optionally asking the user for confirmation first.
...And 4 more matches
nsIComponentManager
xpcom/components/nsicomponentmanager.idlscriptable this interface provides methods to access factory objects and instantiate instances of classes.
... 66 introduced gecko 0.7 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void addbootstrappedmanifestlocation(in nsilocalfile alocation); void createinstance(in nscidref aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void createinstancebycontractid(in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobject(in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobjectbycontractid(in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void removebootstrappe...
...dmanifestlocation(in nsilocalfile alocation); methods addbootstrappedmanifestlocation() loads a "bootstrapped" chrome.manifest file from the specified directory or xpi file.
...And 4 more matches
nsIContentPrefService2
domain parameters many methods of this interface accept a "domain" parameter.
...private-browsing context parameters many methods also accept a "context" parameter.
... this parameter relates to private browsing and determines the kind of storage that a method uses, either the usual permanent storage or temporary storage set() aside for private browsing sessions.
...And 4 more matches
nsIContentViewer
to create an instance, use: var contentviewer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsicontentviewer); method overview void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notxpcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only!
... sticky boolean methods clearhistoryentry() clears the current history entry.
... note: if this container is the root of a view manager hierarchy (that is, this method returns null), and mparentwidget is also null, then this document should not even be displayed.
...And 4 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); obsolet...
...obsolete since gecko 6.0 methods captureevents() provided for compatibility with netscape 4.x, but does not actually do anything.
...And 4 more matches
nsIEventTarget
events may be sent to this target from any thread by calling the dispatch method.
... 1.0 66 introduced gecko 1.6 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void dispatch(in nsirunnable event, in unsigned long flags); boolean isoncurrentthread(); void postevent(in pleventptr aevent); native code only!
... dispatch_sync 1 this flag specifies the synchronous mode of event dispatch, in which the dispatch() method does not return until the event has been processed.
...And 4 more matches
nsIFocusManager
1.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!
... methods clearfocus() clears the focused element within awindow.
...And 4 more matches
nsIMicrosummaryService
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides methods for managing installed microsummaries, and the bookmarks they apply to.
...s 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) implemented by: @mozilla.org/microsummary/service;1 as a service: var microsummaryservice = components.classes["@mozilla.org/microsummary/service;1"] .getservice(components.interfaces.nsimicrosummaryservice); method overview void addgenerator(in nsiuri generatoruri); nsimicrosummary createmicrosummary(in nsiuri pageuri, in nsiuri generatoruri); nsisimpleenumerator getbookmarks(); nsimicrosummarygenerator getgenerator(in nsiuri generatoruri); nsimicrosummaryset getmicrosummaries(in nsiuri pageuri, in long long bookmarkid); nsimicrosummary getmicrosummary...
... 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 from the resource at the supplied uri.
...And 4 more matches
nsINavHistoryResultViewer
note: most methods in this interface were renamed in gecko 1.9.2, and others have slightly different parameter lists.
... method overview void containerclosed(in nsinavhistorycontainerresultnode acontainernode); void containeropened(in nsinavhistorycontainerresultnode acontainernode); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodelastaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodekeywordchanged(in nsinavhistoryr...
... methods containerclosed() called when a container node's state changes from closed to opened.
...And 4 more matches
nsIPlacesImportExportService
toolkit/components/places/nsiplacesimportexportservice.idlscriptable provides methods for exporting places data.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) in the past, this interface also offered methods for importing places data, but those methods are now part of the bookmarkhtmlutils.jsm javascript code module.
... implemented by: @mozilla.org/import-export-service;1 as a service: var placesimportexportservice = components.classes["@mozilla.org/import-export-service;1"] .getservice(components.interfaces.nsiplacesimportexportservice); method overview void backupbookmarksfile(); void exporthtmltofile(in nsilocalfile afile); void importhtmlfromfile(in nsilocalfile afile, in boolean aisinitialimport); obsolete since gecko 14.0 void importhtmlfromfiletofolder(in nsilocalfile afile, in print64 afolder, in boolean aisinitialimport); obsolete since gecko 14.0 void importhtmlfromuri(in nsiuri auri, in boolean aisinitialimport); obsolete sin...
...And 4 more matches
nsIProcess
to create an instance, use: var process = components.classes["@mozilla.org/process/util;1"] .createinstance(components.interfaces.nsiprocess); method overview void init(in nsifile executable); void initwithpid(in unsigned long pid); obsolete since gecko 1.9.2 void kill(); void run(in boolean blocking, [array, size_is(count)] in string args, in unsigned long count); void runasync([array, size_is(count)] in string args, in unsigned long count, [optional] in nsiobserver observer, [optional] in boolean...
... methods init() initializes the nsiprocess with the specified executable file.
... gecko 1.9.1 note this method is no longer implemented as of gecko 1.9.1, and is removed entirely in gecko 1.9.2.
...And 4 more matches
nsIScriptableInputStream
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long available(); void close(); void init(in nsiinputstream ainputstream); string read(in unsigned long acount); acstring readbytes(in unsigned long acount); methods available() return the number of bytes currently available in the stream.
... note: this method should not be used to determine the total size of a stream, even if the stream corresponds to a local file.
... moreover, since a stream may make available more than 2^32 bytes of data, this method is incapable of expressing the entire size of the underlying data source.
...And 4 more matches
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable provides methods that let an xpcom component define custom rules for accessing it from potentially unprivileged code.
... this includes creating instances of arbitrary xpcom objects and calling methods and setting properties on them.
...method overview string cancallmethod(in nsiidptr iid, in wstring methodname); string cancreatewrapper(in nsiidptr iid); string cangetproperty(in nsiidptr iid, in wstring propertyname); string cansetproperty(in nsiidptr iid, in wstring propertyname); methods cancallmethod() returns a capability string indicating what permissions are required to call the specified method on the given interface...
...And 4 more matches
nsISelectionController
inherits from: nsiselectiondisplay last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void characterextendforbackspace(); native code only!
...if not set, posts a request which is processed at some point after the method returns.
... methods native code only!characterextendforbackspace will extend the selection one character cell backward in the document.
...And 4 more matches
nsITimer
nsitimer instances must be initialized by calling one of the initialization methods.
... you may also re-initialize (using one of the initialization methods) an existing instance to avoid the overhead of destroying and creating a timer.
... method overview void cancel(); void init(in nsiobserver aobserver, in unsigned long adelay, in unsigned long atype); void initwithcallback(in nsitimercallback acallback, in unsigned long adelay, in unsigned long atype); void initwithfunccallback(in nstimercallbackfunc acallback, in voidptr aclosure, in unsigned long adelay, in unsigned long atype); native code only!
...And 4 more matches
nsIXULTemplateResult
the value for a particular variable may be retrieved using the getbindingfor() and getbindingobjectfor() methods.
... 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.
... methods getbindingfor() get the string representation of the value of a variable for this result.
...And 4 more matches
Setting HTTP request headers
the nsihttpchannel interface has a number of properties and methods, but the method that is of interest to us is setrequestheader.
... this method allows us to set an http request header.
...(this variable could have been named anything though.) the setrequestheader method takes 3 parameters.
...And 4 more matches
Weak reference
to do that, it will call a method on the observer, so it needs a pointer.
... { // ...but to use my weak reference, i'll need a (short-lived) owning reference nscomptr<nsifoo> tempfooptr = do_queryreferent(weakptr); if ( tempfooptr ) tempfooptr->somefoomethod(...); // else, the `real' object has gone away } in a real world example, however, you are more likely to be holding a weak reference in a member variable.
... why can't i just directly call my interfaces methods on the weak reference?
...And 4 more matches
Using Objective-C from js-ctypes
objc_msgsend function, receives the instance which receives the message, the selector, and variable argument list for the message, returning the returned value from the method.
... id nsspeechsynthesizer = (id)objc_getclass("nsspeechsynthesizer"); id tmp = objc_msgsend(nsspeechsynthesizer, alloc); selector for a method with arguments in this case, [nsspeechsynthesizer initwithvoice:] takes one argument; the selector name with a trailing colon.
... sel initwithvoice = sel_registername("initwithvoice:"); if a method takes two or more arguments, the selector name becomes a concatenation of each name.
...And 4 more matches
Declaring types
the ctypes object offers a number of constructor methods that let you declare types.
... every type is represented by a ctype object, which, in turn, provides a constructor method you can call to define values of those types.
...this method accepts as input the name of the structure and an array of field descriptors, each describing one field in the structure.
...And 4 more matches
Network request list - Firefox Developer Tools
method: the http request method used.
... status-code:304 method shows resources that have were requested via the specific http request method.
... method:post domain shows resources coming from a specifc domain.
...And 4 more matches
Web Console remoting - Firefox Developer Tools
this object provides methods that abstract away protocol packets, things like startlisteners(), stoplisteners(), etc.
...when navigation stops the following packet is sent: { "from": tabactor, "type": "tabnavigated", "state": "stop", "url": newurl, "title": newtitle, "nativeconsoleapi": true|false } getcachedmessages(types, onresponse) the webconsoleclient.getcachedmessages(types, onresponse) method sends the following packet to the server: { "to": "conn0.console9", "type": "getcachedmessages", "messagetypes": [ "pageerror", "consoleapi" ] } the getcachedmessages packet allows one to retrieve the cached messages from before the web console was open.
... send http requests starting with firefox 25 you can send an http request using the console actor: { "to": "conn0.console9", "type": "sendhttprequest", "request": { "url": "http://localhost", "method": "get", "headers": [ { name: "header-name", value: "header value", }, // ...
...And 4 more matches
Attr - Web APIs
WebAPIAttr
in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types.
...oke="#d4dde4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">attr</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), a number of deprecated properties and methods output warning messages to the console.
...see deprecated properties and methods for a complete list.
...And 4 more matches
AudioListener - Web APIs
methods audiolistener.setorientation() sets the orientation of the listener.
... note: although these methods are deprecated they are currently the only way to set the orientation and position in firefox, internet explorer and safari.
... in a previous version of the specification, the dopplerfactor and speedofsound properties and the setposition() method could be used to control the doppler effect applied to audiobuffersourcenodes connected downstream — these would be pitched up and down according to the relative speed of the pannernode and the audiolistener.
...And 4 more matches
AudioWorkletProcessor - Web APIs
methods the audioworkletprocessor interface does not define any methods of its own.
... however, you must provide a process() method, which is called in order to process the audio stream.
...although not defined on the interface, the deriving class must have the process method.
...And 4 more matches
Beacon API - Web APIs
beacon requests use the http post method and requests typically do not require a response.
... global context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server in the global browsing context.
... the method takes two arguments, the url and the data to send in the request.
...And 4 more matches
CSSStyleSheet.insertRule() - Web APIs
the cssstylesheet.insertrule() method inserts a new css rule into the current style sheet, with some restrictions.
... note: although insertrule() is exclusively a method of cssstylesheet, it actually inserts the rule into cssstylesheet.cssrules — its internal cssrulelist.
... if index > cssrulelist.length, the method aborts with an indexsizeerror.
...And 4 more matches
CanvasRenderingContext2D.rect() - Web APIs
the canvasrenderingcontext2d.rect() method of the canvas 2d api adds a rectangle to the current path.
... like other methods that modify the current path, this method does not directly render anything.
... to draw the rectangle onto a canvas, you can use the fill() or stroke() methods.
...And 4 more matches
FileSystemDirectoryEntry - Web APIs
it provides methods which make it possible to access and manipulate the files in a directory, as well as to access the entries within the directory.
... methods this interface inherits methods from its parent interface, filesystementry.
... getdirectory() returns a filesystemdirectoryentry object representing a directory located at a given path, relative to the directory on which the method is called.
...And 4 more matches
Using FormData Objects - Web APIs
the transmitted data is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to multipart/form-data.
... creating a formdata object from scratch you can build a formdata object yourself, instantiating it then appending fields to it by calling its append() method, like this: var formdata = new formdata(); formdata.append("username", "groucho"); formdata.append("accountnum", 123456); // number 123456 is immediately converted to a string "123456" // html file input, chosen by user formdata.append("userfile", fileinputelement.files[0]); // javascript file-like object var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file...
...the number assigned to the field "accountnum" is immediately converted into a string by the formdata.append() method (the field's value can be a blob, file, or a string: if the value is neither a blob nor a file, the value is converted to a string).
...And 4 more matches
HTMLAudioElement - Web APIs
the htmlaudioelement interface provides access to the properties of <audio> elements, as well as methods to manipulate them.
... it's based on, and inherits properties and methods from, the htmlmediaelement interface.
... methods inherits methods from its parent, htmlmediaelement, and from htmlelement.
...And 4 more matches
HTMLFormElement - Web APIs
htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit the form.
... methods this interface also inherits methods from its parent, htmlelement.
... deprecated methods htmlformelement.requestautocomplete() triggers a native browser interface to assist the user in completing the fields which have an autofill field name value that is not off or on.
...And 4 more matches
LocalFileSystemSync - Web APIs
the methods are implemented by worker objects.
...the global methods in the window object requestfilesystemsync() and resolvelocalfilesystemsyncurl() methods are exposed to the worker's global scope.
... 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.
...And 4 more matches
Navigator.sendBeacon() - Web APIs
the navigator.sendbeacon() method asynchronously sends a small amount of data over http to a web server.
... return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer.
... description this method is for analytics and diagnostics that send data to a server before the document is unloaded, where sending the data any sooner may miss some possible data collection.
...And 4 more matches
NodeFilter.acceptNode() - Web APIs
the nodefilter.acceptnode() method returns an unsigned short that will be used to tell if a given node must be accepted or not by the nodeiterator or treewalker iteration algorithm.
... this method is expected to be written by the user of a nodefilter.
... possible return values are: constant description nodefilter.filter_accept value returned by the nodefilter.acceptnode() method when a node should be accepted.
...And 4 more matches
PaymentResponse.retry() - Web APIs
the paymentresponse interface's retry() method makes it possible to ask the user to retry a payment after an error occurs during processing.
... paymentmethod optional any payment method specific errors which may have occurred.
...for example, if the user chose to pay by credit card using the basic-card payment method, this is a basiccarderrors object.
...And 4 more matches
PaymentResponse - Web APIs
the paymentresponse interface of the payment request api is returned after a user selects a payment method and approves a payment request.
... properties paymentresponse.details read only secure context returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer.
... the contents of the object depend on the payment method being used; for example, if the basic card payment method is used, this object must conform to the structure defined in the basiccardresponse dictionary.
...And 4 more matches
Performance - Web APIs
methods the performance interface doesn't inherit any methods.
... recommendation defines tojson() method.
... recommendation defines now() method.
...And 4 more matches
Using the Performance API - Web APIs
additionally, there must be a way to create a timestamp for a specific point in time; this is done with the now() method.
...the base interface for these standards is the performance interface and its methods and properties are extended by different standards.
...other web performance guides (listed in the see also section) describe how to use additional methods and properties of the performance interface.
...And 4 more matches
Performance Timeline - Web APIs
performance extensions the performance timeline api extends the performance interface with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria.
... the methods are: getentries() returns all recorded performance entries or, optionally, the entries based on the specified name, performance type and/or the initiatortype (such as an html element).
...(some performance entry types have no concept of duration and this value is set to '0' for such types.) this interface includes a tojson() method that returns the serialization of the performanceentry object.
...And 4 more matches
SVGGradientElement - Web APIs
h="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggradientelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_spreadmethod_unknown 0 the type is not one of predefined types.
... svg_spreadmethod_pad 1 corresponds to value pad.
... svg_spreadmethod_reflect 2 corresponds to value reflect.
...And 4 more matches
SVGSVGElement - Web APIs
the svgsvgelement interface provides access to the properties of <svg> elements, as well as methods to manipulate them.
... this interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices.
... methods this interface also inherits methods from its parent, svggraphicselement and also implements the ones from svgzoomandpan, svgfittoviewbox, and windoweventhandlers.
...And 4 more matches
Using the Screen Capture API - Web APIs
in this article, we will examine how to use the screen capture api and its getdisplaymedia() method to capture part or all of a screen for streaming, recording, or sharing during a webrtc conference session.
...isplaymediaoptions = { video: { cursor: "always" }, audio: false }; // set event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log.
... starting display capture the startcapture() method, below, starts the capture of a mediastream whose contents are taken from a user-selected area of the screen.
...And 4 more matches
WebGL model view projection - Web APIs
(this.webglprogram); // save the attribute and uniform locations this.positionlocation = gl.getattriblocation(this.webglprogram, 'position'); this.colorlocation = gl.getuniformlocation(this.webglprogram, 'color'); // tell webgl to test the depth when drawing, so if a square is behind // another square it won't be drawn gl.enable(gl.depth_test); } webglbox draw now we'll create a method to draw a box on the screen.
... homogeneous coordinates the main line of the previous clip space vertex shader contained this code: gl_position = vec4(position, 1.0); the position variable was defined in the draw() method and passed in as an attribute to the shader.
... the following code sample defines a method on the cubedemo object that will create the model matrix.
...And 4 more matches
Using the Web Animations API - Web APIs
bring the pieces together now it’s time to bring them both together with the element.animate() method: document.getelementbyid("alice").animate( alicetumbling, alicetiming ) and boom: the animation starts playing (see the finished version on codepen).
... the animate() method can be called on any dom element that could be animated with css.
...the web animations api provides several useful methods for controlling playback.
...And 4 more matches
Background audio processing using AudioWorklet - Web APIs
an audio context's audio worklet is a worklet which runs off the main thread, executing audio processing code added to it by calling the context's audioworklet.addmodule() method.
... 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.
... the audio processor class must implement a process() method, which receives incoming audio data and writes back out the data as manipulated by the processor.
...And 4 more matches
Using the Web Audio API - Web APIs
let's begin with a simple method — as we have a boombox, we most likely want to play a full song track.
...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 functionali...
...you can use the factory method on the context itself (e.g.
...And 4 more matches
XMLHttpRequest - Web APIs
it must be called before any other method calls.
... methods xmlhttprequest.abort() aborts the request if it has already been sent.
...if the request is asynchronous (which is the default), this method returns as soon as the request is sent.
...And 4 more matches
Creating a cross-browser video player - Developer guides
in addition a download link is displayed to allow users to download the mp4 video file, should they wish to (providing those without flash installed with a method of viewing the video, a fallback for a fallback if you like).
...this is done by simply checking if a created <video> element supports the canplaytype() method, which any supported html5 <video> element should.
...most of these buttons require a simple click event listener to be added, and a media api defined method and/or attributes to be called/checked on the video.
...And 4 more matches
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
enctype if the value of the method attribute is post, enctype is the mime type of the form submission.
... method the http method to submit the form with.
... possible (case insensitive) values: post: the post method; form data sent as the request body.
...And 4 more matches
HTTP headers - HTTP
WebHTTPHeaders
authentication www-authenticate defines the authentication method that should be used to access a resource.
... proxy-authenticate defines the authentication method that should be used to access a resource behind a proxy server.
... if-match makes the request conditional, and applies the method only if the stored resource matches one of the given etags.
...And 4 more matches
OPTIONS - HTTP
WebHTTPMethodsOPTIONS
the http options method requests permitted communication options for a given url or server.
... a client can specify a url with this method, or an asterisk (*) to refer to the entire server.
... request has body no successful response has body yes safe yes idempotent yes cacheable no allowed in html forms no syntax options /index.html http/1.1 options * http/1.1 examples identifying allowed request methods to find out which request methods a server supports, one can use the curl command-line program to issue an options request: curl -x options https://example.org -i the response then contains an allow header that holds the allowed methods: http/1.1 204 no content allow: options, get, head, post cache-control: max-age=604800 date: thu, 13 oct 2016 11:45:00 gmt server: eos (lax004/2813) preflighted requests in cors in cors, a preflight request is sent with the options method so that the server can ...
...And 4 more matches
A typical HTTP session - HTTP
WebHTTPSession
a client request consists of text directives, separated by crlf (carriage return, followed by line feed), divided into three blocks: the first line contains a request method followed by its parameters: the path of the document, i.e.
... the final block is an optional data block, which may contain further data mainly used by the post method.
... for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla.org content-length: 64 content-type: application/x-www-form-urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource.
...And 4 more matches
Deprecated and obsolete features - JavaScript
regexp methods the compile() method is deprecated.
... the valueof method is no longer specialized for regexp.
... object methods watch and unwatch are deprecated.
...And 4 more matches
BigInt - JavaScript
007199254740991) // ↪ 9007199254740991n const hugestring = bigint("9007199254740991") // ↪ 9007199254740991n const hugehex = bigint("0x1fffffffffffff") // ↪ 9007199254740991n const hugebin = bigint("0b11111111111111111111111111111111111111111111111111111") // ↪ 9007199254740991n bigint is similar to number in some ways, but also differs in a few key matters — it cannot be used with methods in the built-in math object and cannot be mixed with instances of number in operations; they must be coerced to the same type.
... static methods bigint.asintn() wraps a bigint value to a signed integer between -2width-1 and 2width-1 - 1.
... instance methods bigint.prototype.tolocalestring() returns a string with a language-sensitive representation of this number.
...And 4 more matches
Date.prototype[@@toPrimitive] - JavaScript
the [@@toprimitive]() method converts a date object to a primitive value.
...depending on the argument, the method can return either a string or a number.
... description the [@@toprimitive]() method of the date object returns a primitive value, that is either of type number or of type string.
...And 4 more matches
Promise.prototype.then() - JavaScript
the then() method returns a promise.
... following, an example to demonstrate the asynchronicity of the then method.
...the value received and returned is: 33" // promise {[[promisestatus]]: "resolved", [[promisevalue]]: 33} description as the then and promise.prototype.catch() methods return promises, they can be chained — an operation called composition.
...And 4 more matches
Content Processes - Archive of obsolete content
each event emitter has several methods: the method on is used to add a listener for an event.
... conversely, the method removelistener is used to remove a listener for an event.
... the method once is a helper function which adds a listener for an event, and automatically removes it the first time it is called.
...And 3 more matches
lang/functional - Archive of obsolete content
functional helper methods.
... usage the lang/functional module provides functional helper methods.
... globals functions method(lambda) takes a function and returns a method associated with an object.
...And 3 more matches
system/unload - Archive of obsolete content
globals functions ensure(object, name) calling ensure() on an object does two things: it replaces a destructor method with a wrapper method that will never call the destructor more than once.
... it ensures that this wrapper method is called when the object's module is unloaded.
... therefore, when you register an object with ensure(), you can call its destructor method yourself, you can let it happen for you, or you can do both.
...And 3 more matches
Canvas code snippets - Archive of obsolete content
function getpixelcolour(canvas, x, y) { var cx = canvas.getcontext('2d'); var pixel = cx.getimagedata(x, y, 1, 1); return { r: pixel.data[0], g: pixel.data[1], b: pixel.data[2], a: pixel.data[3] }; } chaining methods this class provides jquery-style chained access to 2d context methods and properties.
... function canvas2dcontext(canvas) { if (typeof canvas === 'string') { canvas = document.getelementbyid(canvas); } if (!(this instanceof canvas2dcontext)) { return new canvas2dcontext(canvas); } this.context = this.ctx = canvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.ctx); } } canvas2dcontext.setup = function() { var methods = ['arc', 'arcto', 'beginpath', 'beziercurveto', 'clearrect', 'clip', 'closepath', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 'restore', 'rotate', 'save', 'scale', 'settransform', 'stroke', 'strokerect', 'stroketext', 'transform', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointinpath', 'measuretext', /...
...r child objects 'createimagedata', 'createlineargradient', 'createradialgradient', 'getimagedata', 'putimagedata' ]; var props = ['canvas', 'fillstyle', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', 'shadowcolor', 'strokestyle', 'textalign', 'textbaseline']; for (let m of methods) { let method = m; canvas2dcontext.prototype[method] = function() { this.ctx[method].apply(this.ctx, arguments); return this; }; } for (let m of gettermethods) { let method = m; canvas2dcontext.prototype[method] = function() { return this.ctx[method].apply(this.ctx, arguments); }; } for (let p of props) { let prop = p; canvas2dcontext.p...
...And 3 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
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.
...el', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-static strings to methods such as .append() and .html().
...And 3 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
this library provides the interfaces necessary to bootstrap mozilla and call xpcom methods.
... to start embedding, we use the methods provided by the mozilla singleton class.
... if your code cannot find the gre and keeps throwing filenotfoundexceptions during the getgrepathwithproperties(...) call, check whether you already registered the gre on your system: gre registration the initembedding method kicks off the embedding process, allowing the java application to work with xpcom and mozilla.
...And 3 more matches
Clipboard Test - Archive of obsolete content
<style></style> <style>.description{ display: block; font-size: 13pt; color: #444; font-style: italic; margin-bottom: 7px; } .method>.returns{display: none;} .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param>.name:after{content: " as "; font-weight: normal; } .method>.params{display: block; color:#555;} .method>.params>.param{display: block; margin-bottom:5px;} .method>.params>.param>.name{font-weight:bold; margin-right:.5em; min-width:80px; display:inline-block;} .method>.params>.param>.description{display:inline-block; width:300px; vertical-align:top;margin-right:30px} .method>.params>.param>.type{display:inline-block; width:100px; vertical-align:top;font-weight:...
...bold;} .method>.params>.param>.type:before{content: "type "; color: #888; font-weight:normal;} .method>.params>.param>.default{display:inline-block; width:100px; vertical-align:top;font-weight:bold;} .method>.params>.param>.default:before{content: "default "; color: #888;font-weight:normal;} ]]></style> clipboard jetpack's clipboard support api provides a standardized way for features to access the clipboard.
...jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...And 3 more matches
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
methods add(items) clear() contexton(node) hide() insertbefore(newitems, target) item(target) popupon(node) remove(target) replace(target, newitems) reset() set(items) show(anchornode) add(items...
...this method and set() are the recommended methods of adding items to a menu.
...this method and add() are the recommended methods of adding items to a menu.
...And 3 more matches
jspage - Archive of obsolete content
object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=object.reset(b);break;case"array":a[c]=$unlink(a[c]); break;}return a;};new native({name:"class",initialize:class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; },wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new error('the method "'+b+'" cannot be called.'); }var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); }});class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=class.mutators[a];if(f){d=f.call(this,d); if(d==null){...
...a]=class.wrap(this,a,d);break;case"object":var b=c[a]; if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});class.mutators={extends:function(a){this.parent=a; this.prototype=class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new error('the method "'+b+'" has no parent.'); }return c.apply(this,arguments);}.protect());},implements:function(a){$splat(a).each(function(b){if(b instanceof function){b=class.instantiate(b);}this.implement(b); },this);}};var chain=new class({$chain:[],chain:function(){this.$chain.extend(array.flatten(arguments));return this;},callchain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments)...
...2,10*--b)*math.cos(20*b*math.pi*(a[0]||1)/3);}});["quad","cubic","quart","quint"].each(function(b,a){fx.transitions[b]=new fx.transition(function(c){return math.pow(c,[a+2]); });});var request=new class({implements:[chain,events,options],options:{url:"",data:"",headers:{"x-requested-with":"xmlhttprequest",accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",issuccess:null,emulation:true,urlencoded:true,encoding:"utf-8",evalscripts:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.request(); this.setoptions(a);this.options.issuccess=this.options.issuccess||this.issuccess;this.headers=new hash(this.options.headers);},onstatechange:function(){if(this.xhr.readystate!=4||!this.running){return; }this.
...And 3 more matches
Monitoring downloads - Archive of obsolete content
the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download status updates.
... note: the mozistorageconnection method close() is being added to firefox 3 alpha 8; in prior versions of firefox, there is no way to explicitly close the database.
... handling download state changes once the code above is run, our ondownloadstatechange() method is called whenever a download's state changes.
...And 3 more matches
Safely loading URIs - Archive of obsolete content
to solve this problem, gecko provides methods that allow the caller to check whether it's safe to load a particular uri.
... these methods are exposed on the nsiscriptsecuritymanager interface and are called checkloaduri, checkloaduriwithprincipal, and checkloaduristr.
... all three methods take three arguments: the first argument identifies the source of the uri, the second argument is the uri that one plans to load, and the third argument is a set of flags that can be used to impose additional restrictions on the uris that may be loaded.
...And 3 more matches
DOM Interfaces - Archive of obsolete content
the nsidomdocumentxbl interface the nsidomdocumentxbl interface contains methods for manipulating xbl bindings.
... 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.
... getanonymouselementbyattribute the getanonymouselementbyattribute methods retrieves an anonymous descendant with a specified attribute value.
...And 3 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
initializing installation with plugin identifier all xpinstall installations are initiated with the initinstall method of the install object.
...the initinstall method is polymorphic, but here is a recommended invocation mechanism: initinstall("my plugin software", "@myplugin.com/myplugin,version=2.5", "2.5.0.0"); in the code snippet above, the initinstall method is invoked with three parameters: a string for the name of the application a string signifying the plugin identifier associated with the plugin.
...from javascript, you can call xpinstall's execute method of the install object to execute the binary.
...And 3 more matches
Positioning - Archive of obsolete content
first, the position can be specified when using the popup's openpopup method.
... when opening a popup via a script using the openpopup method, the second argument may be used to specify the position instead of using the position attribute.
...the section on the openpopup method provides an example of this.
...And 3 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is created by setting the type attribute of the textbox to autocomplete.
...ller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tabindex, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdat...
...And 3 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
you can also add methods that can be called.
... that way, all you need is to get a reference to the element (using document.getelementbyid or a similar function) and then get or set the additional properties and call the methods on it.
... methods are functions which may be executed.
...And 3 more matches
More Event Handlers - Archive of obsolete content
to manually stop event propagation, call the event object's stoppropagation method, as in the following example.
...the stoppropagation method has been called in the box's listener, so the button's listener never gets called.
...the default action can be prevented with the event object's preventdefault method, as in the example below.
...And 3 more matches
Updating Commands - Archive of obsolete content
invoking commands if a command has an oncommand attribute, you can invoke it just by using the docommand method of the command or an element which links to it.
...then, it checks to see whether the command is enabled, and then executes the command using the docommand method of the controller.
...if you include the script 'chrome://global/content/globaloverlay.js' in a xul file, you can call the godocommand method which executes the command passed as the argument.
...And 3 more matches
Using the Editor from XUL - Archive of obsolete content
now we set up the editorshell by calling its init() method, telling it what type of editor we want (text or html), pointing it at the webshellwindow to use, and telling it the content node that it lives on: editorshell.init(); editorshell.seteditortype(editortype); editorshell.webshellwindow = window; editorshell.contentwindow = window._content; the webshellwindow (a settable attribute on nsieditorshell) points to the top-level window element, from...
...one thing to note about editor initialization is that we pass into the editor's init() method an nsicontent* that corresponds to the root of the content tree that the editor is allowed to work with.
...in both cases, the editorcanclose() method is the javascript is called, which causes the nseditorshell to display a dialog asking the user if they want to save the document, throw away their changes, or cancel.
...And 3 more matches
menulist - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be used for drop-down choice lists.
... attributes accesskey, crop, disableautoselect, disabled, editable, focused, image, label, oncommand, open, preference, readonly, sizetopopup, tabindex, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image, inputfield, itemcount, label, menuboxobject, menupopup, open, selectedindex, selecteditem, tabindex, value methods appenditem, contains, getindexofitem, getitematindex, insertitemat, removeallitems, removeitemat, select examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3"/> <menuitem label="option 4" value="4"/> </menupopup> </menulist> attributes accesskey type: character this ...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserda...
...And 3 more matches
menupopup - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container used to display the contents of a popup menu.
... attributes ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top properties accessibletype, anchornode, popupboxobject, position, state, triggernode methods hidepopup, moveto, openpopup, openpopupatscreen, setconsumerollupevent, showpopup, sizeto examples the following example shows how a menupopup may be attached to a menulist.
... left type: integer overrides the horizontal position of the popup specified by the showpopup method.
...And 3 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
« xul reference home [ examples | attributes | properties | methods | related ] a container which can be used to hold a tabular or hierarchical set of rows of elements.
...to get the actual number of rows in the element, use the getrowcount method.
...(all trees have seltype="multiple" by default.) to reliably change or determine a selection, instead use the nsitreeselection interface methods available via tree.view.selection.
...And 3 more matches
NPClass - Archive of obsolete content
syntax struct npclass { uint32_t structversion; npallocatefunctionptr allocate; npdeallocatefunctionptr deallocate; npinvalidatefunctionptr invalidate; nphasmethodfunctionptr hasmethod; npinvokefunctionptr invoke; npinvokedefaultfunctionptr invokedefault; nphaspropertyfunctionptr hasproperty; npgetpropertyfunctionptr getproperty; npsetpropertyfunctionptr setproperty; npremovepropertyfunctionptr removeproperty; npenumerationfunctionptr enumerate; npconstructfunctionptr construct; }; warning: don't call these routines directly.
... hasmethod called by npn_hasmethod() to determine whether or not a specified method exists on a given npobject.
... returns true if the method exists, otherwise returns false.
...And 3 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
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).
... use non-script based detection methods where possible older browsers have many limitations which result in their ignoring more advanced features.
... html provides several methods of detecting support for various features such as support for scripting and frames.
...And 3 more matches
XForms Custom Controls - Archive of obsolete content
to give you an idea of what we are talking about, it could look something like this: <content> <xf:input xbl:inherits="ref=ref1" anonid="ref1"/> <xf:input xbl:inherits="ref=ref2" anonid="ref2"/> </content> <implementation> <method name="refresh"> <body> // here we should refresh custom control.
... </body> </method> <constructor> // we should redirect calls of input's 'refresh' method to custom control 'refresh' method.
...for example, when the control needs to be updated according to the rules of xforms, the refresh method will be called by the processor.
...And 3 more matches
Silly story generator - Learn web development
there is a particular string method that will help you here — in each case, make the call to the method equal to newstory, so each time it is called, newstory is made equal to itself, but with substitutions made.
...as a further hint, the method in question only replaces the first instance of the substring it finds, so you might need to make one of the calls twice.
... inside the first if block, add another string replacement method call to replace the name 'bob' found in the newstory string with the name variable.
...And 3 more matches
Working with JSON - Learn web development
this is not a big issue — javascript provides a global json object that has methods available for converting between the two.
... other notes json is purely a data format — it contains only properties, no methods.
...add the following below your last line: let request = new xmlhttprequest(); now we need to open the request using the open() method.
...And 3 more matches
Test your skills: Object-oriented JavaScript - Learn web development
we want you to: add a new method to the shape class's prototype, calcperimeter(), which calculates its perimeter (the length of the shape's outer edge) and logs the result to the console.
... call your calcperimeter() method on the instance, to see whether it logs the calculation result to the browser devtools' console as expected.
... oojs 2 next up we want you to take the shape class you saw in task #1 (including the calcperimeter() method) and recreate it using es class syntax instead.
...And 3 more matches
Multiprocess on Windows
when an incoming rpc invokes a method on an interceptor, the interceptor dispatches a callback that allows us to do whatever we want with that request.
... our callback implementation forwards the method call to the main thread in order to invoke the method on the wrapped object.
... arraydata contains seven fields: iid miid; ulong mmethodindex; ulong marrayparamindex; vartype marrayparamtype; iid marrayparamiid; ulong mlengthparamindex; flag mflag; miid is the uuid of the interface owning the function.
...And 3 more matches
AddonInstall
instances can be created using the getinstallforfile() or getinstallforurl() methods on the addonmanager.
... once you have an instance the install() method is used to start automatic download and installation.
... this can be canceled at any time with the cancel() method.
...And 3 more matches
Assert.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://testing-common/assert.jsm"); the assert class offers methods for performing common logical assertions.
... method overview undefined ok(value, message); undefined equal(actual, expected, message); undefined notequal(actual, expected, message); undefined deepequal(actual, expected, message); undefined notdeepequal(actual, expected, message); undefined strictequal(actual, expected, message); undefined notstrictequal(actual, expected, message); undefined throws(block, expected, message); promise rejects(promise, expected, message); undefined greater(lhs, rhs, message); undefined greaterorequal(lhs, rhs, message); undefined less(lhs, rhs, message); undefined lessorequal(lhs, rhs, message); undefined setreporter(reporterfunc); undefined report(failed, actual, expected, ...
... ok, equal, notequal, deepequal, notdeepequal, strictequal, notstrictequal, throws, setreporter, report methods ok() pure assertion tests whether a value is truthy, as determined by !!guard.
...And 3 more matches
DownloadTarget
method overview promise refresh() properties attribute type description exists read only boolean indicates whether or not the target file exists.
... this is a dynamic property, which is updated when the download is completed or when the download.refresh() method is called.
... this is a dynamic property, which is updated when the download finishes or whenever the download.refresh() method is called.
...And 3 more matches
Promise.jsm
to observe the state of a promise, its then method must be used.
... this method registers callback functions that are called as soon as the promise is either fulfilled or rejected.
... the method returns a new promise that, in turn, is fulfilled or rejected depending on the state of the original promise and on the behavior of the callbacks.
...And 3 more matches
Deferred
a deferred object is returned by the promiseutils.defer() method to provide a new promise along with methods to change its state.
... method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
... methods resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise.
...And 3 more matches
PromiseWorker.jsm
next, the promiseworker.js file should be brought in with the require() method.
...let worker = new promiseworker.abstractworker() worker.dispatch = function(method, args = []) { // dispatch a call to method `method` with args `args` return self[method](...args); }; worker.postmessage = function(...args) { // post a message to the main thread self.postmessage(...args); }; worker.close = function() { // close the worker self.close(); }; worker.log = function(...args) { // log (or discard) messages (optional) dump('worker: ' + args.join(' ') + '\n'); }; // connect it to message por...
...self.addeventlistener('message', msg => worker.handlemessage(msg)); abstractworker is a base class for the worker, and it's designed to be used by derived class, which provides above four methods (dispatch, postmessage, close, and log).
...And 3 more matches
source-editor.jsm
method overview initialization and destruction void destroy(); void init(element aelement, object aconfig, function acallback); search operations number find(string astring, [optional] object options); number findnext(boolean awrap); number findprevious(boolean awrap); event management void addeventlistener(string aeventtype, fun...
... lastfind object an object describing the result of the last find operation performed using the find(), findnext(), or findprevious() method.
... editor mode constants these constants are used to set the syntax highlighting mode for the editor by calling its setmode() method, or in the configuration object when first initializing the editor using its init() method.
...And 3 more matches
GC Rooting Guide
js::rootedstring js::rooted<jsscript*> js::rootedscript js::rooted<jsid> js::rootedid for example, instead of this: jsobject* localobj = js_getobjectofsomesort(cx); you would write this: js::rootedobject localobj(cx, js_getobjectofsomesort(cx)); spidermonkey makes it easy to remember to use js::rooted<t> types instead of a raw pointer because all of the api methods that may gc take a js::handle<t>, as described below, and js::rooted<t> autoconverts to js::handle<t> but a bare pointer does not.
...js::mutablehandle<t> is exactly like a js::handle<t> except that it adds a .set(t &t) method and must be created from a js::rooted<t> explicitly.
...ass js::value[] autoarrayrooter js::vector<js::value> autovaluevector js::vector<jsid> autoidvector js::vector<jsobject*> autoobjectvector js::vector<jsscript*> autoscriptvector if your case is not covered by one of these, it is possible to write your own by deriving from js::customautorooter and overriding the virtual trace() method.
...And 3 more matches
Exact Stack Rooting
the method you should use to keep the gc up-to-date with this information will vary depending on where the gcpointer is being stored.
... there is also a static constructor method frommarkedlocation() that creates a handle from an arbitrary location.
...if we have a method taking handle<value>*, then out->setobject(foo) will not work as expected.
...And 3 more matches
JSAutoByteString
methods method description void initbytes(char *bytes) take ownership of the given byte array.
...you should call this before calling encode* methods or initbytes method if a string is already owned, otherwise the string will never be freed.
...you can call some methods to take ownership of other string.
...And 3 more matches
Parser API
it is also available since firefox 7; it can be imported into the global object via: components.utils.import("resource://gre/modules/reflect.jsm") or into a specified object via: components.utils.import("resource://gre/modules/reflect.jsm", obj) built-in objects whether in spidermonkey shell or firefox (after importing), the global singleton object reflect currently contains just the parse method.
... properties of the reflect object the reflect object currently consists of a single method.
...the expected callback methods are described under builder objects.
...And 3 more matches
Building the WebLock UI
a boolean wlocked variable can do this: // initialize the wlocked variable as unlocked var wlocked = 0; then the functions that get called from the interface and call through to the lock and unlock methods of the weblock component must also adjust this variable accordingly: function wlock() { // check to see if locking is on or off weblock.lock(); wlocked = 1; } function wunlock() { // check to see if locking is on or off weblock.unlock(); wlocked = 0; } an important preliminary of these functions is that the weblock component be made available to the javascript in the form of the ...
...as you can see, weblock is initialized as a global javascript variable, available in the scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list.
... the url that the addsite method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid url.
...And 3 more matches
IAccessibleText
when a method doesn't implement this method it must return s_false.
...method overview hresult addselection([in] long startoffset, [in] long endoffset ); [propget] hresult attributes([in] long offset, [out] long startoffset, [out] long endoffset, [out] bstr textattributes ); [propget] hresult caretoffset([out] long offset ); [propget] hresult characterextents([in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [ou...
...rytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); [propget] hresult textatoffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); [propget] hresult textbeforeoffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); methods addselection() adds a text() selection().
...And 3 more matches
mozIStorageStatementWrapper
when you call the mozistorageconnection interface's createstatement() method, you get a mozistoragestatement which has just direct bindings to sqlite.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type description statement mozistoragestatement the statement that is wrapped.
... methods initialize() this method initializes this wrapper with astatement.
...And 3 more matches
nsIAppShell
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void create(inout int argc, inout string argv); obsolete since gecko 1.9 void dispatchnativeevent(in prbool arealevent, in voidptr aevent); obsolete since gecko 1.9 void exit(); void favorperformancehint(in boolean favorperfoverstarvation, in unsigned long starvationdelay); void getnativeevent(in prboolref arealevent, in voidptrref aevent); obsolete since gecko 1.9 void listentoeventqueue(in nsieventqueue aqueue, in prbool alisten); obsolete since gecko 1.9 void resumenative(); void run()...
... methods create() obsolete since gecko 1.9 (firefox 3) creates an application shell.
... resumenative() resumes the use of additional platform-specific methods to run() gecko events on the main application thread.
...And 3 more matches
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 unsign...
... methods getnexttoken() this method is called to get the next token in a sequence of authentication steps.
... init() this method is called to initialize an auth module.
...And 3 more matches
nsIAuthPromptCallback
netwerk/base/public/nsiauthpromptcallback.idlscriptable interface for callback methods for the asynchronous nsiauthprompt2 method.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) callers must call exactly one method if nsiauthprompt2.asyncpromptauth() returns successfully.
... they must not call any method on this interface before nsiauthprompt2.asyncpromptauth() returns.
...And 3 more matches
nsICacheService
method overview nsicachesession createsession(in string clientid, in nscachestoragepolicy storagepolicy, in boolean streambased); acstring createtemporaryclientid(in nscachestoragepolicy storagepolicy); obsolete since gecko 1.9.2 void evictentries(in nscachestoragepolicy storagepolicy); void init(); obsolete since gecko 1.8 void shutdown(); obsolete since...
... methods createsession() this method creates a cache session.
... this method creates and returns a unique, temporary cache client id.
...And 3 more matches
nsICryptoHMAC
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms.
... these values are to be used by the init() method to indicate which hashing function to use.
... constant value description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes this hmac object and produces the actual hmac diegest data.
...And 3 more matches
nsIDOMMozNetworkStatsManager
you can test for the presence of the service as follows, for example: if ("moznetworkstats" in navigator) { /* networkstats is available */ } else { alert("i'm sorry, but networkstats services are not supported."); } method overview nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); nsidomdomrequest addalarm(in nsisupports network, in long threshold, [opti...
... constants constant type description wifi long constant for wifi, set to 0 mobile long constant for mobile, set to 1 methods getsamples() asynchronously queries network interface statistics.
...to know in advance which kind of origin is available, the moznetworkstatsmanager.getavailablenetworks method returns an array of interfaces.
...And 3 more matches
nsIDOMOfflineResourceList
it includes methods for adding resources to and removing resources from the cache, as well as for enumerating the dynamically managed resource list.
... 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.
... methods mozadd() adds an item to the dynamically managed entries.
...And 3 more matches
nsIEditorSpellCheck
to create an instance, use: var editorspellcheck = components.classes["@mozilla.org/editor/editorspellchecker;1"] .createinstance(components.interfaces.nsieditorspellcheck); method overview void addwordtodictionary(in wstring word); boolean canspellcheck(); void checkcurrentdictionary(); boolean checkcurrentword(in wstring suggestedword); boolean checkcurrentwordnosuggest(in wstring suggestedword); astring getcurrentdictionary(); void getdictionarylist([array, size_is(count)] out wstring dictionarylist, out p...
...mdictionary(in wstring word); void replaceword(in wstring misspelledword, in wstring replaceword, in boolean alloccurrences); void savedefaultdictionary(); obsolete since gecko 9.0 void setcurrentdictionary(in astring dictionary); void setfilter(in nsitextservicesfilter filter); void uninitspellchecker(); void updatecurrentdictionary(); methods addwordtodictionary() adds the specified word to the current personal dictionary.
... note: this method was removed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6).
...And 3 more matches
nsIFrameLoader
method overview void activateframeevent(in astring atype, in boolean capture); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcrossprocessm...
... methods activateframeevent() activates event forwarding from client (remote frame) to parent.
...this method figures out what to load from the owner content in the frame loader.
...And 3 more matches
nsINavHistoryQueryOptions
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) method overview nsinavhistoryqueryoptions clone(); attributes attribute type description applyoptionstocontainers boolean if true, the query options are only applied to the containers.
... note that this has no effect on folder links, which are place: uris returned by nsinavbookmarkservice's getfolderuri method.
... sortingmode short the sorting annotation to use; see sorting methods for possible values.
...And 3 more matches
nsIPrefService
inherits from: nsisupports last changed in gecko 1.7 method overview nsiprefbranch getbranch(in string aprefroot); nsiprefbranch getdefaultbranch(in string aprefroot); void readuserprefs(in nsifile afile); void resetprefs(); void resetuserprefs(); void savepreffile(in nsifile afile); methods getbranch() call to get a preferences "branch" which accesses user preference data.
... using a set method on this object will always create or set a user preference value.
... when using a get method a user set value will be returned if one exists, otherwise a default value will be returned.
...And 3 more matches
nsISelectionPrivate
method overview void addselectionlistener(in nsiselectionlistener newlistener); void endbatchchanges(); void getcachedframeoffset(in nsiframe aframe, in print32 inoffset, in nspointref apoint); native code only!
... constants constant value description endofprecedingline 0 startofnextline 1 tableselection_none 0 tableselection_cell 1 tableselection_row 2 tableselection_column 3 tableselection_table 4 tableselection_allcells 5 methods addselectionlistener() void addselectionlistener( in nsiselectionlistener newlistener ); parameters newlistener endbatchchanges() will resume user interface updates after a previous call to startbatchchanges().
... this method became obsolete in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
...And 3 more matches
nsIServerSocket
to create an instance, use: var serversocket = components.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only!
... methods asynclisten() this method puts the server socket in the listening state.
...the listener's onsocketaccepted() method will be called on the same thread that called asynclisten() (the calling thread must have an nsieventtarget).
...And 3 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); astr...
... methods deletetabvalue() deletes a value from a specified tab.
... exceptions thrown this method throws a ns_error_illegal_value exception if the key doesn't exist.
...And 3 more matches
nsITaggingService
toolkit/components/places/public/nsitaggingservice.idlscriptable provides methods to tag/untag a uri, to retrieve uris for a given tag, and to retrieve all tags for a uri.
...to use this service, use: var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"] .getservice(components.interfaces.nsitaggingservice); method overview void taguri(in nsiuri auri, in nsivariant atags); void untaguri(in nsiuri auri, in nsivariant atags); nsivariant geturisfortag(in astring atag); nsivariant gettagsforuri(in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out wstring atags); attributes attribute t...
... tagcontainericonspec autf8string retrieves the url spec for the tag container icon methods taguri() this method tags a uri with the given set of tags.
...And 3 more matches
nsITextInputProcessor
nsidomwindowutils has provided the methods which dispatched keyboard events and composition events almost directly.
...for solving that issue, methods of this interface have been designed for performing a key operation or representing a change of composition state.
... method overview void appendclausetopendingcomposition(in unsigned long alength, in unsigned long aattribute); boolean begininputtransaction(in nsidomwindow awindow, in nsitextinputprocessorcallback acallback); boolean begininputtransactionfortests(in nsidomwindow awindow, [optional] in nsitextinputprocessorcallback acallback); void cancelcomposition([optional] in nsi...
...And 3 more matches
nsITreeBoxObject
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports to get the treeboxobject for a tree: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); or simply: let boxobject = tree.treeboxobject; method overview long getfirstvisiblerow(); long getlastvisiblerow(); long getpagelength(); void ensurerowisvisible(in long index); void ensurecellisvisible(in long row, in nsitreecolumn col); void scrolltorow(in long index); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in lon...
... methods getfirstvisiblerow() get the index of the first visible row.
...this method prevents scrolling off the end of the tree.
...And 3 more matches
nsIWebProgressListener
method overview void onlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri alocation, [optional] in unsigned long aflags); void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long acurselfprogress, in long amaxselfprogress, in long acurtotalprogress, in long amaxtotalprogress); void onsecuritychange(in nsiwebprogress a...
... state security flags these flags describe the security state reported by a call to the onsecuritychange() method.
... security strength flags these flags describe the security strength and accompany state_is_secure in a call to the onsecuritychange() method.
...And 3 more matches
Working with windows in chrome code
its parameters are similar to window.open; in fact, window.open's implementation calls nsiwindowwatcher's methods.
...the return value of window.open (and similar methods) is a window object (usually chromewindow) – the same type as the window variable.
...two of its methods are often used to obtain information about currently open windows: getmostrecentwindow and getenumerator.
...And 3 more matches
Initialization and Destruction - Plugins
« previousnext » this chapter describes the methods that provide the basic processes of initialization, instance creation and destruction, and shutdown.
... this chapter ends with initialize and shutdown example, which includes the np_initialize and np_shutdown methods.
...for an example that shows the use of both the np_initialize and np_shutdown methods, see initialize and shutdown example.
...And 3 more matches
URLs - Plugins
this section describes the methods and procedures used for getting the url and displaying the page.
... for http urls, the browser resolves npn_geturl as the http server method get, which requests url objects.
... the npn_geturlnotify method acts like npn_geturl.
...And 3 more matches
Gecko Plugin API Reference - Plugins
an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac os flushing memory (mac os only) version, ui, and status information displaying a status line message getting agent information getting the current version finding out if a feature exists reloading a plug-in plug-in side plug-in api this chapter describes methods in the plug-in api that are available from the plug-in object.
... the names of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser.
... npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_urlnotify npp_write npp_writeready browser side plug-in api this chapter describes methods in the plug-in api that are available from the browser.
...And 3 more matches
AddressErrors - Web APIs
javascript payment request data first, we declare the variables supportedhandlers, which is compatible with paymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object.
... let supportedhandlers = [ { supportedmethods: "basic-card", data: { supportednetworks: ["visa", "mastercard", "amex", "discover"], supportedtypes: ["credit", "debit"] } } ]; let defaultpaymentdetails = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; supportedhandlers describes the supported payment handlers and the details for those.
... process the payment the main payment processing code is found in the process() method, up next.
...And 3 more matches
CSS - Web APIs
WebAPICSS
the css interface holds useful css-related methods.
... no objects with this interface are implemented: it contains only static methods and is therefore a utilitarian interface.
... methods the css interface is a utility interface and no object of this type can be created: only static methods are defined on it.
...And 3 more matches
CustomEvent - Web APIs
event.istrusted read only indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like event.initevent).
...(a boolean indicating whether the given event will bubble across through the shadow root into the standard dom.) methods customevent.initcustomevent() initializes a customevent object.
... if the event has already being dispatched, this method does nothing.
...And 3 more matches
DOMImplementation - Web APIs
the domimplementation interface represents an object providing methods which are not dependent on any particular document.
... methods no inherited method.
... living standard removed the getfeature() method.
...And 3 more matches
DataTransfer.clearData() - Web APIs
the datatransfer.cleardata() method removes the drag operation's drag data for the given type.
... if data for the given type does not exist, this method does nothing.
... if this method is called with no arguments or the format is an empty string, the data of all types will be removed.
...And 3 more matches
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.
... the nodeselector interface this specification adds two new methods to any objects implementing the document, documentfragment, or element interfaces: queryselector() returns the first matching element node within the node's subtree.
...this is different from other dom querying methods that return live node lists.
...And 3 more matches
Event.initEvent() - Web APIs
WebAPIEventinitEvent
the event.initevent() method is used to initialize the value of an event created using document.createevent().
... events initialized in this way must have been created with the document.createevent() method.
... this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
...And 3 more matches
Event - Web APIs
WebAPIEvent
it can also be triggered programmatically, such as by calling the htmlelement.click() method of an element, or by defining the event, then sending it to a specified target using eventtarget.dispatchevent().
...event itself contains the properties and methods which are common to all events.
... event.istrusted read only indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like event.initevent).
...And 3 more matches
FileReaderSync - Web APIs
methods filereadersync.readasarraybuffer() this method converts a specified blob or a file into an arraybuffer representing the input data as a binary string.
... filereadersync.readasbinarystring() this method converts a specified blob or a file into a domstring representing the input data as a binary string.
... this method is deprecated, consider using readasarraybuffer() instead.
...And 3 more matches
FileSystemDirectoryEntry.getDirectory() - Web APIs
the filesystemdirectoryentry interface's method getdirectory() returns a filesystemdirectoryentry object corresponding to a directory contained somewhere within the directory subtree rooted at the directory on which it's called.
... syntax filesystemdirectoryentry.getdirectory([path][, options][, successcallback][, errorcallback]); parameters path optional a usvstring representing an absolute path or a path relative to the directory on which the method is called, describing which directory entry to return.
... successcallback optional a method to be called once the filesystemdirectoryentry has been created.
...And 3 more matches
FileSystemDirectoryEntry.getFile() - Web APIs
} the filesystemdirectoryentry interface's method getfile() returns a filesystemfileentry object corresponding to a file contained somewhere within the directory subtree rooted at the directory on which it's called.
... syntax filesystemdirectoryentry.getfile([path][, options][, successcallback][, errorcallback]); parameters path optional a usvstring specifying the path, relative to the directory on which the method is called, describing which file's entry to return.
... successcallback optional a method to be called once the filesystemfileentry has been created.
...And 3 more matches
HTMLButtonElement - Web APIs
the htmlbuttonelement interface provides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements.
... htmlbuttonelement.formmethod is a domstring reflecting the http method that the browser uses to submit the form.
... if specified, this attribute overrides the method attribute of the <form> element that owns this element.
...And 3 more matches
HTMLMediaElement.seekToNextFrame() - Web APIs
the htmlmediaelement.seektonextframe() method asynchronously advances the the current play position to the next frame in the media.
... this non-standard method is part of an experimentation process around support for non-real-time access to media for tasks including filtering, editing, and so forth.
... you should not use this method in production code, because its implementation may change—or be removed outright—without notice.
...And 3 more matches
HTMLTextAreaElement - Web APIs
the htmltextareaelement interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements.
... methods blur() removes focus from the control; keystrokes will subsequently go nowhere.
... reportvalidity() this method reports the problems with the constraints on the element, if any, to the user.
...And 3 more matches
Recommended Drag Types - Web APIs
caution: all methods and properties in this document with a moz prefix, such as mozsetdataat(), will only work with gecko-based browsers.
... because a file is not a string, you must use the mozsetdataat() method to assign the data.
... similarly, when retrieving the data, you must use the mozgetdataat() method.
...And 3 more matches
History - Web APIs
WebAPIHistory
methods the history interface doesn't inherit any methods.
... back() this asynchronous method goes to the previous page in session history, the same action as when the user clicks the browser's back button.
... calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception.
...And 3 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 doms...
... methods createobjectstore() creates and returns a new object store with the given name in the connected database.
... exceptions this method can raise an idbdatabaseexception with the following code: constraint_err if an object store with the same name (based on case-sensitive comparison) already exists in the connected database.
...And 3 more matches
compareVersion - Web APIs
method of installtrigger object syntax int compareversion ( string registryname, installversion version); int compareversion ( string registryname, string version); int compareversion ( string registryname, int major, int minor, int release, int build); parameters the compareversion method has the following parameters: registryname the pathname in the client versio...
... returns if the versions are the same or if software installation is not enabled, this method returns 0.
... if the version of registryname is smaller (earlier) than version, this method returns a negative number.
...And 3 more matches
Using the Media Capabilities API - Web APIs
in short, this api replaces—and improves upon—the mediasource method istypesupported() or the htmlmediaelement method canplaytype().
...you can, therefore, test for the presence of the api like so: if ("mediacapabilities" in navigator) { // mediacapabilities is available } else { // mediacapabilities is not available } taking video as an example, to obtain information about video decoding abilities, you create a video decoding configuration which you pass as a parameter to mediacapabilities.decodinginfo() method.
... creating a video decoding configuration the mediacapabilities.decodinginfo() method takes as a parameter a media decoding configuration.
...And 3 more matches
NodeFilter - Web APIs
it is the user who is expected to write one, tailoring the acceptnode() method to its needs, and using it with some treewalker or nodeiterator objects.
... methods this interface doesn't inherit any methods.
... this method is expected to be written by the user of a nodefilter.
...And 3 more matches
PaymentRequest.canMakePayment() - Web APIs
the paymentrequest method canmakepayment() determines whether or not the request is configured in a way that is compatible with at least one payment method supported by the user agent.
... you can call this before calling show() to provide a streamlined user experience when the user's browser can't handle any of the payment methods you accept.
... for instance, you might call canmakepayment() to determine if the browser will let the user pay using payment request api, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by payment request api (or even provide instructions for paying by mail or by phone).
...And 3 more matches
Using the Permissions API - Web APIs
the only supported method right now is permissions.query(), which queries permission status.
...this object will eventually include methods for querying, requesting, and revoking permissions, although currently it only contains permissions.query(); see below.
...ocation.getcurrentposition(revealposition,positiondenied,geosettings); } else if (result.state == 'denied') { report(result.state); geobtn.style.display = 'inline'; } result.onchange = function() { report(result.state); } }); } function report(state) { console.log('permission ' + state); } handlepermission(); permission descriptors the permissions.query() method takes a permissiondescriptor dictionary as a parameter — this contains the name of the api you are interested in.
...And 3 more matches
Range - Web APIs
WebAPIRange
a range can be created by using the document.createrange() method.
... range objects can also be retrieved by using the getrangeat() method of the selection object or the caretrangefrompoint() method of the document object.
... methods there are no inherited methods.
...And 3 more matches
SVGTextPathElement - Web APIs
textpathelement" target="_top"><rect x="-169" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-79" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method types name value description textpath_methodtype_unknown 0 the type is not one of predefined types.
... textpath_methodtype_align 1 corresponds to the value align.
... textpath_methodtype_stretch 2 corresponds to the value stretch.
...And 3 more matches
Selection - Web APIs
WebAPISelection
methods selection.addrange() a range object that will be added to the selection.
... notes string representation of a selection calling the selection.tostring() method returns the text contained within the selection, e.g.: var selobj = window.getselection(); window.alert(selobj); note that using a selection object as the argument to window.alert will call the object's tostring method.
... behavior of selection api in terms of editing host focus changes the selection api has a common behavior (i.e., shared between browsers) that governs how focus behavior changes for editing hosts after certain methods are called.
...And 3 more matches
Using Service Workers - Web APIs
ight expect, but the rest of the code is a little different: let body = document.queryselector('body'); let myimage = new image(); imgload('mylittlevader.jpg').then((response) => { var imageurl = window.url.createobjecturl(response); myimage.src = imageurl; body.appendchild(myimage); }, (error) => { console.log(error); }); on to the end of the function call, we chain the promise then() method, which contains two functions — the first one is executed when the promise successfully resolves, and the second is called when the promise is rejected.
... in the resolved case, we display the image inside myimage and append it to the body (its argument is the request.response contained inside the promise’s resolve method); in the rejected case we return an error to the console.
...pp.js', './sw-test/image-list.js', './sw-test/star-wars-logo.jpg', './sw-test/gallery/', './sw-test/gallery/bountyhunters.jpg', './sw-test/gallery/mylittlevader.jpg', './sw-test/gallery/snowtroopers.jpg' ]); }) ); }); here we add an install event listener to the service worker (hence self), and then chain a extendableevent.waituntil() method onto the event — this ensures that the service worker will not install until the code inside waituntil() has successfully occurred.
...And 3 more matches
Service Worker API - Web APIs
registration a service worker is first registered using the serviceworkercontainer.register() method.
...you can modify the response to these requests in any way you want, using the fetchevent.respondwith method.
... note: because oninstall/onactivate could take a while to complete, the service worker spec provides a waituntil method, once this is called oninstall or onactivate, it passes a promise.
...And 3 more matches
TextRange - Web APIs
WebAPITextRange
methods textrange.collapse() move the caret to the beginning or end of the current range.
... textrange.querycommandenabled() returns a boolean indicating whether the specified command can be executed successfully with the execcommand method in the current state of the given document.
... document.selection property returns a non-standard selection object, and the selection.createrange() method creates a textrange object consistent with the currently selection.
...And 3 more matches
WebGL2RenderingContext - Web APIs
some methods of the webgl 1 context can accept additional values when used in a webgl 2 context.
... uniforms and attributes webgl2renderingcontext.uniform[1234][uif][v]() methods specifying values of uniform variables.
... webgl2renderingcontext.uniformmatrix[234]x[234]fv() methods specifying matrix values for uniform variables.
...And 3 more matches
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
the webglrenderingcontext.uniform[1234][fi][v]() methods of the webgl api specify values of uniform variables.
...they retain the values assigned to them by a call to this method until the next successful link operation occurs on the program object, when they are once again initialized to 0.
...possible types: a floating point number for floating point values (methods with "f").
...And 3 more matches
Sending and Receiving Binary Data - Web APIs
sending binary data the send method of the xmlhttprequest has been extended to enable easy transmission of binary data by accepting an arraybuffer, blob, or file object.
... the following example creates a text file on-the-fly and uses the post method to send the "file" to the server.
... firefox-specific examples this example transmits binary content asynchronously, using the post method, and firefox's non-standard sendasbinary().
...And 3 more matches
XMLHttpRequest.send() - Web APIs
the xmlhttprequest method send() sends the request to the server.
... if the request is asynchronous (which is the default), this method returns as soon as the request is sent and the result is delivered using events.
... if the request is synchronous, this method doesn't return until the response has arrived.
...And 3 more matches
XRReferenceSpace - Web APIs
methods in addition to the methods inherited from its parent interface, xrspace (there are none at this time), xrreferencespace inherits methods from eventtarget.
... xrreferencespace also provides the following methods.
... getoffsetreferencespace() creates and returns a new reference space object as the same type as the one on which you call the method (so, either xrreferencespace or xrboundedreferencespace).
...And 3 more matches
XRSession - Web APIs
WebAPIXRSession
the webxr device api's xrsession interface represents an ongoing xr session, providing methods and properties used to interact with and control the session.
... to open a webxr session, use the xrsystem interface's requestsession() method.
... with xrsession methods, you can poll the viewer's position and orientation (the xrviewerpose), gather information about the user's environment, and present imagery to the user.
...And 3 more matches
msWriteProfilerMark - Web APIs
the mswriteprofilermark method writes a profiling event.
... this proprietary method is specific to internet explorer and microsoft edge.
...if this method succeeds, it returns s_ok.
...And 3 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
this.r = obj.r; this.g = obj.g; this.b = obj.b; this.a = obj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; color.prototype.setformat = function setformat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format = 'hsl'; }; /*========== methods to set color properties ==========*/ color.prototype.isvalidrgbvalue = function isvalidrgbvalue(value) { return (typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.prototype.setrgba = function setrgba(red, green, blue, alpha) { if (this.isvalidrgbvalue(red) === false || this.isvalidrgbvalue(green) === false || this.isvalidrgbvalue(blue...
...valid !== true) return; if (value[0] === '#') value = value.slice(1, value.length); if (value.length === 3) value = value.replace(/([0-9a-f])([0-9a-f])([0-9a-f])/i,'$1$1$2$2$3$3'); this.r = parseint(value.substr(0, 2), 16); this.g = parseint(value.substr(2, 2), 16); this.b = parseint(value.substr(4, 2), 16); this.alpha = 1; this.rgbtohsv(); }; /*========== conversion methods ==========*/ color.prototype.converttohsl = function converttohsl() { if (this.format === 'hsl') return; this.setformat('hsl'); this.rgbtohsl(); }; color.prototype.converttohsv = function converttohsv() { if (this.format === 'hsv') return; this.setformat('hsv'); this.rgbtohsv(); }; /*========== update methods ==========*/ color.prototype.updatergb = function updater...
...lta) { if (cmax === red ) { hue = ((green - blue) / delta); } if (cmax === green ) { hue = 2 + (blue - red) / delta; } if (cmax === blue ) { hue = 4 + (red - green) / delta; } if (cmax) saturation = delta / x; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.lightness = (lightness * 100) | 0; }; /*========== get methods ==========*/ color.prototype.gethexa = function gethexa() { var r = this.r.tostring(16); var g = this.g.tostring(16); var b = this.b.tostring(16); if (this.r < 16) r = '0' + r; if (this.g < 16) g = '0' + g; if (this.b < 16) b = '0' + b; var value = '#' + r + g + b; return value.touppercase(); }; color.prototype.getrgba = function getrgba() { var rgb = '(' + this.r + ', ' ...
...And 3 more matches
ime-mode - CSS: Cascading Style Sheets
WebCSSime-mode
the ime-mode css property controls the state of the input method editor (ime) for text fields.
... values auto no change is made to the current input method editor state.
... active the input method editor is initially active; text entry is performed through it unless the user specifically dismisses it.
...And 3 more matches
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
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.
... for example, if your form needs to ask the user for their preferred contact method, you might create three radio buttons, each with the name property set to contact but one with the value email, one with the value phone, and one with the value mail.
... the resulting html looks like this: <form> <p>please select your preferred contact method:</p> <div> <input type="radio" id="contactchoice1" name="contact" value="email"> <label for="contactchoice1">email</label> <input type="radio" id="contactchoice2" name="contact" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="contactchoice3" name="contact" value="mail"> <label for="contactchoice3">mail</label> </div> <div> <button type="submit">submit</button> </div> </form> here you see the three radio buttons, each with the name set to contact and each with a unique value that uniquely identifies that individual radio button wi...
...And 3 more matches
If-None-Match - HTTP
for get and head methods, the server will send back the requested resource, with a 200 status, only if it doesn't have an etag matching the given ones.
... for other methods, the request will be processed only if the eventually existing resource's etag doesn't match any of the values listed.
... when the condition fails for get and head methods, then the server must return http status code 304 (not modified).
...And 3 more matches
Grammar and types - JavaScript
for example: '37' - 7 // 30 '37' + 7 // "377" converting strings to numbers in the case that a value representing a number is in memory as a string, there are methods for conversion.
... parseint('101', 2) // 5 an alternative method of retrieving a number from a string is with the + (unary plus) operator: '1.1' + '1.1' // '1.11.1' (+'1.1') + (+'1.1') // 2.2 // note: the parentheses are added for clarity, not required.
... enhanced object literals in es2015, object literals are extended to support setting the prototype at construction, shorthand for foo: foo assignments, defining methods, making super calls, and computing property names with expressions.
...And 3 more matches
Introduction - JavaScript
functions can be properties of objects, executing as loosely typed methods.
...you do not have to declare all variables, classes, and methods.
... you do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces.
...And 3 more matches
constructor - JavaScript
the constructor method is a special method of a class for creating and initializing an object of that class.
...} description a constructor enables you to provide any custom initialization that must be done before any other methods can be called on an instantiated object.
... console.log(error.printcustomermessage()); } else { console.log('unknown error', error); throw error; } } there can be only one special method with the name "constructor" in a class.
...And 3 more matches
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
the javascript warning "date.prototype.tolocaleformat is deprecated; consider using intl.datetimeformat instead" occurs when the non-standard date.prototype.tolocaleformat method is used.
... the non-standard date.prototype.tolocaleformat method is deprecated and shouldn't be used anymore.
... examples deprecated syntax the date.prototype.tolocaleformat method is deprecated and will be removed (no cross-browser support, available in firefox only).
...And 3 more matches
Functions - JavaScript
in javascript, functions are first-class objects, because they can have properties and methods just like any other object.
...see function for information on properties and methods of function objects.
... defining method functions getter and setter functions you can define getters (accessor methods) and setters (mutator methods) on any standard built-in object or user-defined object that supports the addition of new properties.
...And 3 more matches
Array.prototype.indexOf() - JavaScript
the indexof() method returns the first index at which a given element can be found in the array, or -1 if it is not present.
... description indexof() compares searchelement to elements of the array using strict equality (the same method used by the === or triple-equals operator).
... note: for the string method, see string.prototype.indexof().
...And 3 more matches
Function.prototype.call() - JavaScript
the call() method calls a function with a given this value and arguments provided individually.
... caution: in certain cases, thisarg may not be the actual value seen by the method.
... if the method is a function in non-strict mode, null and undefined will be replaced with the global object, and primitive values will be converted to objects.
...And 3 more matches
Function.prototype.toString() - JavaScript
the tostring() method returns a string representing the source code of the function.
... description the function object overrides the tostring method inherited from object; it does not inherit object.prototype.tostring.
... for user-defined function objects, the tostring method returns a string containing the source text segment which was used to define the function.
...And 3 more matches
Number - JavaScript
the number constructor contains constants and methods for working with numbers.
... static methods number.isnan() determine whether the passed value is nan.
... instance methods number.prototype.toexponential(fractiondigits) returns a string representing the number in exponential notation.
...And 3 more matches
Object.prototype.propertyIsEnumerable() - JavaScript
the propertyisenumerable() method returns a boolean indicating whether the specified property is enumerable and is the object's own property.
... description every object has a propertyisenumerable method.
... this method can determine whether the specified property in an object can be enumerated by a for...in loop, with the exception of properties inherited through the prototype chain.
...And 3 more matches
Promise.any() - JavaScript
essentially, this method is the opposite of promise.all().
...the promise.any() method is experimental and not fully supported by all browsers and platforms.
... description this method is useful for returning the first promise that fulfils.
...And 3 more matches
Reflect - JavaScript
reflect is a built-in object that provides methods for interceptable javascript operations.
... the methods are the same as those of proxy handlers.
...all properties and methods of reflect are static (just like the math object).
...And 3 more matches
RegExp.prototype[@@replace]() - JavaScript
the [@@replace]() method replaces some or all matches of a this pattern in a string by a replacement, and returns the result of the replacement as a new string.
... description this method is called internally in string.prototype.replace() if the pattern argument is a regexp object.
... 'abc'.replace(/a/, 'a'); /a/[symbol.replace]('abc', 'a'); this method exists for customizing replace behavior in regexp subclass.
...And 3 more matches
RegExp.prototype[@@split]() - JavaScript
the [@@split]() method splits a string object into an array of strings by separating the string into substrings.
...the [@@split]() method still splits on every match of this regexp pattern (or, in the syntax above, regexp), until the number of split items match the limit or the string falls short of this pattern.
... description this method is called internally in string.prototype.split() if its separator argument is an object that has a @@split method, such as a regexp.
...And 3 more matches
TypedArray.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified array and its elements.
... this method has the same algorithm as array.prototype.tostring().
... examples the typedarray objects override the tostring method of object.
...And 3 more matches
super - JavaScript
the super.prop and super[expr] expressions are valid in any method definition in both classes and object literals.
... this.name = 'square'; } } super-calling static methods you are also able to call super on static methods.
...in this example, two objects define a method.
...And 3 more matches
Digital audio concepts - Web media technologies
the most commonly-used compression methods for audio apply the science of psychoacoustics.
... by using a sound (no pun intended) understanding of psychoacoustics, it's possible to design a compression method that will minimize the compressed size of the audio while maximizing the percieved fidelity of the sound.
...generally, lossy compression results in significantly smaller output than lossless compression methods; also, many lossy codecs are excellent, with the loss in quality and detail being difficult or even impossible for the average listener to discern.
...And 3 more matches
Using custom elements - Web Components
to register a custom element on the page, you use the customelementregistry.define() method.
... 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 defines its functionality: customelements.define('popup-info', popupinfo); it is now available to use on our page.
... next, we register the element using the define() method as before, except that this time it also includes an options object that details what element our custom element inherits from: customelements.define('expanding-list', expandinglist, { extends: "ul" }); using the built-in element in a web document also looks somewhat different: <ul is="expanding-list"> ...
...And 3 more matches
Loading and running WebAssembly code - WebAssembly
the older webassembly.compile/webassembly.instantiate methods require you to create an arraybuffer containing your webassembly module binary after fetching the raw bytes, and then compile/instantiate it.
... the newer webassembly.compilestreaming/webassembly.instantiatestreaming methods are a lot more efficient — they perform their actions directly on the raw stream of bytes coming from the network, cutting out the need for the arraybuffer step.
... the quickest, most efficient way to fetch a wasm module is using the newer webassembly.instantiatestreaming() method, which can take a fetch() call as its first argument, and will handle fetching, compiling, and instantiating the module in one step, accessing the raw byte code as it streams from the server: webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(results => { // do something with the results!
...And 3 more matches
event/target - Archive of obsolete content
adding listeners eventtarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`.
...eventtarget interface defines convenience method for adding one shot event listeners via method once.
...}); removing listeners eventtarget interface defines api for unregistering event listeners, via removelistener method: target.removelistener('message', onmessage); emitting events eventtarget interface intentionally does not define an api for emitting events.
...And 2 more matches
Downloading Files - Archive of obsolete content
the following methods of downloading files may not work as expected after firefox 26, and should no longer be used.
... downloading files to download a file, create an instance of nsiwebbrowserpersist and call its nsiwebbrowserpersist.saveuri() method, passing it a url to download and an nsifile instance representing the local file name/path.
...if you want to open a login prompt, you can use the default prompt by calling the window watcher's getnewauthprompter() method.
...And 2 more matches
JS XPCOM - Archive of obsolete content
an interface is simply a list of constants and methods that can be called on the object, an example is nsifile.
... creating an instance of a component the preferred method of creating xpcom instances is via the components.constructor helper.
...g/file/local;1", "nsifile", "initwithpath"); var file = new nsfile(filepath); they can also be created and initialized manually: var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsifile); file.initwithpath(filepath); this creates a new instance of the object with contract id @mozilla.org/file/local;1 and allows you to call methods from the nsifile interface on it.
...And 2 more matches
View Source for XUL Applications - Archive of obsolete content
method overview gviewsourceutils exposes several methods, but the only one you should be using directly is the viewsource method.
... the rest of those methods should be considered private, and might become inaccessible in the future.
... void viewsource(aobject); methods viewsource opens a viewer to the source code for some document or uri.
...And 2 more matches
Inline options - Archive of obsolete content
locating the options file there are two ways to let the add-on manager find your options file: method 1 name the file options.xul and put it in the extension's root folder (alongside install.rdf).
... this method does not require you to create a chrome.manifest and set it's path.
... this method does not require you to specify optionstype in install.rdf.
...And 2 more matches
Intercepting Page Loads - Archive of obsolete content
the subject argument on the observe method is the nsihttpchannel object that corresponds to the http channel being opened or already opened, depending on the topic.
...remember that your observe method will be called for every http request made by firefox, usually several dozen per page visit.
... there are a couple of things left to do: implementing the progress listener methods, and figuring out what notify_all is about.
...And 2 more matches
Updating addons broken by private browsing changes - Archive of obsolete content
idls nsitransferable: see using the clipboard for information about the new init method.
... nsidownload now has retry, cancel, remove, pause, and resume methods which should be used instead of deprecated similarly-named nsidownloadmanager methods.
... nsidownload's getdownload method is deprecated; use the asynchronous getdownloadbyguid method instead.
...And 2 more matches
Notes on HTML Reflow - Archive of obsolete content
this is passed as an argument to the reflow method of the root frame in the frame hierarchy.
...to request (or schedule ) an incremental reflow (e.g., in response to a change in the content model), a reflow command object is created and passed to the presentation shell via the nsipresshell::appendreflowcommand method.
...a reflow state object is created with a reflow reason of incremental, the reflow command is stored in the state, and the reflow method of the root frame is invoked.
...And 2 more matches
JavaScript crypto - Archive of obsolete content
you can then register event handlers for these events with the document.addeventlistener() method.
... generating keys and issuing user certificates there are several crypto object methods used in generating keys for certificates: generatecrmfrequest(), importusercertificates().
... overview of the new cert issuing process user fills out enrollment form user action initiates script script calls key generation method (generatecrmfrequest) signing and encryption keys are generated encryption private key is wrapped with public key of key recovery authority (kra) (passed in in the form of a certificate as part of the script, and checked against a pre-installed certificate copy in the local certificate database) the public keys, wrapped encryption private key, and text string from the script (possibly containi...
...And 2 more matches
Anonymous Content - Archive of obsolete content
the anonymous content is accessible only through special methods like getanonymousnodes and getanonymouselementbyattribute.
... the scope of an element can be determined using the getbindingparent method on the documentxbl interface.
...this method returns the bound element in the enclosing scope that is responsible for the anonymous node.
...And 2 more matches
compareTo - Archive of obsolete content
method of installversion object syntax compareto ( installversion version); compareto ( string version); compareto ( int major, int minor, int release, int build); parameters the compareto method has the following parameters: maj the major version number.
... returns if the versions are the same, this method returns 0.
... if this version object represents a smaller (earlier) version than that represented by the version parameter, this method returns a negative number.
...And 2 more matches
getWinProfile - Archive of obsolete content
method of install object syntax winprofile getwinprofile ( object folder, string file); parameters the getwinprofile method has the following parameters: folder an object representing a directory.
... you create this object by passing a string representing the directory to the getfolder method.
...description the getwinprofile method creates an object for manipulating the contents of a windows .ini file.
...And 2 more matches
initInstall - Archive of obsolete content
method of install object syntax int initinstall ( string displayname, string package, installversion version, int flags); int initinstall ( string displayname, string package, string version, int flags); int initinstall ( string displayname, string package, string version); int initinstall ( string displayname, string package, installversion version); parameters the initinstall method has the following parameters: displayname a string that contains the name of the software being installed.
...this distinction is important when you add components with the addfile method.
...description the initinstall method initializes the installation of the specified software.
...And 2 more matches
patch - Archive of obsolete content
method of install object syntax int patch ( string registryname, string xpisourcepath, object localdirspec, string relativelocalpath); int patch ( string registryname, installversion version, string xpisourcepath, object localdirspec, string relativelocalpath); int patch ( string registryname, string version, string xpisourcepath, object localdirspec, string relativelocalpath); parameters the patch method has the following parameters: registryname the pathname in the client version registry for the component that is to be patched.this parameter can be an absolute pathname, such as /royalairways/royalsw/executable or a relative pathname, such as executable.
... typically, relative pathnames are relative to the main pathname specified in the initinstall method.
...for variants or this method without a version argument the value from initinstall will be used.
...And 2 more matches
setPackageFolder - Archive of obsolete content
method of install object syntax void setpackagefolder ( object folder); parameters the setpackagefolder method has the following parameter: folder an object representing a directory.
... you create this object by passing a string representing the directory to the getfolder or getcomponentfolder method.
...description the setpackagefolder method to set the default package folder that is saved with the root node.
...And 2 more matches
getValue - Archive of obsolete content
getvalue netscape 6 and mozilla do not currently support this method.
...method of winreg object syntax winregvalue getvalue ( string subkey, string valname); parameters the getvalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...description the getvalue method retrieves the value of an arbitraty key.
...And 2 more matches
setValue - Archive of obsolete content
setvalue netscape 6 and mozilla do not currently support this method.
...method of winreg object syntax string setvalue ( string subkey, string valname, winregvalue value); parameters the setvalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...description the setvalue method sets the value of an arbitrary key.
...And 2 more matches
findbar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] in gecko 1.9, the findbar widget moved into toolkit, so it's available to any xul application, as well as extensions.
... attributes browserid, findnextaccesskey, findpreviousaccesskey, highlightaccesskey, matchcaseaccesskey properties browser, findmode methods close, onfindagaincommand, open, startfind, togglehighlight example <browser type="content-primary" flex="1" id="content" src="about:blank"/> <findbar id="findtoolbar" browserid="content"/> attributes browserid type: string the id of the browser element to which the findbar is attached.
... possible values are: find_normal (0): normal find find_typeahead (1): typeahead find find_links (2): link find methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
...And 2 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is created by setting the type attribute of a textbox to autocomplete.
...the sessions can be set using the searchsessions attribute or by calling the addsession method.
...cecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...And 2 more matches
Custom Tree Views - Archive of obsolete content
the tree will call methods of the view to get the information that it needs to display.
...three methods that you should implement are listed below.
... getcelltext( row , column ) this method should return the text contents at the specified row and column.
...And 2 more matches
XULBrowserWindow - Archive of obsolete content
the xulbrowserwindow object provides methods and properties that let the browser update the user interface of the enclosing xul window.
...see the linked interfaces for the definition of the implemented methods.
... method overview boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden.
...And 2 more matches
menu - Archive of obsolete content
ArchiveMozillaXULmenu
« xul reference home [ examples | attributes | properties | methods | related ] an element, much like a button, that is placed on a menubar.
... attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, menuactive, open, sizetopopup, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, itemcount, label, labelelement, menupopup, open, parentcontainer, selected, tabindex, value methods appenditem, getindexofitem, getitematindex, insertitemat, removeitemat style classes menu-iconic example <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menuitem label="new"/> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> <menu id="edi...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserda...
...And 2 more matches
notification - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the notification is used to display an informative message.
... attributes image, label, priority, persistence, type, value properties accessibletype, control, image, label, priority, persistence, type, value methods close examples <notification label="this is a warning"/> attributes image type: uri the uri of the image to appear on the element.
... persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
...And 2 more matches
preferences - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] overview <preferences> is a container for <preference> elements.
... note: it's not clear which of the following methods and properties are public.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element.
...And 2 more matches
prefpane - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single preference panel in a prefwindow.
... attributes helpuri, image, label, onpaneload, selected, src properties image, label, preferenceelements, preferences, selected, src examples methods preferenceforelement <prefpane id="panegeneral" label="general" src="chrome://path/to/paneoverlay.xul"/> or <prefpane id="panegeneral" label="general" onpaneload="ongeneralpaneload(event);"> <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> ...
...to change the selected pane, use the prefwindow's showpane method.
...And 2 more matches
radiogroup - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a group of radio buttons.
... attributes disabled, focused, preference, tabindex, value properties accessibletype, disabled, focuseditem, itemcount, selectedindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserda...
...And 2 more matches
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
« xul reference home [ examples | attributes | properties | methods | related ] a row of tabs.
... attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selectedindex, selecteditem, tabindex, value, methods advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat, removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserda...
...And 2 more matches
textbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an input field where the user can enter text.
..., size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase, reset, select, setselectionrange style classes plain examples <vbox> <label control="your-name" value="enter your name:"/> <textbox id="your-name" value="john"/> </vbox> attributes cols type: integer for multiline textboxes, the number of columns to display.
...to get the actual number of rows in the element, use the getrowcount method.
...And 2 more matches
New in JavaScript 1.3 - Archive of obsolete content
--> new features in javascript 1.3 new globals nan infinity undefined new methods isfinite() function.prototype.call() function.prototype.apply() date.utc() date.prototype.getfullyear() date.prototype.setfullyear() date.prototype.getmilliseconds() date.prototype.setmilliseconds() date.prototype.getutcfullyear() date.prototype.getutcmonth() date.prototype.getutcdate() date.prototype.getutchours() date.prototype.getutcminutes() date.prototype.getutcseconds() da...
... changed functionality in javascript 1.3 changes to date to conform with ecma-262 new constructor date(year, month, day, [,hours [, minutes [, seconds [, milliseconds ]]]]) additional method parameters: setmonth(month[, date]) sethours(hours[, min[, sec[, ms]]]) setminutes(min[, sec[, ms]]) setseconds(sec[, ms]) the length of an array (property length) is now an unsigned, 32-bit integer.
... array.prototype.push(): in javascript 1.2, the push method returned the last element added to an array.
...And 2 more matches
Object.prototype.unwatch() - Archive of obsolete content
these two methods were implemented only in firefox prior to version 58, they're deprecated and removed in firefox 58+.
... the unwatch() method removes a watchpoint set with the watch() method.
... description the javascript debugger has functionality similar to that provided by this method, as well as other debugging options.
...And 2 more matches
Object.prototype.watch() - Archive of obsolete content
these two methods were implemented only in firefox prior to version 58, they're deprecated and removed in firefox 58+.
... the watch() method watches for a property to be assigned a value and runs a function when that occurs.
... to remove a watchpoint, use the unwatch() method.
...And 2 more matches
handler.enumerate() - Archive of obsolete content
the handler.enumerate() method used to be a trap for for...in statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.
... syntax var p = new proxy(target, { enumerate(target) { } }); parameters the following parameter is passed to the enumerate method.
... description the handler.enumerate method is a trap for for...in statements.
...And 2 more matches
JSException - Archive of obsolete content
method summary the netscape.javascript.jsexception class has the following methods: getwrappedexception instance method getwrappedexception.
... getwrappedexceptiontype instance method getwrappedexceptiontype returns the int mapping of the type of the wrappedexception object.
...the getwrappedexception method was not available.
...And 2 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
the syntax for accessing e4x objects is actually quite natural and certainly easier than most methods.
...this accounts for added simplicity and promotes rapid development methodologies.
...there are numerous methods in this namespace which allow for a simple, yet powerful approach to file management.
...And 2 more matches
Windows Media in Netscape - Archive of obsolete content
while the progid cannot be used to create a windows media player object that exposes all its properties and methods, it is useful for rapid detections.
...unlike using the progid as an argument, using wmplayer.ocx.7 as an argument to both these apis creates a fully usable reference to the windows media player 7 or 9 control, with all the methods and properties exposed to javascript.
... scripting the windows media player control the number of methods and properties that are exposed by the windows media player, including the events that the player throws for handling by scripts in the web page containing the control, are covered in detail by the windows media player sdk.
...And 2 more matches
Create the Canvas and draw on it - Game development
ctx.beginpath(); ctx.rect(20, 40, 50, 50); ctx.fillstyle = "#ff0000"; ctx.fill(); ctx.closepath(); all the instructions are between the beginpath() and closepath() methods.
...the fillstyle property stores a color that will be used by the fill() method to paint the square, in our case, red.
...try adding this to the bottom of your javascript, saving and refreshing: ctx.beginpath(); ctx.arc(240, 160, 20, 0, math.pi*2, false); ctx.fillstyle = "green"; ctx.fill(); ctx.closepath(); as you can see we're using the beginpath() and closepath() methods again.
...And 2 more matches
Animations and tweens - Game development
the spritesheet() method's two extra paremeters determine the width and height of each single frame in the given spritesheet file, indicating to the program how to chop it up to get the individual frames.
... loading the animation next up, go into your create() function, find the line that loads the ball sprite, and below it put the call to animations.add() seen below: ball = game.add.sprite(50, 250, 'ball'); ball.animations.add('wobble', [0,1,0,2,0,1,0,2,0], 24); to add an animation to the object we use the animations.add() method, which contains the following parameters the name we chose for the animation an array defining the order in which to display the frames during the animation.
... applying the animation when the ball hits the paddle in the arcade.collide() method call that handles the collision between the ball and the paddle (the first line inside update(), see below) we can add an extra parameter that specifies a function to be executed every time the collision happens, in the same fashion as the ballhitbrick() function.
...And 2 more matches
Mixin - MDN Web Docs Glossary: Definitions of Web-related terms
a mixin is a class or interface in which some or all of its methods and/or properties are unimplemented, requiring that another class or interface provide the missing implementations.
... the new class or interface then includes both the properties and methods from the mixin as well as those it defines itself.
... all of the methods and properties are used exactly the same regardless of whether they're implemented in the mixin or the interface or class that implements the mixin.
...And 2 more matches
Beginner's guide to media queries - Learn web development
it's always worth considering whether these layout methods can achieve what you want without adding media queries.
...the nice thing about this method is that grid is not looking at the viewport width, but the width it has available for this component.
...however, in practice you will find that good use of modern layout methods, enhanced with media queries, will give the best results.
...And 2 more matches
Making asynchronous programming easier with async and await - Learn web development
instead of needing to chain a .then() block on to the end of each promise-based method, you just need to add an await keyword before the method call, and then assign the result to a variable.
...this line also invokes an async promise-based method, so we use await here as well.
... async/await class methods as a final note before we move on, you can even add async in front of class/object methods to make them return promises, and await promises inside them.
...And 2 more matches
Video and Audio APIs - Learn web development
if it is paused, we set the data-icon attribute value on the play button to "u", which is a "paused" icon, and invoke the htmlmediaelement.play() method to play the media.
... next, let's define stopmedia() — add the following function below playpausemedia(): function stopmedia() { media.pause(); media.currenttime = 0; play.setattribute('data-icon','p'); } there is no stop() method on the htmlmediaelement api — the equivalent is to pause() the video, and set its currenttime property to 0.
...the classlist is a rather handy property that exists on every element — it contains a list of all the classes set on the element, as well as methods for adding/removing classes, etc.
...And 2 more matches
Test your skills: Object basics - Learn web development
run the greeting() method using dot notation (it will log the greeting to the browser devtools' console).
...we want you to rewrite the greeting() method so that it logs "hello, said bertie the cymric." to the browser devtools' console, but in a way that will work across any cat object of the same structure, regardless of its name or breed.
... when you are done, write your own object called cat2, which has the same structure, exactly the same greeting() method, but a different name, breed, and color.
...And 2 more matches
Aprender y obtener ayuda - Learn web development
different learning methods it is interesting to consider that there are two main ways in which your brain learns things — focused and diffuse learning: focused learning is what you might more traditionally associate with academic subjects.
... note: you might favor one learning method over the others, but realistically a hybrid approach is probably what you will end up with.
... and you'll probably come up with other methods than the three we covered above.
...And 2 more matches
TypeScript support in Svelte - Learn web development
the variable todosstatus, which we used to programmatically access the methods exposed by the todosstatus component, is of type todosstatus.
...it should end up looking like this: // actions.ts export function selectonfocus(node: htmlinputelement) { if (node && typeof node.select === 'function' ) { // 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 ...
... but initial and value should be any object that could be converted to a valid json string with the json.stringify method.
...And 2 more matches
Creating our first Vue component - Learn web development
for this component, we’ll use the object registration method.
... {{}} is a special template syntax in vue, which lets us print the result of javascript expressions defined in our class, inside our template, including values and methods.
...it also binds other attributes (data, which you’ve already seen, and others like methods, computed, etc.) directly to the instance.
...And 2 more matches
Application cache implementation overview
when the update is about to actually start, the scheduling service calls nsofflinecacheupdate::begin() method, that switches the update to checking state (+invokes onchecking event) and starts fetch of the manifest file.
... the parallel load is implemented by asynchronous recursive calls to processnexturi(), a method searching always a single entry that is scheduled to load.
... note: the processnexturi method early returns when state of the update is different then downloading.
...And 2 more matches
Creating JavaScript callbacks in components
the component can then call methods on the observer interface to signal the external code when predefined events occur.
... here is a very simple example of the observer pattern: [scriptable, uuid(...)] interface stringparserobserver { void onword(string word); }; [scriptable, uuid(...)] interface stringparser { void parse(string data); void addobserver(stringparserobserver observer); }; in this example, the stringparser will call the stringparserobserver.onword method whenever it finishes parsing a word found in the raw string data.
...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 her...
...And 2 more matches
Commenting IDL for better documentation
if an interface is used as a parameter or as the type of the value returned by a method, please use the full name of the interface in the description of the method.
... @param parameter description every parameter of a method should be documented, only use the parameter name, leave out things like [in]/[out].
... @returns description if the method returns something then this should be included.
...And 2 more matches
Add-on Manager
they must be registered through the addaddonlistener() method.
... installing new add-ons new add-ons can be installed by using the getinstallforfile() or getinstallforurl() methods on the addonmanager object.
...a listener can be registered either for a specific install using the addlistener() method or for all installs using the addinstalllistener() method.
...And 2 more matches
DownloadList
method overview promise<array<download>> getall(); promise add(download adownload); promise remove(download adownload); promise addview(object aview); promise removeview(object aview); void removefinished([optional] function afilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the list.
...to receive change notifications for downloads that are added to the list, use the addview() method to register for ondownloadchanged notifications.
...if the download was already removed, this method has no effect.
...And 2 more matches
PopupNotifications.jsm
to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/popupnotifications.jsm"); once you've imported the module, you can then use the popupnotifications object it exports; this object provides methods for creating and displaying popup notification panels.
... method overview void locationchange(); notification getnotification(id, browser); void remove(notification); notification show(browser, id, message, anchorid, mainaction, secondaryactions, options); properties attribute type description ispanelopen boolean returns true if the notification panel is currently visible, false if it is not.
... methods locationchange() the consumer can call this method to let the popup notification module know that the current browser's location has changed.
...And 2 more matches
WebRequest.jsm
method string the http method to be used (get, post, etc).
... method string the http method to be used (get, post, etc).
... method string the http method to be used (get, post, etc).
...And 2 more matches
Mozilla Web Developer FAQ
you should not rely on mozilla’s document.all support on new pages.) the method document.getelementbyid() can be used instead.
...the correct way to access an element by id is to call the document.getelementbyid() method with the id as a string as the argument.
...when working with the dom, it is better to check for the existence of the methods and objects you are planning on using.
...And 2 more matches
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
certificates and keys are often looked up by the following methods: by looking up all private keys.
...this is the same method used for generating software keys and certificates and is used by certificate authorities like verisign and thawte.
... (red hat certificate server also uses this method).
...And 2 more matches
Rhino JavaScript compiler
the resulting java class files can then be loaded and executed at another time, providing a convenient method for transferring javascript, and for avoiding translation cost.
...each global function in the source file is made a method of the generated class, overriding any methods in the base class by the same name.
...each global function in the source file is made a method of the generated class, implementing any methods in the interface by the same name.
...And 2 more matches
Property cache
↓ o ----> o ----> o ----> o ^global ^x' (----> indicates proto as before; downward arrows ↓ indicate the parent relation) method guarantee — if at time t0 the object x has shape s; and x has an own property p that is a method property (transparently joined function); and at time t1 an object y has shape s; and no shape-regenerating gc occurred; then at time t1 y's own property p is the same method property.
... (the existence of this property is guaranteed by the basic layout guarantee above.) (informally: two objects with the same shape have the same method properties.) branded object guarantee — if at time t0 the object x has shape s; and x is branded (x->branded()); and x has an own property p, which is a writable, function-valued data property with the stub getter and setter and a slot; and at time t1 an object y has shape s; and no shape-regenerating gc occurred; then y is x, and at time t1 x's own property p has the same function value it had at time t0.
... (the existence of this property is guaranteed by the basic layout guarantee above.) (informally: branded objects have unique shapes, and if x is branded, changing any of x's own methods will change its shape.) extensibility guarantee — if at time t0 an object x of shape s is extensible, and at time t1 an object y has shape s, and no shape-regenerating gc occurred, then at t1 y is extensible.
...And 2 more matches
SpiderMonkey Internals
standard library the methods for arrays, booleans, dates, functions, numbers, and strings are implemented using the js api.
...most string methods are customized to accept a primitive string as the this argument.
... (otherwise, spidermonkey converts primitive values to objects before invoking their methods, per ecma 262-3 §11.2.1.) error handling spidermonkey has two interdependent error-handling systems: javascript exceptions (which are not implemented with, or even compatible with, any kind of native c/c++ exception handling) and error reporting.
...And 2 more matches
JS_DefineElement
getter jsnative or jspropertyop getproperty method for retrieving the current property value.
... setter jsnative or jsstrictpropertyop setproperty method for specifying a new property value.
...getter and setter identify the getproperty and setproperty methods for the property, respectively.
...And 2 more matches
Places utilities for JavaScript
placesutils method overview nsiuri createfixeduri(string aspec); string getformattedstring(string key, string params); string getstring(string key); boolean nodeisfolder(nsinavhistoryresultnode anode); boolean nodeisbookmark(nsinavhistoryresultnode anode); boolean nodeisseparator(nsinavhistoryresultnode anode); boolean nodeisvisit(nsinavhistoryresultno...
... placesflavors generic_view_drop_types methods createfixeduri nsiuri createfixeduri(string aspec) takes in a spec and returns a valid uri based on it using the nsiurifixup service.
... bookmark dialog methods to show the bookmarkproperties dialog in its various modes.
...And 2 more matches
Using the Places annotation service
most methods in the service are duplicated with one method labeled as a 'page annotation' taking an nsiuri and the others labeled as an 'item annotation' and taking the id of an item in the places database.
...you can use the annotations service's hasannotation method to determine in advance if the page has the requested annotation.
... the getter functions return only the value of the annotation (with the exception of the c++ getpageannotationbinary and getitemannotationbinary methods which return the mimetype as well).
...And 2 more matches
Generic factory
rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method.
... */ ns_imethod setconstructor(constructorprocptr constructor) = 0; }; using nsigenericfactory is simple.
... examples class nsicomponent : public nsisupports { public: ns_imethod dosomething() = 0; }; class mycomponent : public nsicomponent { public: mycomponent(); virtual ~mycomponent(); static ns_method create(nsisupports *aouter, refnsiid aiid, void **aresult); ns_impl_isupports ns_imethod dosomething(); }; to create a factory for this class, simply write the following: nsifactory* newcomponentfactory(nsirepository* repository) { nsigenericfactory*...
...And 2 more matches
Components.lastResult
components.lastresult returns the numeric nsresult code that was the result code of the last xpcom method called via xpconnect.
... introduction generally, components.lastresult is only useful for testing the result of xpcom methods that can return interesting 'success' codes.
... this is because failure result codes get converted by xpconnect into exceptions that are thrown into the calling javascript method.
...And 2 more matches
Components.utils
please keep this list in sync with the components object page methods method description cloneinto() create a structured clone of an object in a different javascript context.
... getcomponentsforscope() this seemingly-paradoxical api allows privileged code to explicitly give unprivileged code a reference to its own components object (whereas it's normally hidden away on a scope chain visible only to xbl methods).
... lookupmethod() looks up a native (i.e.
...And 2 more matches
mozITXTToHTMLConv
last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) inherits from nsistreamconverter implemented by @mozilla.org/txttohtmlconv;1 as a service: var ios = components.classes["@mozilla.org/txttohtmlconv;1"] .getservice(components.interfaces.mozitxttohtmlconv); method overview unsigned long citeleveltxt(in wstring line, out unsigned long loglinestart) void findurlinplaintext(in wstring text, in long alength, in long apos, out long astartpos, out long aendpos) wstring scanhtml(in wstring text, in unsigned long whattodo) wstring scantxt(in wstring text, in unsigned long whattodo) constants conversion control attribut...
... methods scantxt() scans the specified text, applying the requested conversions and outputting html.
... warning: don't use the kglyphsubstitution conversion type with this method, as doing so generates html that is non-standard.
...And 2 more matches
nsIAppStartup
to use the service: var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); method overview void createhiddenwindow(); boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.9.1 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gec...
...obsolete since gecko 1.9.1 constants the following flags may be passed as the amode parameter to the quit() method.
... methods createhiddenwindow() create the hidden window.
...And 2 more matches
nsIAuthPrompt2
to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method overview nsicancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pruint32 level, in nsiauthinformation authinfo); boolean promptauth(in nsichannel achannel, in pruint32 level, in nsiauthinformation authinfo); constants constant value description level_none 0 the password will be ...
... methods asyncpromptauth() asynchronously prompt the user for a username and password.
... if the user closes the dialog using a cancel button or similar, the callback's nsiauthpromptcallback.onauthcancelled() method must be called.
...And 2 more matches
nsICacheSession
inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void asyncopencacheentry(in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentr...
... methods asyncopencacheentry() this method gives an asynchronous cache access.
...evictentries() this method evicts all entries for this session's clientid according to its storagepolicy.
...And 2 more matches
nsICommandLine
method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); ...
... methods findflag() finds a command-line flag, returning its position on the command line.
...this is, essentially, a helper method that combines findflag() and removearguments() into one operation.
...And 2 more matches
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.
... this will be called exactly once for each method invocation, and afterward no other callback methods will be called.
... void handlecompletion( in unsigned short reason ); parameters reason one of the complete_* values indicating the manner in which the method completed.
...And 2 more matches
nsICookiePermission
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nscookieaccess canaccess(in nsiuri auri, in nsichannel achannel); boolean cansetcookie(in nsiuri auri, in nsichannel achannel, in nsicookie2 acookie, inout boolean aissession, inout print64 aexpiry); nsiuri getoriginatinguri(in nsichannel achannel); void setaccess(in nsiuri auri, in nscookieaccess aaccess); constants constant value description access_default 0 nscookieaccess's access default value access_allow 1 nscookieaccess's access allow value access_deny 2 nscookieaccess's access deny value access_session 8 additi...
...onal values for nscookieaccess, which are not directly used by any methods on this interface, but are nevertheless convenient to define here.
... methods canaccess() tests whether or not the given uri/channel may access the cookie database, either to set or get cookies.
...And 2 more matches
nsICookieService
netwerk/cookie/public/nsicookieservice.idlscriptable provides methods for setting and getting cookies in the context of a page load.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) see nsicookiemanager and nsicookiemanager2 for methods to manipulate the cookie database directly.
... method overview string getcookiestring(in nsiuri auri, in nsichannel achannel); string getcookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel); void setcookiestring(in nsiuri auri, in nsiprompt aprompt, in string acookie, in nsichannel achannel); void setcookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in st...
...And 2 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 nsidocshellloadi...
... kcharsetfrompreviousloading methods addsessionstorage() add a webapps session storage object to the docshell.
...this method will post an event to complete the simulated load after returning to the event loop.
...And 2 more matches
nsIDownloadProgressListener
as the states of downloads change, the methods described here are called by the download manager so your code can take whatever steps it needs to.
...rather, the developer must create an object with the methods provided below to implement it.
... method overview void ondownloadstatechange(in short astate, in nsidownload adownload); void onlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri alocation, in nsidownload adownload); obsolete since gecko 1.9.1 void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress, in nsidownload adownload); void onsecuritychange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astate, in nsidownload adownload); void onstatechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus, in nsidownload adownload); ...
...And 2 more matches
nsIINIParserWriter
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) this interface provides methods that allow writing to ini-format configuration files.
... once the writer object is created, you can use the setstring() method to set the value of a property within a given section; the section is created if it hasn't been yet.
... when you're done and ready to write the ini file to disk, call the writefile() method.
...And 2 more matches
nsILocalFile
xpcom/io/nsilocalfile.idlscriptable this interface adds methods to nsifile that are particular to a file that is accessible via the local file system.
...to create an instance, use: var localfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); method overview void appendrelativenativepath(in acstring relativefilepath); native code only!
... methods native code only!
...And 2 more matches
nsIMicrosummary
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface defines attributes and methods for dealing with microsummaries generated by an 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 void addobserver(in nsimicrosummaryobserver observer); boolean equals(in nsimicrosummary aother); void removeobserver(in nsimicrosummaryobserver observer); void update(); attributes attribute type description content astring the content of the microsummary.
... methods addobserver() add a microsummary observer to this microsummary.
...And 2 more matches
nsINavHistoryObserver
method overview void onbeforedeleteuri(in nsiuri auri, in acstring aguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onclearhistory(); void ondeleteuri(in nsiuri auri, in acstring aguid); void ondeletevisits(in nsiuri auri, in prtime avisittime, in acstring aguid); void onendupdatebatch(); void onpagechanged(in nsiuri auri,...
... methods onbeforedeleteuri() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409.
... onpageexpired() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: this method was removed in gecko 2.0.
...And 2 more matches
nsINavHistoryQuery
this is important because, if the user has their profile on a networked drive, query latency can be non-negligible method overview nsinavhistoryquery clone(); void getfolders([optional ]out unsigned long count, [retval,array,size_is(count)] out long long folders); void gettransitions([optional] out unsigned long count, [retval,array,size_is(count)] out unsigned long transitions); void setfolders([const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount); void settransitions...
...to search for items that are tagged with any given tags instead of all, multiple queries may be passed to the nsinavhistoryservice method nsinavhistoryservice.executequeries().
...methods getfolders() this method retrieves all the folders with the folder count.
...And 2 more matches
nsIParentalControlsService
to create an instance, use: var parentalcontrolsservice = components.classes["@mozilla.org/parental-controls-service;1"] .createinstance(components.interfaces.nsiparentalcontrolsservice); method overview void log(in short aentrytype, in boolean aflag, in nsiuri asource, [optional] in nsifile atarget); boolean requesturioverride(in nsiuri atarget, [optional] in nsiinterfacerequestor awindowcontext); boolean requesturioverrides(in nsiarray atargets, [optional] in nsiinterfacerequestor awindowcontext); attributes attribute type description ...
...if this is true, applications should log relevant events using log() method.
... methods log() logs an application specific parental controls event.
...And 2 more matches
nsIPermissionManager
last changed in gecko 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) inherits from: nsisupports method overview void add(in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void remove(in autf8string host, in string type); void removefromprincipal(in nsiprincipal ...
... methods add() add permission information and permission type for a given uri.
...it is internally calling add() method using the nsiuri from the principal.
...And 2 more matches
nsIServiceManager
inherits from: nsisupports last changed in gecko 1.0 method overview void getservice(in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getservicebycontractid(in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); boolean isserviceinstantiated(in nscidref aclass, in nsiidref aiid); boolean isserviceinstantiatedbycontractid(in string acontractid, in nsiidref aiid); methods getservice() this method returns a reference to a particular xpcom servi...
... getservicebycontractid() this method returns a reference to a particular xpcom service given the contractid of the service.
... isserviceinstantiated() this method tests whether or not a xpcom service, identified by classid, has been instantiated.
...And 2 more matches
nsISound
to use this interface, use: var sound = components.classes["@mozilla.org/sound;1"] .createinstance(components.interfaces.nsisound); method overview void beep(); void init(); void play(in nsiurl aurl); void playeventsound(in unsigned long aeventid); void playsystemsound(in astring soundalias); constants sound event constants constant value description event_new_mail_received 0 the system rece...
... methods beep() plays a beep sound.
...other methods will call init if they need to.
...And 2 more matches
nsIStreamConverter
you can supply data directly to the converter by calling it's nsistreamlistener.ondataavailable() method.
... it will then convert that data from type x to your desired output type and return converted data to you via the nsistreamlistener you passed in by calling its nsistreamlistener.ondataavailable() method.
...stream converter contractid format (the stream converter root key is defined in this file): @mozilla.org/streamconv;1?from=from_mime_type&to=to_mime_type method overview void asyncconvertdata(in string afromtype, in string atotype, in nsistreamlistener alistener, in nsisupports actxt); nsiinputstream convert(in nsiinputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt); methods asyncconvertdata() asynchronous version: converts data arriving via the converter's nsistreamlistener.ondataavailable() meth...
...And 2 more matches
nsIStreamListener
nsirequestobserver contains two methods.
... so, in all the three methods - ondataavailable(), nsirequestobserver.onstartrequest() and nsirequestobserver.onstoprequest() have to be implemented.
... method overview void ondataavailable(in nsirequest arequest, in nsisupports acontext, in nsiinputstream ainputstream, in unsigned long aoffset, in unsigned long acount); methods ondataavailable() this method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread.
...And 2 more matches
nsITaskbarPreviewController
its methods and properties are used by the nsitaskbarpreview interface.
...depending on whether the controller is connected to an nsitaskbartabpreview or nsitaskbarwindowpreview, only certain methods and attributes need to be implemented.
... 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 image.
...And 2 more matches
nsITaskbarWindowPreview
if the enablecustomdrawing attribute is true, the controller you implement will start receiving calls to its nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods, as well as reads of its width, height, and thumbnailaccessratio attributes.
... note: this interface will never invoke the controller's nsitaskbarpreviewcontroller.onclose() or nsitaskbarpreviewcontroller.onactivate() methods, since handling them may conflict with other internal gecko state management.
...user clicks on the toolbar buttons are reported to your nsitaskbarpreviewcontroller implementation's nsitaskbarpreviewcontroller.onclick() method.
...And 2 more matches
nsIThreadPool
method overview void shutdown(); attributes attribute type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive.
... the thread pool takes ownership of the listener and releases it when the shutdown() method is called.
... methods shutdown() shuts down the thread pool.
...And 2 more matches
nsIURL
netwerk/base/public/nsiurl.idlscriptable this interface provides convenience methods that further break down the path portion of nsiuri.
...ory/filebasename.fileextension;param \ \ / \ ----------------------- \ | / \ filename / ---------------------------- | filepath you can get a nsiurl from an nsiuri, using the queryinterface() method: var myuri = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice) .newuri("http://developer.mozilla.org", null, null); try { var myurl = myuri.queryinterface(components.interfaces.nsiurl); } catch(e) { // the uri is not an url } or using instanceof: if (myuri instanceof components.interfaces.nsiurl...
...) { // your code here } method overview autf8string getcommonbasespec(in nsiuri auritocompare); autf8string getrelativespec(in nsiuri auritocompare); attributes attribute type description directory autf8string directory portion of a url.
...And 2 more matches
nsIVariant
we mark the interface [scriptable] so that js can use methods that refer to this interface.
... but we mark all the methods and attributes [noscript] since any nsivariant object will be automatically converted to a js type anyway.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview acstring getasacstring(); native code only!
...And 2 more matches
nsIXmlRpcClient
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiur...
... constants constant type description int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods init() set server url.
... call this before using this object void getdata ( in string serverurl ) ; parameters serverurl url of server side object on which methods should be called setauthentication() set authentication info if needed.
...And 2 more matches
Using the clipboard
this method only works to put strings on the clipboard.
... for other types of data, such as urls or images, you will need to use a more complex method.
...for reading from the clipboard you can call the init method of the transferable with null as nsiloadcontext, but you have to call it.
...And 2 more matches
Working with Multiple Versions of Interfaces
getwindowhandle is the tenth method declared in the nsiaccessibledocument.h that firefox 2 was built with, but actually the eighth method in the sdk that i used to build my extension (and hence xpcom component).
... since these classes don't use vtables this means i'm probably, no i can be more positive, definitely calling the wrong method.
... if i were a betting man, i'd hedge a bet on getaccessibleinparentchain, that being the tenth method in the interface declaration in the new sdk.
...And 2 more matches
Working with out parameters
when working with xpcom components, you might come across method declarations like the following one: [scriptable, uuid(8b5314bc-db01-11d2-96ce-0060b0fb9956)] interface nsitransferable : nsisupports { ...
...} the gettransferdata method takes three parameters, aflavor, adata, and adatalen, and returns nothing.
... adata and adatalen are marked as out, meaning that they act as "return values" for this method, and are changed during the method call.
...And 2 more matches
Mail event system
if the object just needs to be notified about one folder, it should call that folder's addlistener method.
... methods each event type has a two methods associated with it: notify*<event> - in the nsifolder interface, and nsimsgmailsession interface.
... future plans the notification system has two duplicate methods which could be implemented with onitemevent/notifyitemevent: folderloaded , and deleteormovemessagescompleted .
...And 2 more matches
CData
method overview methods available on all cdata objects cdata address() string tosource() string tostring() properties properties of all cdata objects property type description constructor ctype the data type of the cdata object, as a ctype.
... methods available on all cdata objects address() returns a cdata object of the pointer type ctypes.pointertype(dataobject.constructor) whose value points to the c object referred to by the object.
... methods available on string objects these methods must be called on objects that are arrays or pointers to 8-bit or 16-bit character or integer types, terminated by a null character.
...And 2 more matches
Memory - Plugins
the methods that handle memory belong to the browser group of methods.
... the npn_memalloc method has the following syntax: void *npn_memalloc (uint32 size); the size parameter is an unsigned long integer that represents the amount of memory, in bytes, to allocate in the browser's memory space.
... the npn_memfree method deallocates a block of memory that was allocated using npn_memalloc only.
...And 2 more matches
Scripting plugins - Plugins
the threading model for this api is such that all calls through this api are synchronous and calls from a plugin to methods in this api must come from the thread on which the plugin was initiated, and likewise all calls to methods in this api by the browser are guaranteed to come from the same thread.
...that means that a script from an origin other than the origin of the page that loaded the plugin is not able to access methods and properties on the plugin.
...calling npn_getvalue() with either of those new enumerations will return an npobject representing the browser object, and from there, the functions in this api can be used to get and set properties, and to call methods on those browser objects.
...And 2 more matches
Blob.stream() - Web APIs
WebAPIBlobstream
the blob interface's stream() method returns a readablestream which upon reading returns the data contained within the blob.
... usage notes with stream() and the returned readablestream, you gain several interesting capabilities: call getreader() on the returned stream to get an object to use to read the data from the blob using methods such as the readablestreamdefaultreader interface's read() method.
... call the returned stream's pipeto() method to pipe the blob's data to a writable stream.
...And 2 more matches
Using the CSS Painting API - Web APIs
css.paintworklet.addmodule('nameofpaintworkletfile.js'); this can be done using the paint worklet's addmodule() method in a <script> within the main html or in an external javascript file linked to from the document.
...to be able to access properties, we include the static inputproperties() method, which provides live access to css properties, including regular properties and custom properties, and returns an array of property names.
... } /* use this function to retrieve any custom properties (or regular properties, such as 'height') defined for the element, return them in the specified array */ static get inputproperties() { return ['--boxcolor', '--widthsubtractor']; } paint(ctx, size, props) { /* ctx -> drawing context size -> paintsize: width and height props -> properties: get() method */ ctx.fillstyle = props.get('--boxcolor'); ctx.fillrect(0, size.height/3, size.width*0.4 - props.get('--widthsubtractor'), size.height*0.6); } }); we used the inputproperties() method in the registerpaint() class to get the values of two custom properties set on an element that has boxbg applied to it and then used those within our paint() function.
...And 2 more matches
CanvasRenderingContext2D.arcTo() - Web APIs
the canvasrenderingcontext2d.arcto() method of the canvas 2d api adds a circular arc to the current sub-path, using the given control points and radius.
... this method is commonly used for making rounded corners.
...this is one of the method's most common uses.
...And 2 more matches
CanvasRenderingContext2D.closePath() - Web APIs
the canvasrenderingcontext2d.closepath() method of the canvas 2d api attempts to add a straight line from the current point to the start of the current sub-path.
... this method doesn't draw anything to the canvas directly.
... you can render the path using the stroke() or fill() methods.
...And 2 more matches
CanvasRenderingContext2D.lineTo() - Web APIs
the canvasrenderingcontext2d method lineto(), part of the canvas 2d api, adds a straight line to the current sub-path by connecting the sub-path's last point to the specified (x, y) coordinates.
... like other methods that modify the current path, this method does not directly render anything.
... to draw the path onto a canvas, you can use the fill() or stroke() methods.
...And 2 more matches
CanvasRenderingContext2D.resetTransform() - Web APIs
the canvasrenderingcontext2d.resettransform() method of the canvas 2d api resets the current transform to the identity matrix.
... syntax void ctx.resettransform(); examples resetting the matrix this example draws a rotated rectangle after modifying the matrix, and then resets the matrix using the resettransform() method.
... html <canvas id="canvas"></canvas> javascript the rotate() method rotates the transformation matrix by 45°.
...And 2 more matches
Advanced animations - Web APIs
to draw the ball, we will create a ball object which contains properties and a draw() method to paint it on the canvas.
...; var ctx = canvas.getcontext('2d'); var ball = { x: 100, y: 100, radius: 25, color: 'blue', draw: function() { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.closepath(); ctx.fillstyle = this.color; ctx.fill(); } }; ball.draw(); nothing special here, the ball is actually a simple circle and gets drawn with the help of the arc() method.
...to do so, we add the following checks to the draw method: if (ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } first demo let's see how it looks in action so far.
...And 2 more matches
CharacterData - Web APIs
methods inherits methods from its parent, node, and implements the childnode and nondocumenttypechildnode interface.
... 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 2 more matches
Clipboard - Web APIs
WebAPIClipboard
calls to the methods of the clipboard object will not succeed if the user hasn't granted the needed permissions using the permissions api and the "clipboard-read" or "clipboard-write" permission as appropriate.
... all of the clipboard api methods operate asynchronously; they return a promise which is resolved once the clipboard access has been completed.
... methods clipboard is based on the eventtarget interface, and includes its methods.
...And 2 more matches
CustomEvent.initCustomEvent() - Web APIs
the customevent.initcustomevent() method initializes a customevent object.
... if the event has already been dispatched, this method does nothing.
... events initialized in this way must have been created with the document.createevent() method.
...And 2 more matches
DataTransfer.mozClearDataAt() - Web APIs
the datatransfer.mozcleardataat() method removes the data associated with the given format for an item at the specified index.
...if the format is not found, then this method has no effect.
... note: this method is gecko-specific.
...And 2 more matches
DataTransfer.mozGetDataAt() - Web APIs
the datatransfer.mozgetdataat() method is used to retrieve an item in the drag event's data transfer object, based on a given format and index.
... this method returns null if the specified item does not exist or if the index is not in the range from zero to the number of items minus one.
... note: this method is gecko-specific.
...And 2 more matches
DataTransfer - Web APIs
methods standard methods datatransfer.cleardata() remove the data associated with a given type.
...if data for the specified type does not exist, or the data transfer contains no data, this method will have no effect.
... gecko methods note: all of the methods in this section are gecko-specific.
...And 2 more matches
Document.getElementById() - Web APIs
the document method getelementbyid() returns an element object representing the element whose id property matches the specified string.
...getelementbyid example</title> </head> <body> <p id="para">some text here</p> <button onclick="changecolor('blue');">blue</button> <button onclick="changecolor('red');">red</button> </body> </html> javascript function changecolor(newcolor) { var elem = document.getelementbyid('para'); elem.style.color = newcolor; } result usage notes the capitalization of "id" in the name of this method must be correct for the code to function; getelementbyid() is not valid and will not work, however natural it may seem.
... 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.
...And 2 more matches
Element.classList - Web APIs
WebAPIElementclassList
the domtokenlist itself is read-only, although you can modify it using the add() and remove() methods.
...classlist.add("foo", "bar", "baz"); div.classlist.remove("foo", "bar", "baz"); // add or remove multiple classes using spread syntax const cls = ["foo", "bar"]; div.classlist.add(...cls); div.classlist.remove(...cls); // replace class "foo" with class "bar" div.classlist.replace("foo", "bar"); versions of firefox before 26 do not implement the use of several arguments in the add/remove/toggle methods.
... the following polyfill for both classlist and domtokenlist ensures full compliance (coverage) for all standard methods and properties of element.prototype.classlist for ie10-ie11 browsers plus nearly compliant behavior for ie 6-9.
...And 2 more matches
Element.getAttributeNS() - Web APIs
the getattributens() method of the element interface returns the string value of the attribute with the specified namespace and name.
... 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.
...And 2 more matches
Element.getElementsByClassName() - Web APIs
the element method getelementsbyclassname() returns a live htmlcollection which contains every descendant element which has the specified class name or names.
... the method getelementsbyclassname() on the document interface works essentially the same way, except it acts on the entire document, starting at the document root.
...st'); this example finds all elements that have a class of test, which are also a descendant of the element that has the id of main: document.getelementbyid('main').getelementsbyclassname('test'); matching multiple classes to find elements whose class lists include both the red and test classes: element.getelementsbyclassname('red test'); examining the results you can use either the item() method on the returned htmlcollection or standard array syntax to examine individual elements in the collection.
...And 2 more matches
Element.msZoomTo() - Web APIs
WebAPIElementmsZoomTo
the mszoomto method scrolls and/or zooms an element to its specified coordinate with animation.
... this proprietary method is specific to internet explorer and microsoft edge.
... this method has no scrolling effect on non-scrollable elements and no zooming effect on non-zoomable elements (e.g., elements with "-ms-content-zooming: none").
...And 2 more matches
Fetch API - Web APIs
WebAPIFetch API
for making a request and fetching a resource, use the windoworworkerglobalscope.fetch() method.
... the fetch() method takes one mandatory argument, the path to the resource you want to fetch.
... once a response is retrieved, there are a number of methods available to define what the body content is and how it should be handled (see body).
...And 2 more matches
FileSystemFileEntry.createWriter() - Web APIs
the filesystemfileentry interface's method createwriter() returns a filewriter object which can be used to write data into the file represented by the directory entry.
... errorcallback optional if provided, this must be a method which is caled when an error occurs while trying to create the filewriter.
... example this example establishes a method, writetofileentry(), which outputs a text string to the file corresponding to the passed-in directory entry.
...And 2 more matches
FileSystemFileEntry.file() - Web APIs
the filesystemfileentry interface's method file() returns a file object which can be used to read data from the file represented by the directory entry.
... errorcallback optional if provided, this must be a method which is called when an error occurs while trying to create the file.
... example this example establishes a method, readfile(), reads a text file and calls a specified callback function with the received text (in a string object) once the read is completed.
...And 2 more matches
FileSystemFileEntry - Web APIs
it offers properties describing the file's attributes, as well as the file() method, which creates a file object that can be used to read the file.
... methods file() creates a new file object which can be used to read the file.
... obsolete methods createwriter() creates a new filewriter object which allows writing to the file represented by the file system entry.
...And 2 more matches
Fullscreen API - Web APIs
the fullscreen api adds methods to present a specific element (and its descendants) in full-screen mode, and to exit full-screen mode once it is no longer needed.
...instead, it augments several other interfaces to add the methods, properties, and event handlers needed to provide full-screen functionality.
... methods the fullscreen api adds methods to the document and element interfaces to allow turning off and on full-screen mode.
...And 2 more matches
HTMLCanvasElement - Web APIs
the htmlcanvaselement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements.
... the htmlcanvaselement interface also inherits the properties and methods of the htmlelement interface.
... methods inherits methods from its parent, htmlelement.
...And 2 more matches
HTMLFormElement.submit() - Web APIs
the htmlformelement.submit() method submits a given <form>.
... this method is similar, but not identical to, activating a form's submit <button>.
... when invoking this method directly, however: no submit event is raised.
...And 2 more matches
HTMLInputElement.setSelectionRange() - Web APIs
the htmlinputelement.setselectionrange() method sets the start and end positions of the current text selection in an <input> or <textarea> element.
... this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call.
... note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password.
...And 2 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
in order to allow microtasks to be used by third-party libraries, frameworks, and polyfills, the queuemicrotask() method is exposed on the window and worker interfaces through the windoworworkerglobalscope mixin.
...while there have been tricks available that made it possible to enqueue microtasks in the past (such as by creating a promise that resolves immediately), the addition of the queuemicrotask() method adds a standard way to introduce a microtask safely and without tricks.
... simply pass the javascript function to call while the context is handling microtasks into the queuemicrotask() method, which is exposed on the global context as defined by either the window or worker interface, depending on the current execution context.
...And 2 more matches
Headers - Web APIs
WebAPIHeaders
you can add to this using methods like append() (see examples.) in all methods of this interface, header names are matched by case-insensitive byte sequence.
...this affects whether the set(), delete(), and append() methods will mutate the header.
... methods headers.append() appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist.
...And 2 more matches
History.replaceState() - Web APIs
the history.replacestate() method modifies the current history entry, replacing it with the stateobj, title, and url passed in the method parameters.
... this method is particularly useful when you want to update the state object or url of the current history entry in response to some user action.
... syntax history.replacestate(stateobj, title, [url]) parameters stateobj the state object is a javascript object which is associated with the history entry passed to the replacestate method.
...And 2 more matches
History API - Web APIs
it exposes useful methods and properties that let you navigate back and forth through the user's history, and manipulate the contents of the history stack.
... concepts and usage moving backward and forward through the user's history is done using the back(), forward(), and go() methods.
... similarly, you can move forward (as if the user clicked the forward button), like this: window.history.forward() moving to a specific point in history you can use the go() method to load a specific page from session history, identified by its relative position to the current page.
...And 2 more matches
IDBDatabase.createObjectStore() - Web APIs
the createobjectstore() method of the idbdatabase interface creates and returns a new object store or index.
... the method takes the name of the store as well as a parameter object that lets you define important optional properties.
... this method can be called only within a versionchange transaction.
...And 2 more matches
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
the open() method of the idbfactory interface requests opening a connection to a database.
... the method returns an idbopendbrequest object immediately, and performs the open operation asynchronously.
... if the operation is successful, a success event is fired on the request object that is returned from this method, with its result attribute set to the new idbdatabase object for the connection.
...And 2 more matches
IDBObjectStore.get() - Web APIs
the get() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, returns the object store selected by the specified key.
... note: this method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value.
... to tell these situations apart, call the opencursor() method with the same key.
...And 2 more matches
IDBObjectStore.getAll() - Web APIs
the getall() method of the idbobjectstore interface returns an idbrequest object containing all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.
... this method produces the same result for: a record that doesn't exist in the database a record that has an undefined value to tell these situations apart, you either call the opencursor() method with the same key.
... that method provides a cursor if the record exists, and no cursor if it does not.
...And 2 more matches
IDBVersionChangeRequest.setVersion() - Web APIs
the idbversionchangerequest.setversion method updates the version of the database, returning immediately and running a versionchange transaction on the connected database in a separate thread.
... for older webkit browsers, call this method before creating or deleting an object store.
... warning: the latest draft of the specification has dropped this method.
...And 2 more matches
KeyboardEvent.initKeyEvent() - Web APIs
the keyboardevent.initkeyevent() method is used to initialize the value of an event created using document.createevent("keyboardevent").
... events initialized in this way must have been created with the document.createevent("keyboardevent") method.
... do not use this method anymore, use the keyboardevent() constructor instead.
...And 2 more matches
MediaRecorder - Web APIs
methods mediarecorder.pause() pauses the recording of media.
...after calling this method, recording continues, but in a new blob.
... mediarecorder.start() begins recording media; this method can optionally be passed a timeslice argument with a value in milliseconds.
...And 2 more matches
Media Capabilities API - Web APIs
to test support, smoothness and power efficiency of a video or audio file, you define the media configuration you want to test, and then pass the audio or video configuration as the parameter of the mediacapabilities interface's encodinginfo() and decodinginfo() methods.
... mediacapabilitiesinfo the interface of the promise returned by the mediacapabilities's encodinginfo() and decodinginfo() methods; returning whether the media configuration tested is supported, smooth, and powerefficient.
... media capabilities dictionaries mediaconfiguration describes how video and audio configuration dictionaries must be configured, or defined, to be passed as a parameter of the mediacapabilities.encodinginfo() and mediacapabilities.decodinginfo() methods.
...And 2 more matches
MouseEvent - Web APIs
though the mouseevent.initmouseevent() method is kept for backward compatibility, creating of a mouseevent object should be done using the mouseevent() constructor.
... mouseevent.y read only alias for mouseevent.clienty constants mouseevent.webkit_force_at_mouse_down read only minimum force necessary for a normal click mouseevent.webkit_force_at_force_mouse_down read only minimum force necessary for a force click methods this interface also inherits methods of its parents, uievent and event.
...if the event has already being dispatched, this method does nothing.
...And 2 more matches
Using the Notifications API - Web APIs
getting permission if permission to display notifications hasn't been granted yet, the application needs to use the notification.requestpermission() method to request this from the user.
... in its simplest form, we just include the following: notification.requestpermission().then(function(result) { console.log(result); }); this uses the promise-based version of the method.
...we did this using the following: function checknotificationpromise() { try { notification.requestpermission().then(); } catch(e) { return false; } return true; } we basically try to see if the .then() method is available on requestpermission().
...And 2 more matches
PaymentRequest: merchantvalidation event - Web APIs
it uses the fetch() to send a request to its own server with an argument of the payment method's validation url, obtained from the event's validationurl property.
... the merchant server should access the validation url in accordance with the payment method documention.
... const merchantserverurl = window.location.origin + '/validate?url=' + encodeuricomponent(event.validationurl); // get validation data, and complete validation; return await fetch(merchantserverurl).then(response => response.text()); }, false); }; const response = await request.show(); how merchant server handles the validation depends on the server implementation and payment method documentation.
...And 2 more matches
Payment Request API - Web APIs
paymentmethodchangeevent represents the user changing payment instrument (e.g., switching from a credit card to debit card).
... paymentresponse an object returned after the user selects a payment method and approves a payment request.
... related dictionaries for the basic card specification basiccardchangedetails an object providing redacted address information that is provided as the methoddetails on the paymentmethodchange event sent to the paymentrequest when the user changes payment information.
...And 2 more matches
PerformanceEntry.toJSON() - Web APIs
the tojson() method is a serializer; it returns a json representation of the performance entry object.
... example the following example shows the use of the tojson() method.
...performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + propert...
...And 2 more matches
ReadableStream.pipeThrough() - Web APIs
the pipethrough() method of the readablestream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
...the method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error.
...the method will return a promise rejected with the source’s error, or with any error that occurs during aborting the destination.
...And 2 more matches
ReadableStream.pipeTo() - Web APIs
the pipeto() method of the readablestream interface pipes the current readablestream to a given writablestream and returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
...the method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error.
...the method will return a promise rejected with the source’s error, or with any error that occurs during aborting the destination.
...And 2 more matches
Request - Web APIs
WebAPIRequest
request.method read only contains the request's method (get, post, etc.) request.mode read only contains the mode of the request (e.g., cors, no-cors, same-origin, navigate.) request.redirect read only contains the mode for how redirects are handled.
... methods request.clone() creates a copy of the current request object.
... request implements body, so it also has the following methods available to it: body.arraybuffer() returns a promise that resolves with an arraybuffer representation of the request body.
...And 2 more matches
SVGPathElement - Web APIs
"65" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-29" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: in svg 2 the getpathsegatlength() and createsvgpathseg* methods were removed and the pathlength property and the gettotallength() and getpointatlength() methods were moved to svggeometryelement.
... methods this interface also inherits methods from its parent, svggeometryelement.
... note: in svg 2 this method was moved to the svggeometryelement interface, from which this interface inherits it.
...And 2 more matches
Storage API - Web APIs
one of the most likely methods—one which the specification specifically encourages, in fact—would be to consider the popularity and/or usage levels of individual sites to determine what their quotas should be.
... data persistence and clearing if the site or app has the "persistent-storage" feature permission, it can use the storagemanager.persist() method to request that its box be made persistent.
... de-duplication, compression, and other methods to reduce the physical size of the stored data may be used.
...And 2 more matches
SubtleCrypto.wrapKey() - Web APIs
the wrapkey() method of the subtlecrypto interface "wraps" a key.
... let salt; /* get some key material to use as input to the derivekey method.
... let salt; let iv; /* get some key material to use as input to the derivekey method.
...And 2 more matches
UIEvent.initUIEvent() - Web APIs
the uievent.inituievent() method initializes a ui event once it's been created.
... events initialized in this way must have been created with the document.createevent() method.
... this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
...And 2 more matches
Geometry and reference spaces in WebXR - Web APIs
the primary reference space types the viewer reference space corresponds to the viewer's position in space; it's used by the xrviewerpose returned by the xrframe method getviewerpose().
... establishing the reference space the topmost space—the one obtained by calling the xrsession method requestreferencespace()—describes the coordinate system used for the overall world space.
...create an xrrigidtransform object representing the new position and orientation of the player's avatar, then create a new reference space to represent the avatar's point of view at the new position using the xrreferencespace method getoffsetreferencespace().
...And 2 more matches
Example and tutorial: Simple synth keyboard - Web APIs
= audiocontext.createoscillator(); osc.connect(mastergainnode); let type = wavepicker.options[wavepicker.selectedindex].value; if (type == "custom") { osc.setperiodicwave(customwaveform); } else { osc.type = type; } osc.frequency.value = freq; osc.start(); return osc; } playtone() begins by creating a new oscillatornode by calling the audiocontext.createoscillator() method.
... we then connect it to the master gain node by calling the new oscillator's oscillatornode.connect() method;, which tells the oscillator where to send its output to.
...then, at last, the oscillator is started up so that it begins to produce sound by calling the oscillator's inherited audioscheduledsourcenode.start() method.
...And 2 more matches
Web Authentication API - Web APIs
this resolves significant security problems related to phishing, data breaches, and attacks against sms texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords).
...similar to the other forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: navigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account.
... in order to understand how the create() and get() methods fit into the bigger picture, it is important to understand that they sit between two components that are outside the browser: server - the web authentication api is intended to register new credentials on a server (also referred to as a service or a relying party) and later use those same credentials on that same server to authenticate a user.
...And 2 more matches
Functions and classes available to Web Workers - Web APIs
by default, methods and properties of window are not available to them, but dedicatedworkerglobalscope, like window, implements windowtimers and windowbase64.
... comparison of the properties and methods of the different type of workers function dedicated workers shared workers service workers chrome workers outside workers atob() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window btoa() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window clearinterval() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window cleartimeout() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on wind...
... 8 (8) no support no support no support formdata formdata objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttprequest send() method.
...And 2 more matches
Window.getSelection() - Web APIs
the window.getselection() method returns a selection object representing the range of text selected by the user or the current position of the caret.
... examples function foo() { var selobj = window.getselection(); alert(selobj); var selrange = selobj.getrangeat(0); // do stuff with the range } notes string representation of the selection object in javascript, when an object is passed to a function expecting a string (like window.alert() or document.write()), the object's tostring() method is called and the returned value is passed to the function.
... this can make the object appear to be a string when used with other functions when it is really an object with properties and methods.
...And 2 more matches
Window.requestAnimationFrame() - Web APIs
the window.requestanimationframe() method tells the browser that you wish to perform an animation and requests that the browser calls a specified function to update an animation before the next repaint.
... the method takes a callback as an argument to be invoked before the repaint.
... you should call this method whenever you're ready to update your animation onscreen.
...And 2 more matches
XDomainRequest - Web APIs
methods xdomainrequest.open() opens the request, specifing the method (get/post) and url.
...post data is specified in this method.
... event handlers xdomainrequest.onprogress a handler for when the request has made progress between the send method call and the onload event.
...And 2 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
in this guide we will take a look at some of the common use cases for flexbox — those places where it makes more sense than another layout method.
...you can read more about the difference between flexbox and css grid layout in relationship of flexbox to other layout methods, where we discuss how flexbox fits into the overall picture of css layout.
...we either display the space outside of the items — therefore spacing them out with white space between or around them — or we absorb the extra space inside the items and therefore need a method of allowing the items to grow and take up this space.
...And 2 more matches
Grid template areas - CSS: Cascading Style Sheets
however, there is an alternate method to use for positioning items on the grid which you can use alone or in combination with line-based placement.
... this method involves placing our items using named template areas, and we will find out exactly how this method works.
... you will see very quickly why we sometimes call this the ascii-art method of grid layout!
...And 2 more matches
HTML attribute reference - HTML: Hypertext Markup Language
decoding <img> indicates the preferred method to decode the image.
... enctype <form> defines the content type of the form data when the method is post.
... formmethod <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the submission method to use during form submission (get, post, etc.).
...And 2 more matches
307 Temporary Redirect - HTTP
WebHTTPStatus307
the method and the body of the original request are reused to perform the redirected request.
... in the cases where you want the method used to be changed to get, use 303 see other instead.
... this is useful when you want to give an answer to a put method that is not the uploaded resources, but a confirmation message (like "you successfully uploaded xyz").
...And 2 more matches
Text formatting - JavaScript
const foo = new string('foo'); // creates a string object console.log(foo); // displays: [string: 'foo'] typeof foo; // returns 'object' you can call any of the methods of the string object on a string literal value—javascript automatically converts the string literal to a temporary string object, calls the method, then discards the temporary string object.
... a string object has a variety of methods: for example those that return a variation on the string itself, such as substring and touppercase.
... the following table summarizes the methods of string objects.
...And 2 more matches
Arrow function expressions - JavaScript
arrow function expressions are ill suited as methods, and they cannot be used as constructors.
... the base object if the function was called as an "object method".
... https://www.ecma-international.org/ecma-262/10.0/index.html#sec-strict-mode-code https://www.ecma-international.org/ecma-262/10.0/index.html#sec-arrow-function-definitions-runtime-semantics-evaluation correction: end invoked through call or apply since arrow functions do not have their own this, the methods call() and apply() can only pass in parameters.
...And 2 more matches
Array.prototype.find() - JavaScript
the find() method returns the value of the first element in the provided array that satisfies the provided testing function.
... description the find method executes the callback function once for each index of the array until the callback returns a truthy value.
...this means it may be less efficient for sparse arrays, compared to methods that only visit assigned values.
...And 2 more matches
Array.prototype.findIndex() - JavaScript
the findindex() method returns the index of the first element in the array that satisfies the provided testing function.
... see also the find() method, which returns the value of an array element, instead of its index.
... description the findindex() method executes the callback function once for every index in the array until it finds the one where callback returns a truthy value.
...And 2 more matches
Array.from() - JavaScript
the array.from() static method creates a new, shallow-copied array instance from an array-like or iterable object.
... the length property of the from() method is 1.
...as a result, static methods such as array.from() are "inherited" by subclasses of array, and create new instances of the subclass, not array.
...And 2 more matches
Array.prototype.shift() - JavaScript
the shift() method removes the first element from an array and returns that removed element.
... this method changes the length of the array.
... description the shift method removes the element at the zeroeth index and shifts the values at consecutive indexes down, then returns the removed value.
...And 2 more matches
Array.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified array and its elements.
... description the array object overrides the tostring method of object.
... for array objects, the tostring method joins the array and returns one string containing each array element separated by commas.
...And 2 more matches
Boolean.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified boolean object.
... description the boolean object overrides the tostring method of the object object; it does not inherit object.prototype.tostring().
... for boolean objects, the tostring method returns a string representation of the object.
...And 2 more matches
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
the intl.datetimeformat.prototype.formattoparts() method allows locale-aware formatting of strings produced by datetimeformat formatters.
... description the formattoparts() method is useful for custom formatting of date strings.
...the structure the formattoparts() method returns, looks like this: [ { type: 'day', value: '17' }, { type: 'weekday', value: 'monday' } ] possible types are the following: day the string used for the day, for example "17".
...And 2 more matches
Intl.NumberFormat.prototype.formatToParts() - JavaScript
the intl.numberformat.prototype.formattoparts() method allows locale-aware formatting of strings produced by numberformat formatters.
... description the formattoparts() method is useful for custom formatting of number strings.
...the structure the formattoparts() method returns, looks like this: [ { type: "integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" } ] possible types are the following: currency the currency string, such as the symbols "$" and "€" or the name "dollar", "euro" depending on how currencydisplay is specified.
...And 2 more matches
Object.getOwnPropertyNames() - JavaScript
the object.getownpropertynames() method returns an array of all properties (including non-enumerable properties except for those which use symbol) found directly in a given object.
... in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
... object.getownpropertynames('foo'); // typeerror: "foo" is not an object (es5 code) object.getownpropertynames('foo'); // ["0", "1", "2", "length"] (es2015 code) examples using object.getownpropertynames() var arr = ['a', 'b', 'c']; console.log(object.getownpropertynames(arr).sort()); // .sort() is an array method.
...And 2 more matches
Object.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... description the tosource() method returns the following values: for the built-in object object, tosource() returns the following string indicating that the source code is not available: function object() { [native code] } for instances of object, tosource() returns a string representing the source code.
... overriding the tosource() method it is safe for objects to override the tosource() method.
...And 2 more matches
Promise.prototype.catch() - JavaScript
the catch() method returns a promise and deals with rejected cases only.
... return originalcatch.apply(this, arguments); }; })(this.promise); // calling catch on an already resolved promise promise.resolve().catch(function xxx(){}); // logs: // > > > > > > called .catch on promise{} with arguments: arguments{1} [0: function xxx()] // > > > > > > called .then on promise{} with arguments: arguments{2} [0: undefined, 1: function xxx()] description the catch method is used for error handling in promise composition.
... since it returns a promise, it can be chained in the same way as its sister method, then().
...And 2 more matches
handler.construct() - JavaScript
the handler.construct() method is a trap for the new operator.
... in order for the new operation to be valid on the resulting proxy object, the target used to initialize the proxy must itself have a [[construct]] internal method (i.e.
... syntax const p = new proxy(target, { construct: function(target, argumentslist, newtarget) { } }); parameters the following parameters are passed to the construct() method.
...And 2 more matches
handler.getPrototypeOf() - JavaScript
the handler.getprototypeof() method is a trap for the [[getprototypeof]] internal method.
... } }); parameters the following parameter is passed to the getprototypeof() method.
... return value the getprototypeof() method must return an object or null.
...And 2 more matches
handler.set() - JavaScript
the handler.set() method is a trap for setting a property value.
... syntax const p = new proxy(target, { set: function(target, property, value, receiver) { } }); parameters the following parameters are passed to the set() method.
... return value the set() method should return a boolean value.
...And 2 more matches
handler.setPrototypeOf() - JavaScript
the handler.setprototypeof() method is a trap for object.setprototypeof().
... syntax const p = new proxy(target, { setprototypeof: function(target, prototype) { } }); parameters the following parameters are passed to the setprototypeof() method.
... return value the setprototypeof() method returns true if the [[prototype]] was successfully changed, otherwise false.
...And 2 more matches
RegExp.prototype[@@match]() - JavaScript
the [@@match]() method retrieves the matches when matching a string against a regular expression.
... description this method is called internally in string.prototype.match().
... 'abc'.match(/a/); /a/[symbol.match]('abc'); this method exists for customizing match behavior within regexp subclasses.
...And 2 more matches
RegExp.prototype[@@matchAll]() - JavaScript
the [@@matchall] method returns all matches of the regular expression against a string.
... description this method is called internally in string.prototype.matchall().
... 'abc'.matchall(/a/); /a/[symbol.matchall]('abc'); this method exists for customizing the behavior of matchall() in regexp subclasses.
...And 2 more matches
RegExp.prototype[@@search]() - JavaScript
the [@@search]() method executes a search for a match between a this regular expression and a string.
... description this method is called internally in string.prototype.search().
... 'abc'.search(/a/); /a/[symbol.search]('abc'); this method exists for customizing the search behavior in regexp subclasses.
...And 2 more matches
RegExp.prototype.exec() - JavaScript
the exec() method executes a search for a match in a specified string.
... if you are executing a match simply to find true or false, use regexp.prototype.test() method or string.prototype.search() instead.
... return value if the match succeeds, the exec() method returns an array (with extra properties index and input; see below) and updates the lastindex property of the regular expression object.
...And 2 more matches
String.prototype.anchor() - JavaScript
the anchor() method creates a string beginning with an <a name="..."> start tag, then some text, and then an </a> end tag.
... don't use this method.
...also, the html specification no longer allows the <a> element to have a name attribute, so this method doesn't even create valid markup.
...And 2 more matches
String.prototype.includes() - JavaScript
the includes() method determines whether one string may be found within another string, returning true or false as appropriate.
... description this method lets you determine whether or not a string includes another string.
... case-sensitivity the includes() method is case sensitive.
...And 2 more matches
String.prototype.indexOf() - JavaScript
the indexof() method returns the index within the calling string object of the first occurrence of the specified value, starting the search at fromindex.
... note: for the array method, see array.prototype.indexof().
...'blue whale'.indexof('blute') // returns -1 'blue whale'.indexof('whale', 0) // returns 5 'blue whale'.indexof('whale', 5) // returns 5 'blue whale'.indexof('whale', 7) // returns -1 'blue whale'.indexof('') // returns 0 'blue whale'.indexof('', 9) // returns 9 'blue whale'.indexof('', 10) // returns 10 'blue whale'.indexof('', 11) // returns 10 the indexof() method is case sensitive.
...And 2 more matches
TypedArray - JavaScript
on the following pages you will find common properties and methods that can be used with any typed array containing elements of any type.
... the buffer address is saved as an internal property of the instance and all the methods of %typedarray%.prototype, i.e.
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
...And 2 more matches
Object initializer - JavaScript
// shorthand property names (es2015) let a = 'foo', b = 42, c = {}; let o = {a, b, c} // shorthand method names (es2015) let o = { property(parameters) {} } // computed property names (es2015) let prop = 'foo' let o = { [prop]: 'hey', ['b' + 'ar']: 'there' } description an object initializer is an expression that describes the initialization of an object.
... a function value (see "methods" above) can not be assigned to a value in json.
... function havees2015duplicatepropertysemantics() { 'use strict'; try { ({prop: 1, prop: 2}); // no error thrown, duplicate property names allowed in strict mode return true; } catch(e) { // error thrown, duplicates prohibited in strict mode return false; } } method definitions a property of an object can also refer to a function or a getter or setter method.
...And 2 more matches
Optional chaining (?.) - JavaScript
undefined : temp.second); optional chaining with function calls you can use optional chaining when attempting to call a method which may not exist.
... this can be helpful, for example, when using an api in which a method might be unavailable, either due to the age of the implementation or because of a feature which isn't available on the user's device.
... using optional chaining with function calls causes the expression to automatically return undefined instead of throwing an exception if the method isn't found: let result = someinterface.custommethod?.(); note: if there is a property with such a name and which is not a function, using ?.
...And 2 more matches
yield - JavaScript
rv optional retrieves the optional value passed to the generator's next() method to resume its execution.
... the yield keyword causes the call to the generator's next() method to return an iteratorresult object with two properties: value and done.
... once paused on a yield expression, the generator's code execution remains paused until the generator's next() method is called.
...And 2 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.
...11/feature#pattern http://www.w3.org/tr/svg11/feature#clip http://www.w3.org/tr/svg11/feature#mask http://www.w3.org/tr/svg11/feature#filter http://www.w3.org/tr/svg11/feature#xlinkattribute http://www.w3.org/tr/svg11/feature#font http://www.w3.org/tr/svg11/feature#extensibility http://www.w3.org/tr/svg11/feature#svgdom-static the browser supports all of the dom interfaces and methods that correspond to the language features for http://www.w3.org/tr/svg11/feature#svg-static.
...And 2 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
140 method experimental, needsexample, svg, svg attribute the method attribute indicates the method by which text should be rendered along the path of a <textpath> element.
... 172 refx needsbrowsercompatibility, needsexample the refx attribute indicates the method by which text should be rendered along the path of a <textpath> element.
... 191 spreadmethod svg, svg attribute the spreadmethod attribute determines how a shape is filled beyond the defined edges of a gradient.
...And 2 more matches
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
one can override default browser behaviors with the evt.preventdefault( ) method, add eventlisteners to objects with the syntax element.addeventlistener(event, function, usecapture), and set element properties with syntax svgelement.style.setproperty("fill-opacity", "0.0", "").
...the evt.preventdefault() method lets you do this.
... using eventlisteners with objects the methods addeventlistener() and removeeventlistener() are very useful when writing interactive svg.
...And 2 more matches
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
to function correctly in netscape, this element, with the method attribute, must be used.
... as of 7.0, method="text" works as expected.
... syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-type=string /> required attributes none.
...And 2 more matches
Working with Events - Archive of obsolete content
adding listeners you can add a listener to an event emitter by calling its on(type, listener) method.
...then in the constructor you can assign a listener function to this property as an alternative to calling the object's on() method.
...the listener loads https://developer.mozilla.org/: require("sdk/ui/button/action").actionbutton({ id: "visit-mozilla", label: "visit mozilla", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").open("https://developer.mozilla.org/"); } }); this is exactly equivalent to constructing the button and then calling the button's on() method: var button = require("sdk/ui/button/action").actionbutton({ id: "visit-mozilla", label: "visit mozilla", icon: "./icon-16.png" }); button.on("click", function() { require("sdk/tabs").open("https://developer.mozilla.org/"); }); removing event listeners event listeners can be removed by calling removelistener(type, listener), supplying the type of event and the listener to remove.
... the listener must have been previously been added using one of the methods described above.
page-worker - Archive of obsolete content
to do this, save the file in your add-on's data directory and create the url using the data.url() method of the self module: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: require("sdk/self").data.url("myfile.html") }); from firefox 34, you can use "./myfile.html" as an alias for self.data.url("myfile.html").
...you construct the url using the data.url() method of the self module.
... the page worker is loaded as soon as the page object is created and stays loaded until its destroy method is called or the add-on is unloaded.
... methods destroy() unloads the page worker.
widget - Archive of obsolete content
just save the file in your add-on's data directory, and reference it using the data.url() method of the self module: var data = require("sdk/self").data; require("sdk/widget").widget({ id: "my-widget", label: "my widget", contenturl: data.url("my-content.html") }); this widget contains an entire web page: require("sdk/widget").widget({ id: "hello-display", label: "my hello widget", content: "hello!", width: 50 }); widgets are quite small by default, so this example used th...
... methods destroy() removes the widget from the add-on bar.
... this class has all the same methods, attributes and events as the widget class except for the getview method and the attach event.
..."secured" : "unsafe"; } tabs.on('ready', updatewidgetstate); tabs.on('activate', updatewidgetstate); methods destroy() removes the widget view from the add-on bar.
platform/xpcom - Archive of obsolete content
r with its contract id: var { factory } = require('sdk/platform/xpcom'); var { cc, ci } = require('chrome'); var contractid = '@me.org/request' // create and register the factory var factory = factory({ contract: contractid, component: request }); now xpcom users can access our implementation in the normal way: var request = cc[contractid].createinstance(ci.nsirequest); request.resume(); methods queryinterface(interface) this method is called automatically by xpcom, so usually you don't need to call it yourself.
... methods createinstance(outer, iid) creates an instance of the component associated with this factory.
...the methods of this interface will be callable on the returned object.
... lockfactory() this method is required by the nsifactory interface, but as in most implementations it does nothing interesting.
Bootstrapped extensions - Archive of obsolete content
oldversion string the previously installed version, if the reason is addon_upgrade or addon_downgrade, and the method is install or startup.
... newversion string the version to be installed, if the reason is addon_upgrade or addon_downgrade, and the method is shutdown or uninstall.
... note: an add-on may be upgraded/downgraded at application startup, in this case the startup method reason is app_startup, and the oldversion property is not set.
... also be aware that in some circumstances an add-on upgrade/downgrade may occur without the uninstall method being called.
File I/O - Archive of obsolete content
an exception is thrown only when methods that require the file to exist are called, e.g., isdirectory(), moveto(), and so on.
...you can tell files from folders by calling nsifile.isdirectory() and nsifile.isfile() methods on each entry.
... createinstance(components.interfaces.nsifileoutputstream); stream.init(afile, 0x04 | 0x08 | 0x20, 0600, 0); // readwrite, create, truncate stream.write(pngbinary, pngbinary.length); if (stream instanceof components.interfaces.nsisafeoutputstream) { stream.finish(); } else { stream.close(); } more there are more methods and properties on nsifile and nsilocalfile interfaces; please refer to their documentation for more details.
... those methods/properties are mostly self-explanatory, so we haven't included examples of using them here.
Post data to window - Archive of obsolete content
preprocessing post data the apostdata argument of the (global) loaduri(), opendialog(), and (tab)browser.loaduriwithflags() methods expects the post data in the form of an nsiinputstream (because they eventually call nsiwebnavigation.loaduri()) while post data can be created using nsimimeinputstream.
... most of the time, post data starts as a data string in the form of "name1=data1&name2=data2&...", so you must convert it before passing the data to one of the methods.
... here is an example: var datastring = "name1=data1&name2=data2"; // post method requests must wrap the encoded text in a mime // stream const cc = components.classes; const ci = components.interfaces; var stringstream = cc["@mozilla.org/io/string-input-stream;1"].
... posting data to the current tab there is a convenience method in global scope (in firefox, chrome://browser/content/browser.js): loaduri(auri, areferrer, apostdata, aallowthirdpartyfixup); posting data to a new window window.opendialog('chrome://browser/content', '_blank', 'all,dialog=no', auri, aflags, areferrer, apostdata); ...
Common Pitfalls - Archive of obsolete content
how to create a uri object in almost all cases, when creating a uri object you want to use the newuri method on the nsiioservice interface, like so: javascript: try { var ioserv = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uriobj = ioserv.newuri(uristring, uricharset, baseuri); } catch (e) { // may want to catch ns_error_malformed_uri for some applications } c++: nsresult rv; nscomptr<nsiioservice> ioserv...
...the one exception to all of the above, that is the one case in which creating a specific uri class via createinstance is acceptable, is when one is implementing a protocol handler's newuri method.
... in that case you may not be able to use the i/o service because that service calls the newuri method on the appropriate protocol handler, which may be your own handler.
...those methods should be removed.
Hiding browser chrome - Archive of obsolete content
this can be accomplished by augmenting the behavior of the xulbrowserwindow object's hidechromeforlocation() method.
... note: don't simply replace the hidechromeforlocation() method; this will likely hurt the functionality of firefox itself as well as other extensions.
...var prevfunc = xulbrowserwindow.hidechromeforlocation; xulbrowserwindow.hidechromeforlocation = function(alocation) { return (/* your test goes here */) || prevfunc.apply(xulbrowserwindow, [alocation]); } this works by saving a reference to the current implementation of the hidechromeforlocation() method, then replacing it with a new method that calls through to the previous implementation.
... by chaining multiple implementations of the method together in this way, everyone that wants to hide chrome can do so when appropriate.
Adding Events and Commands - Archive of obsolete content
another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and behavior.
... also, note that the addeventlistener method receives the event name without the "on" prefix, while element attributes do have the prefix.
...the advantage of using the event argument is that the method is not dependent of the specific button, so it can also be used for other elements.
...the addeventlistener method allows you to control the phase where you want to handle an event, with the last argument of the function.
JavaScript Object Management - Archive of obsolete content
for instance, you could replace a method in any object in the firefox chrome, so that it behaves differently than how it normally does.
...this is all necessary due to a javascript feature (quirk would be a better word for it) called method binding.
... use "_" at the beginning of private attributes and methods in js objects.
... */ 〈modulenamespace〉.user = function(aname, aurl) { this._name = aname; this._url = aurl; }; /** * user class methods.
Using microformats - Archive of obsolete content
to use the api, you need to first load the object: components.utils.import("resource://gre/modules/microformats.js"); once you've loaded the microformats api, you can manage microformats using the methods listed here; for information about parsing microformats, see parsing microformats in javascript.
... methods add() adds a new microformat to the microformat module.
... note: you can simply call debug() on a microformat object: microformatobject.debug() instead of using this method if you prefer.
... note: this method doesnot return true if the node is a child of a microformat.
generateCRMFRequest() - Archive of obsolete content
crmfobject = crypto.generatecrmfrequest("requesteddn", "regtoken", "authenticator", "escrowauthoritycert", "crmf generation done code", keysize1, "keyparams1", "keygenalg1", ..., keysizen, "keyparamsn", "keygenalgn"); this method will generate a sequence of crmf requests that has n requests.
...after the "escrowauthoritycert" parameter, the method takes some javascript code that is invoked when the crmf request is ready.
...(this will have digitalsignature and nonrepudiation set for keyusage.) "dh-ex" "ec-ex" "ec-dual-use" "ec-sign" "ec-sign-nonrepudiation" "ec-nonrepudiation" the generatecrmfrequest() method will cause the user to be presented with a key generation dialog.
...the method generatecrmfrequest() will return an instance of a crmf request object.
Simple Storage - Archive of obsolete content
don't abuse these methods, since they cause firefox -- all of firefox -- to drop what it's doing to make a trip to the disk.
...the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("storage.simple"); methods sync()as described above, the jetpack.storage.simple object is automatically written to disk, but a feature may force flush by calling jetpack.storage.simple.sync().
... don't abuse this method.
...don't abuse this method.
Clipboard - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
... this is the recommended method of copying data to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...string here's an example of how to use the method to get the data on the clipboard.
Clipboard - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
... this is the recommended method of copying data to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...string here's an example of how to use the method to get the data on the clipboard.
Simple Storage - Archive of obsolete content
don't abuse these methods, since they cause firefox -- all of firefox -- to drop what it's doing to make a trip to the disk.
...the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("storage.simple"); methods sync()as described above, the jetpack.storage.simple object is automatically written to disk, but a feature may force flush by calling jetpack.storage.simple.sync().
... don't abuse this method.
...don't abuse this method.
Clipboard - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
... this is the recommended method of copying data to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...string here's an example of how to use the method to get the data on the clipboard.
RDF Datasource How-To - Archive of obsolete content
if you take this approach, you won't be able to selectively implement methods of the nsirdfdatasource interface; instead, all of the methods will be "forwarded" to the in-memory datasource.
...if you choose this route, you'll need to implement each of the nsirdfdatastore methods "by hand".
... [more info on what each method needs to do here] rdf commands [describe what commands are, and why you'd implement them.] registering the datasource component a datasource is an xpcom component.
...registering an rdf datasource is fairly simple: in the dll's nsregisterself() method, you simply call the component manager's registercomponent() method: extern "c" pr_implement(nsresult) nsregisterself(nsisupports* aservicemanager, const char* apath) { nsresult rv; ...
open - Archive of obsolete content
syntax open(mode,type) parameters mode a comma-delimited list describing the method to use to open the file, described in detail here.
... description this method opens the file, preparing its resources for use by subsequent methods to examine or modify the file.
... certain methods of file, such as read and write should not be used when the file is not open.
... other methods, such as remove may not be used when the file is open.
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.
...scripts that invoke this method should not assume that the binding is installed immediately after this method returns.
... the methods and properties of the binding are installed on the element and become available to scripts that reference the bound element.
... methods and properties with getters/setters are no longer accessible from the binding, although properties with raw values remain.
dirCreate - Archive of obsolete content
method of file object syntax int dircreate( filespecobject dirtocreate ); parameters the dircreate method has the following parameters: dirtocreate a filespecobject representing the pathname of the directory to create.
...description the input parameter is a filespecobject that you have already created with the install object's getfolder method.
... the following simple example demonstrates the use of the dircreate method.
... note that the getfolder method does not require that the folder or directory you specify exist in order for the object reference to be a valid one.
confirm - Archive of obsolete content
method of install object syntax int confirm( string atext ); int confirm( string atext, string adialogtitle, number abuttonflags, string abutton0title, string abutton1title, string abutton2title, string acheckmsg, object acheckstate ); parameters the second, extended confirm() method is supported starting with gecko 1.8.
...previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form.
...notes the preferred method for detecting support for custom dialog boxes is querying the existence of the button constants.
...if ("button_pos_0" in install) { // use extended confirm() method } else { // use classic confirm() method } ...
deleteRegisteredFile - Archive of obsolete content
deleteregisteredfile (netscape 6 and mozilla do not currently support this method.) deletes the specified file and removes its entry from the client version registry.
... method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted.
...description the deleteregisteredfile method deletes the specified file and removes the file's entry from the client version registry.
...this method is used to delete files that cannot be removed by the uninstall method or to remove files that are no longer necessary or whose names have changed.
getLastError - Archive of obsolete content
method of install object syntax int getlasterror (); parameters none.
...description use getlasterror method to obtain the most recent nonzero error code since initinstall or reseterror were called.
... this method allows you to defer checking for error codes each time you call addfile or adddirectory until the last addfile or adddirectory call.
... the getlasterror method does not return errors from methods that return objects, such as getfolder.
getWinRegistry - Archive of obsolete content
method of install syntax winreg getwinregistry(); parameters none.
...description use the getwinregistry method to create an object for manipulating the contents of the windows registry.
... once you have this object, you can call its methods to retrieve or change the registry's content.
...this method returns null on unix and macintosh platforms.
setValueNumber - Archive of obsolete content
method of winreg object syntax int setvaluenumber ( string subkey, string valname, number value ); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
... description the setvaluenumber method sets the value of a key when that value is a number.
... use this method if the value you want to set is a number.
... if the value is not a number, use the setvalue or setvaluestring methods instead.
setValueString - Archive of obsolete content
method of winreg object syntax int setvaluestring ( string subkey, string valname, string value); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...description the setvaluestring method sets the value of a key when that value is a string.
... use this method if the value you want to set is a string.
... if the value is not a string, use the setvalue method instead.
WinReg Object - Archive of obsolete content
instead, you construct an instance of this object by calling the getwinregistry method of the install object.
...to use a different root key, use the setrootkey method.
...to manipulate such values, use the getvaluestring and setvaluestring methods.
... to manipulate other values, use the getvalue and setvalue methods.
onpopuphidden - Archive of obsolete content
example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <menuitem label="item 1"/> <menuitem label="item 2"/> <menu id="submenu1" label="submenu 1"> <menupopup id="submenu1-popup"> <menuitem label="submenu1 item 1"/> <menuitem label="submenu1 item 2"/> </menupopup> </menu> <menu id="submenu2" label="submenu 1"> <menupopup id="submenu2-popup"> <menuitem label="submenu2 item 1"/> <menuitem label="submenu2 i...
...tem 2"/> </menupopup> </menu> <menupopup/> with the above structure, the onpopuphidden method of <menupopup id="top"> will be called every time either <menupopup id="submenu1-popup"> or <menupopup id="submenu2-popup"> are hidden.
... this results in the method repeatedly called as the user runs the mouse up and down the menu opening the sub-menus.
... you can test for the current popup actually being hidden with: <menupopup id="top" onpopuphidden="if(this.state != 'open'){console.log('the onpopuphidden method of id=top was called.');};" > ...
Working With Directories - Archive of obsolete content
this method returns true if a file object returned by nsiscriptableio.getfile() refers to a directory, and false otherwise.
... there is also a corresponding nsifile.isfile() method to check if an object refers to a file.
... in both cases, the method fails if the file or directory does not exist, so you should check first using nsifile.exists().
...for directories, the first argument to this method should be the constant directory_type (which has a value of 1).
Moving, Copying and Deleting Files - Archive of obsolete content
there are several methods of the nsifile object which may be used to move and copy files on disk.
...this method takes two arguments, the first is the destination directory in which to copy the file to, and the second argument is the new name of the file, if you wish to rename it in its new location.
...this method is used to navigate into subdirectories.
...this method takes one boolean argument which indicates whether to delete recursively or not.
MoveResize - Archive of obsolete content
moving and resizing a popup menus and popups have methods which may be used to move and resize them.
... moving a popup once a popup is open, it can be moved using the popup's moveto method.
...this method will change the left and top attributes to match the supplied arguments, so if these attributes are persisted the values will be restored when the window is displayed again.
... a popup can be resized manually using the popup's sizeto method.
Panels - Archive of obsolete content
opening a panel with script the panel, like all popups, has an openpopup method which may be used to open the popup using a script.
... for example, the following would open a panel underneath a button: panel.openpopup(button, "after_start", 0, 0, false, false); likewise, the openpopupatscreen method will open a panel at a specific screen position.
... for more details about both methods, see opening and closing popups.
...this function retrieves the popup and calls the hidepopup method.
Install Scripts - Archive of obsolete content
that means that you can call the methods of the window object with the qualifier before it, which means that window.open() can simply be written open().
... the simple method assigns an install directory and installs all files into it.
... the second method allows you to assign a destination on a per-file (or directory) basis.
... the first method is described below.
More Wizards - Archive of obsolete content
then, to navigate to a page, use one of two methods: set the next attribute on each page to the page id of the next page to go to.
... call the wizard's goto() method.
...you might call this method in the onpageadvanced or onwizardnext handlers.
...note that the goto() method, because it causes a page change, will fire the events again, so you'll have to make sure you handle that case.
XPCOM Interfaces - Archive of obsolete content
mozilla provides such a method which involves using xpcom (cross-platform component object model).
...the table below shows some of the properties and methods of the nsilocalfile interface.
... initwithpath this method is used to initialize the path and filename for the nsilocalfile.
...we can call the method initwithpath() to indicate which file we mean.
arrowscrollbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a box which provides scroll arrows along its edges for scrolling through the contents of the box.
... attributes clicktoscroll, disabled, smoothscroll, tabindex properties disabled, scrollboxobject, scrollincrement, smoothscroll, tabindex methods ensureelementisvisible, scrollbyindex, scrollbypixels examples <arrowscrollbox orient="vertical" flex="1"> <button label="red"/> <button label="blue"/> <button label="green"/> <button label="yellow"/> <button label="orange"/> <button label="silver"/> <button label="lavender"/> <button label="gold"/> <button label="turquoise"/> <button label="peach"/> <button label="ma...
... methods ensureelementisvisible( element ) return type: no return value if the specified element is not currently visible to the user, the displayed items are scrolled so that it is.
... inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattr...
preference - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] declares a preference that may be adjusted in a prefpane.
... attributes disabled, instantapply, inverted, name, onchange, readonly, tabindex, type properties defaultvalue, disabled, hasuservalue, inverted, locked, name, preferences, readonly, tabindex, type, value, valuefrompreferences methods reset examples <preferences> <preference id="pref_id" name="preference.name" type="int"/> </preferences> see preferences system for a complete example.
... methods reset() return type: no return value resets the preference to its default value.
... inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattr...
stringbundle - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element which can be used to load localized resources from property files.
... the "src" attribute accepts only absolute chrome:// urls (see bugs 133698, 26291) attributes src properties applocale , src, stringbundle, strings methods getformattedstring, getstring examples (example needed) attributes src type: uri the uri of the property file that contains the localized strings.
... methods getformattedstring( key, strarray ) return type: string looks up the format string for the given key name in the string bundle and returns a formatted copy where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array.
... inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(...
toolbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for toolbars.
... properties accessible, customtoolbarcount, externaltoolbars, palette, toolbarset methods appendcustomtoolbar, collapsetoolbar, expandtoolbar examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> <toolba...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserda...
...the method returns the dom element for the created toolbar.
tooltip - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for the tooltip popups.
... attributes crop, default, label, noautohide, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, page, position properties accessibletype, label, popupboxobject, position, state methods hidepopup, moveto, openpopup, openpopupatscreen, showpopup, sizeto examples <tooltip id="moretip" orient="vertical" style="background-color: #33dd00;"> <label value="click here to see more information"/> <label value="really!" style="color: red;"/> </tooltip> <vbox> <button label="simple" tooltiptext="a simple popup"/> <button label="more" tooltip="moretip"/> </vbox> attributes ...
... example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <menuitem label="item 1"/> <menuitem label="item 2"/> <menu id="submenu1" label="submenu 1"> <menupopup id="submenu1-popup"> <menuitem label="submenu1 item 1"/> <menuitem label="submenu1 item 2"/> </menupopup> </menu> <menu id="submenu2" label="submenu 1"> <menupopup id="submenu2-popup"> <me...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdat...
NPN_Enumerate - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary gets the names of the properties and methods of the specified npobject.
... npobj the object of which the properties and methods are to be retrieved.
... identifiers a pointer to receive a pointer to the start of an array of string identifiers of the names of the properties and methods of npobj.
... returns true if the names of the properties and methods were successfully retrieved, otherwise false.
Sunbird Theme Tutorial - Archive of obsolete content
you might be able to apply the same method to other mozilla applications by changing some of the details.
...there are two methods: a simple method, and the normal method.
... simple packaging note: if you use this simple method to package your theme, then it can take up much more disk space than it really needs.
... you might prefer to use this method only while you are developing your theme, and to use the normal method for public releases.
Date.prototype.toLocaleFormat() - Archive of obsolete content
the non-standard tolocaleformat() method converts a date to a string using the specified formatting.
... description the tolocaleformat() method provides greater software control over the formatting of the generated date and/or time.
... 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.
...you might consider using some of the more general tolocale* methods of the date object or doing your own custom localization of the date to be displayed using some of the get* methods of the date object instead of using this method.
ECMAScript 5 support in Mozilla - Archive of obsolete content
supported features added in javascript 1.8.5 (gecko 2, firefox 4 and later) firefox 4 has full ecmascript 5 support including the object.* methods and strict mode.
... added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method.
... string.trim() method, which trims whitespace from both ends of the string.
... added in javascript 1.6 (gecko 1.8, firefox 1.5) new array methods offering several improved methods for manipulating arrays -- have been part of javascript since javascript 1.6.
LiveConnect - Archive of obsolete content
liveconnect provides javascript with the ability to call methods of java classes and vice-versa using the existing java infrastructure.
... liveconnect reference the java classes used for liveconnect, along with their constructors and methods.
... liveconnect use by applets is enabled via the use of the "mayscript" attribute in applet tags on an html page, following which the applet may refer to classes in the netscape.javascript package to access javascript objects, and scripts may directly call applet methods (using the syntax document.applets.name.methodname()).
... old liveconnect documents, broken links: java method overloading and liveconnect 3 the technique that liveconnect uses to invoke overloaded java methods from javascript.
JavaClass - Archive of obsolete content
you can pass a javaclass object to a java method which requires an argument of type java.lang.class.
... backward compatibility javascript 1.3 and earlier you must create a wrapper around an instance of java.lang.class before you pass it as a parameter to a java method -- javaclass objects are not automatically converted to instances of java.lang.class.
... methods the methods of a javaclass object are the static methods of the java class.
... example in the following example, the javaclass object java.lang.string is passed as an argument to the newinstance method which creates an array: var cars = java.lang.reflect.array.newinstance(java.lang.string, 15); see also javaarray, javaobject, javapackage, packages ...
Packages - Archive of obsolete content
you can automatically access it without using a constructor or calling a method.
... description the packages object lets you access the public methods and fields of an arbitrary java class from within javascript.
...use standard java dot notation to access the classes, methods, and fields in these packages.
...the setsize, settitle, and setvisible methods are all available to javascript as public methods of java.awt.dialog.
Implementation Status - Archive of obsolete content
etinstancedocument() supported 4.8.2 rebuild() supported 4.8.3 recalculate() supported 4.8.4 revalidate() supported 4.8.5 refresh() supported 4.9 feature string for the hasfeature method call supported 5.
...xforms submission model section title status notes bugs 11.1 submission partial from 1.1 we do not yet support @mode, @indent, @replace='text', @separator, @serialize, @target, header or method child elements 11.2 xforms-submit partial we currently limit (for security reasons) submission only back to the server that served the document.
... 330557; 11.3 xforms-submit-serialize supported 11.4 xforms-submit-done supported 11.5 xforms-submit-error supported 11.6.1 resource supported 11.7.1 method unsupported 11.8 header unsupported 11.8.1 name unsupported 11.8.2 value unsupported 11.9 submission options supported 11.9.1 the get submission method supported ...
... 11.9.2 the post, multipart-post, form-data-post, and urlencoded-post submission methods supported 11.9.3 the put submission method supported 11.9.4 the delete submission method unsupported 11.9.5 serialization as application/xml supported 11.9.6 serialization as multipart/related partial 330557; 11.9.7 serialization as multipart/form-data supported 11.9.8 serialization as application/x-www-form-urlencoded supported 11.10 replacing data with the submission response ...
The Business Benefits of Web Standards - Archive of obsolete content
web standards gives us tools, and methodologies for dealing with this paradox and making the wider contribution of making our content universally accessible to people in different social, medical and economic circumstances.
... happier staff good developers - both agency and inhouse - simply do not want to work using outdated methodologies and platforms with uncertain standards, with all the consequent uncertainty in quality.
... the content - markup - style; model also lends itself very neatly to linear methods of production.
... sites which are built using web standards methodologies, processes and practises perform far better for every single metric.
Organizing your CSS - Learn web development
consistency can be applied in all sorts of ways, such as using the same naming conventions for classes, choosing one method of describing color, or maintaining consistent formatting (for example will you use tabs or spaces to indent your code?
... css methodologies instead of needing to come up with your own rules for writing css, you may benefit from adopting one of the approaches already designed by the community and tested across many projects.
... these methodologies are essentially css coding guides that take a very structured approach to writing and organising css.
... however, you do gain a lot of structure by adopting one and, as many of these systems are very widely used, other developers are more likely to understand the approach you are using and be able to write their css in the same way, rather than having to work out your own personal methodology from scratch.
Floats - Learn web development
prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to learn how to create floated features on webpages, and to use the clear property and other methods of clearing floats.
...gin: 0 auto; font: .9em/1.2 arial, helvetica, sans-serif } .wrapper { background-color: rgb(79,185,227); padding: 10px; color: #fff; } .box { float: left; margin: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .wrapper::after { content: ""; clear: both; display: block; } using overflow an alternative method is to set the overflow property of the wrapper to a value other than visible.
...see the article on legacy layout methods for information on how they used to be used, which may be useful if you find yourself working on older projects.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Choosing the right approach - Learn web development
further information introducing asynchronous javascript, in particular async callbacks settimeout() settimeout() is a method that allows you to run a function after an arbitrary amount of time has passed.
... further information cooperative asynchronous javascript: timeouts and intervals, in particular settimeout() settimeout() reference setinterval() setinterval() is a method that allows you to run a function repeatedly with a set interval of time between each execution.
... further information cooperative asynchronous javascript: timeouts and intervals, in particular setinterval() setinterval() reference requestanimationframe() requestanimationframe() is a method that allows you to run a function repeatedly, and efficiently, at the best framerate available given the current browser/system.
...> { // depending on what type of file is being fetched, use the relevant function to decode its contents if(type === 'blob') { return response.blob(); } else if(type === 'text') { return response.text(); } }) .catch(e => { console.log(`there has been a problem with your fetch operation for resource "${url}": ` + e.message); }); } // call the fetchanddecode() method to fetch the images and the text, and store their promises in variables let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let description = fetchanddecode('description.txt', 'text'); // use promise.all() to run code only when all three function calls have resolved promise.all([coffee, tea, description]).then(values => { console.log(values); // st...
Functions — reusable blocks of code - Learn web development
functions versus methods programmers call functions that are part of objects methods.
...for now, we just wanted to clear up any possible confusion of method versus function — you are likely to meet both terms as you look at the available related resources across the web.
... the built-in code we've made use of so far come in both forms: functions and methods.
... you can check the full list of the built-in functions, as well as the built-in objects and their corresponding methods here.
Basic math in JavaScript — numbers and operators - Learn web development
useful number methods the number object, an instance of which represents all standard numbers you'll use in your javascript, has a number of useful methods available on it for you to manipulate numbers.
... for example, to round your number to a fixed number of decimal places, use the tofixed() method.
... note: you may sometimes see exponents expressed using the older math.pow() method, which works in a very similar way.
...troubleshooting javascript storing the information you need — variables basic math in javascript — numbers and operators handling text — strings in javascript useful string methods arrays assessment: silly story generator ...
Package management basics - Learn web development
the package manager will provide a method to install new dependencies (also referred to as "packages"), manage where packages are stored on your file system, and offer capabilities for you to publish your own packages.
...the date-fns package’s formatdistancetonow() method is useful for this (there's other packages that do the same thing too).
...it differs in that it uses a different method for downloading and storing the packages on your computer, aiming to reduce the overall disk space required.
... in addition, the npm (and yarn) commands are clever in that they will search for command line tools that are locally installed to the project before trying to find them through conventional methods (where your computer will normally store and allow software to be found).
Listening to events on all tabs
adding a listener to listen to progress events on all tabs, call the browser's addtabsprogresslistener() method: gbrowser.addtabsprogresslistener(myprogresslistener); myprogresslistener is an object that implements the callbacks used to provide notifications of progress events.
... removing a listener to remove a previously installed progress listener, call removetabsprogresslistener(): gbrowser.removetabsprogresslistener(myprogresslistener); implementing a listener the listener object itself has five methods it can implement to handle various events: onlocationchange called when the uri of the document displayed in the tab changes.
...this method will be called on security transitions (eg http -> https, https -> http, foo -> https) and after document load completion.
...if any registered progress listener returns false from this method then the attempt to refresh will be blocked.
Experimental features in Firefox
nightly 74 no developer edition 74 no beta 74 no release 74 no preference name dom.input_events.beforeinput.enabled htmlmediaelement method: setsinkid() htmlmediaelement.setsinkid() allows you to set the sink id of an audio output device on an htmlmediaelement, thereby changing where the audio is being output.
... nightly 66 no developer edition 66 no beta 66 no release 66 no preference name dom.media.autoplay.autoplay-policy-api geometryutils methods: convertpointfromnode(), convertrectfromnode(), and convertquadfromnode() the geometryutils methods convertpointfromnode(), convertrectfromnode(), and convertquadfromnode() map the given point, rectangle, or quadruple from the node on which they're called to another node.
... nightly 31 yes developer edition 31 no beta 31 no release 31 no preference name layout.css.getboxquads.enabled geometryutils method: getboxquads() the geometryutils method getboxquads() returns the css boxes for a node relative to any other node or viewport.
... nightly 71 yes developer edition 71 no beta 71 no release 71 no preference name dom.media.mediasession.enabled asynchronous sourcebuffer add and remove this adds the promise-based methods appendbufferasync() and removeasync() for adding and removing media source buffers to the sourcebuffer interface.
mozbrowsershowmodalprompt
the mozbrowsershowmodalprompt event is fired when the content of a browser <iframe> calls the window.alert(), window.confirm(), or window.prompt() methods.
... message a domstring representing the value passed to the window.alert(), window.confirm(), or window.prompt() methods within the browser <iframe>'s content.
... returnvalue a domstring representing the return value for the window.prompt() methods.
... initialvalue a string representing the initial value for the window.prompt() methods.
Introduction to Layout in Mozilla
creates a content sink, which is linked to the parser and the document creates a documentviewerimpl object, which is returned as nsicontentviewer back to the docshell documentviewerimpl creates pres context and pres shell content model construction content arrives from network via nsistreamlistener::ondataavailable parser tokenizes & processes content; invokes methods on nsicontentsink with parser node objects some buffering and fixup occurs here opencontainer, closecontainer, addleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame constructio...
... w, h) for frames, views, and widgets given w & h constraints of “root frame” compute (x, y, w, h) for all children constraints propagated “down” via nshtmlreflowstate desired size returned “up” via nshtmlreflowmetrics basic pattern parent frame initializes child reflow state (available w, h); places child frame (x, y); invokes child’s reflow method child frame computes desired (w, h), returns via reflow metrics parent frame sizes child frame and view based on child’s metrics n.b.
...(tables, blocks, xul boxes) reflow “global” reflows initial, resize, style-change processed immediately via presshell method incremental reflows targeted at a specific frame dirty, content-changed, style-changed, user-defined nshtmlreflowcommand object encapsulates info queued and processed asynchronously, nsipressshell::appendreflowcommand, processreflowcommands incremental reflow recursively descend to target recovering reflow state child rs.reason set to incremental incremental reflow process reflow “normally” at target frame child rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental ...
...ry and damage propagation cost painting as reflow proceeds through the frame hierarchy, areas are invalidated via nsiviewmanager::updateview unless immediate, invalid areas are coalesced and processed asynchronously via os expose event native expose event dispatched to widget; widget delegates to the view manager view manager paints views back-to-front, invoking presshell’s paint method presshell::paint walks from the view to the frame; invokes nsiframe::paint for each layer incrementalism single-threaded simple (no locking) can’t leave event queue unattended content construction unwinds “at will” parser and content sink do some buffering content sink has “notification limits” efficiency vs.
Dict.jsm
method overview dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type ...
... return value a newly created dictionary object implementing the methods described in this article.
... methods copy() returns a shallow copy of the dictionary; that is, a copy of the dictionary including the items immediately included within the dictionary; however, any objects referenced by those top-level objects are not copied.
... return value a new dictionary object containing the same top-level items as the original dictionary on which the copy() method was called.
DownloadSummary
method overview promise bindtolist(downloadlist alist); promise addview(object aview); promise removeview(object aview); properties attribute type description allhavestopped read only boolean indicates whether all the downloads are currently stopped.
... methods bindtolist() this method may be called once to bind this object to a downloadlist.
... note: this method is already called internally by the downloads.getsummary() function.
...the following methods may be defined: onsummarychanged: optional called after any property of the summary has changed.
Localization and Plurals
this module provides a couple methods for localizing to the browser's current locale as well as getting methods to localize to a desired plural rule.
... components.utils.import("resource://gre/modules/pluralform.jsm"); methods: get these methods make use of the browser's current locale specified by chrome://global/locale/intl.properties's pluralrule value.
... /** * get the correct plural form of a word based on the number * * @param anum * the number to decide which plural form to use * @param awords * a semi-colon (;) separated string of words to pick the plural form * @return the appropriate plural form of the word */ string pluralform get(int anum, string awords) here is an example of using this method: // load pluralform and for this example, assume english components.utils.import("resource://gre/modules/pluralform.jsm"); // pluralform.get expects a semi-colon separated list of words let downloads = "download;downloads"; // pretend this number came from somewhere else let num = 10; // display the correct plural form for 10 downloads: "you have 10 downloads.") print("you have " + num + " " + pluralform.get(num, download...
...let title = pluralform.get(numdownloads, getstr("downloadstitlefiles")); // put in the correct number of downloads print(title.replace("#1", numdownloads)); // get the correct plural form of seconds let timeleft = 55; let seconds = pluralform.get(timeleft, getstr("seconds")); // print the localized string for "55 seconds" print(getstr("timepair").replace("#1", timeleft).replace("#2", seconds)); method: makegetter if you're writing an extension, you'll want to use makegetter instead of pluralform.get() or pluralform.numforms().
Mozilla Style System Documentation
these three types of style contexts correspond to the three ways of creating a style context: nsiprescontext::resolvestylecontextfor, nsiprescontext::resolvepseudostylecontextfor, and.nsiprescontext::resolvestylecontextfornonelement there is also a fourth method, nsiprescontext::probepseudostylecontextfor, which creates a style context only if there are style rules that match the pseudo-element.
...these methods may all return an existing style context rather than a new one (see stylesetimpl::getcontext), if there is a current style context with the same parent, that matches the same rules (a check that is easy because of the ruletree), and is for the same pseudo-element (or not for a pseudo-element, or a "non-element").
... getting style data from a style context to get style data from a style context, use the getstyledata method to fill in a pointer to a style struct.
... the fundamental way to get a style struct from a style context looks like this: const nsstyledisplay *display = ns_static_cast(const nsstyledisplay*, sc->getstyledata(estylestruct_display)); there is also a (non-virtual) method on nsiframe to get the style data from a frame's style context (saving the refcounting needed to get the style context): const nsstyledisplay *display; frame->getstyledata(estylestruct_display, (const nsstylestruct*&)display); however, there are similar typesafe global function templates that (should) compile to the same thing but use the type of the template parameter to pass the correct nsst...
A brief guide to Mozilla preferences
a preference is read from a file, and can call up to four methods: pref(), user_pref(), sticky_pref() and lockpref().
...programmatic changes to preferences can be made using the preferences.jsm module from js code, or the mozilla::preferences static class methods from c++ code.
...this method has the advantage of resetting preferences back to administrator defaults at every start-up.
...this method is considered user-hostile.
About NSPR
additionally, nspr provides synchronization methods more suited for use by java.
...it was originally intended to export synchronous i/o methods only, relying on threads to provide the concurrency needed for complex applications.
... that method of operation is preferred though it is possible to configure the network i/o channels as non-blocking in the traditional sense.
...while the object is not declared as opaque, the api provides methods that allow and encourage clients to treat the addresses as polymorphic items.
Index
implemented extensions the extensions defined for crl provide methods for associating additional attributes with crls of theirs entries.
... -m method type sets method type for the test type it follows.
... -s method flags sets revocation flags for the method it follows.
...this article covers the two methods for installing pkcs #11 modules into firefox.
Rhino overview
however, rhino is an implementation of the core language only and doesn't contain objects or methods for manipulating html documents.
...the value of this property can be determined at runtime by calling the issecuritydomainrequired method of context.
...if it is the interpreter class, call the getinterpretersecuritydomain() method of context to obtain the security domain of the currently executing interpreted script or function.
...when the class was defined and loaded, the appropriate security domain was associated with it, and can be retrieved by calling this method.
The JavaScript Runtime
instead, every property accessor method in scriptable (has, get, set, remove, getattributes, and setattributes) has overloaded forms that take either a string or an int argument.
...for example, evaluating the expression obj["3"] will invoke the get(int, scriptable) method even though the property name was presented in the script as a string.
...this method defines a set of javascript objects using a java class.
... if the services provided by defineclass are insufficient, try other methods of scriptableobject and functionobject, such as defineproperty and definefunctionproperties.
Self-hosted builtins in SpiderMonkey
otoh, normal method calls are forbidden in self-hosted code.
...this restriction was added because otherwise it's extremely easy to accidentally call methods that have been changed by content, changing the behavior from what was expected.
... to add a self-hosted function as a method to a host object, add it to that host object's jsfunctionspec array using the js_self_hosted_fn macro.
... example: js_self_hosted_fn("foreach", "arrayforeach", 1,0) this causes the self-hosted function arrayforeach to be installed as the host object's method foreach.
JS::CompileOptions
methods some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain.
... methods of js::readonlycompileoptions method description bool mutederrors() const determines if errors are muted.
... 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.
... methods of js::compileoptions method description jsobject *element() const same as js::owningcompileoptions.
JS::MutableHandle
} methods here, ptr represents the private member of js::mutablehandle<t>, typed with t *.
... method description const t &get() const returns *ptr.
...it is used in the same way as js::handle&lt;t&gt; and includes a |set(const t &v)| method to allow updating the value of the referenced js::rooted&lt;t&gt;.
... if you want to add additional methods to js::mutablehandle for a specific specialization, define a js::mutablehandlebase<t> specialization containing them.
JSFastNative
apis such as js_initclass and js_definefunctions can create custom methods that are implemented as c/c++ functions of this type, instead of jsnative.
... native methods must not call js_callee after calling js_set_rval.
... native methods must not call js_this after calling js_set_rval.
... native methods must not call js_this_object after calling js_set_rval.
JS_DefineFunction
obj js::handle&lt;jsobject*&gt; object for which to define a function as a property (method).
... description js_definefunction exposes a c/c++ function to scripts by defining a new method on an existing javascript object.
... it creates the new function object as though by calling js_newfunction, then makes it a method of obj as though by calling js_defineproperty.
...that is, it is the method name that scripts can use to call the new function.
JS_Init
once this method has succeeded, it is safe to call js_newruntime and other jsapi methods.
... this method must be called before any other jsapi method is used on any thread.
... once it has been used, it is safe to call any jsapi method, and it remains safe to do so until js_shutdown is correctly called.
... it is currently not possible to initialize spidermonkey multiple times (that is, calling js_init, jsapi methods, then js_shutdown in that order, then doing so again).
Feed content access API
est = new xmlhttprequest(); httprequest.open("get", feedurl, true); try { httprequest.onload = inforeceived; httprequest.send(null); } catch(e) { alert(e); } } the nsifeedprocessor interface lets you parse the feed data from several possible sources; in this case, we're loading a document into a string, then parsing that string using its parsefromstring() method.
...the actual processing of the parsed feed is done by a method called handleresult() on the feedtestresultlistener object.
...we could, alternatively, use its plaintext() method to get a copy of the title translated into plain text.
...the full url of the link is retrieved using the link's resolve() method.
Using the Places keywords API
using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an url the insert() method accepts a keyword entry object describing the keyword to insert.
... fetching an entry by keyword the fetch() method acceps a keyword string (or an object having a keywords property) and might resolve to a keyword entry with the following properties: keyword: string representing the keyword url: the url represeted by the keyword postdata: optional post data string.
... placesutils.keywords.fetch("my_keyword").then(entry => { /* entry is either null, or a keyword entry */ }, e => { /* failure */}); fetching entries by url the fetch() method also accepts a keyword entry, where it's possible to specify keyword, url, or both.
... placesutils.keywords.fetch({ url: "http://www.example.com/" }, entry => { /* invoked for each found keyword entry */ }) .then(oneentry => { /* oneentry is either null, or one of the keyword entries */ }, e => { /* failure */}); removing a keyword the remove() method accepts a keyword string.
Using the Places tagging service
the tagging service, offered by the nsitaggingservice interface, provides methods to tag and untag a uri, to retrieve uris for a given tag, and to retrieve all tags for a uri.
... initiating the tagging service before using the tagging service, you need to obtain a reference to an instance of it: var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"] .getservice(components.interfaces.nsitaggingservice); tagging a uri the nsitaggingservice.taguri() method tags a url with the given set of tags.
... tagginsvc.untaguri(uri("http://example.com/"), ["tag 1"]); //first argument = uri //second argument = array of tag(s) finding all urls with a given tag the nsitaggingservice.geturisfortag() method returns an array of all urls tagged with the given tag.
... var tag1uris = taggingsvc.geturisfortag("tag 1"); //"tag 1" = given tag getting all tags associated with a url the nsitaggingservice.gettagsforuri() method returns an array of all tags set for the given url.
Aggregating the In-Memory Datasource
say you were writing a datasource2, and the way you chose to implement it was to "wrap" the in-memory datasource; i.e., myclass : public nsimyinterface, public nsirdfdatasource { private: nscomptr<nsirdfdatasource> minner; public: // nsirdfdatasource methods ns_imethod init(const char* auri) { return minner->init(auri); } ns_imethod geturi(char* *auri) { return minner->geturi(auri); } // etc., for each method in nsirdfdatasource!
... when it won't work although this magic is terribly convenient to use, it won't work in the case that you want to "override" some of the in-memory datasource's methods.
... for us to preserve symmetry, our queryinterface() implementation needs to forward nsirdfdatasource to the delegate3: ns_imethodimp myclass::queryinterface(refnsiid aiid, void** aresult) { ns_precondition(aresult != nsnull, "null ptr"); if (!
...for example: ns_imethodimp myclass::dosomething() { nscomptr<nsirdfdatasopurce> ds = do_queryinterface(minner); rv = ds->assert(/* something useful here */); // etc...
Bundling multiple binary components
possible solutions this article covers two possible ways to make binary components support multiple version of gecko: dynamic method loading stub loader dynamic method loading the idea with this approach is to figure out all the methods imported from gecko and dynamically load the methods.
... create small wrappers for calling the methods, as you may need to thunk parameters depending on how much has changed between gecko versions.
... this approach uses only one binary for each platform (win/mac/linux) but creates complexity in the binaries - loading the methods and creating the wrappers.
... the costs get higher if you have many methods that need to be loaded.
Fun With XBL and XPConnect
all you have to do is specifically defining a method on the xbl widget which forwards the method call to the xpcom object.
... <method name="autocomplete"> <argument name="asearchstring"/> <argument name="resultlistener"/> <body> <![cdata[ return this.autocompletesession.autocomplete(null, anonymouscontent[0], asearchstring, this.autocompletelistener); ]]> </body> </method> you can see that the body of the method is just getting the auto complete session object and calling the auto complete method on it.
... now i can pass the result of autocompletelistener into methods that require an auto complete listener (like my auto complete session object).
...the handler calls the auto complete method we've exposed on the widget which in turn forwards the call to the xpcom object, passing in our implementation of nsiautocompletelistener.
Component Internals
a component in the xpcom framework when you build a component or module and compile it into a library, it must export a single method named nsgetmodule.
... registration methods in xpcom what is xpcom registration?
...as this section and the next describe, you can register your component explicitly during installation, or with the regxpcom program, or you can use the autoregistration methods in the service manager to find and register components in a specified components directory: xpinstall apis regxpcom command-line tool nsicomponentregistrar apis from service manager the registration process is fairly involved.
...when that method is called, the following sequence of events occurs: xpcom fires a shutdown notification to all registered observers.
Packaging WebLock
the installation script for the weblock component can also be used to register the component with the browser into which it is installed (see registration methods in xpcom for more information on registration).
... javascript apis from the xpinstall install object download the jar in which the installable files appear and call registration methods that tell mozilla about the new component and the ui it uses to access the weblock component.
...once triggered (see the weblock trigger script), the installation script: downloads the weblock component and places it in the components directory copies the weblock subdirectory in the mozilla chrome application subdirectory registers both the component and the ui the xpinstall api provides such essential methods[essential-methods] as initinstall, registerchrome, addfile, and others.
... 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.
Creating XPCOM components
note:this article describes a method that uses xpidl but you should use webidl instead.
...reface who should read this book organization of the tutorial following along with the examples conventions acknowledgements an overview of xpcom the xpcom solution gecko components interfaces interfaces and encapsulation the nsisupports base interface xpcom identifiers cid contract id factories xpidl and type libraries xpcom services xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating ...
...components in cpp xpcom initialization xpcom registry manifests registration methods in xpcom autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component registration the regxpcom program registration alternatives overview of the weblock module source digging in: required includes and constants identifiers in xpcom coding for the registration process the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in ...
...orts the web locking interface implementing weblock declaration macros representing return values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white list creating nsiuri ob...
How to build a binary XPCOM component using Visual Studio
that means you can call javascript methods from c++ and vice versa.
...the interface defines the methods, including arguments and return types, of the component.
...the implementation is where the methods actually do the work.
...thing(); private: ~cspecialthing(); protected: /* additional members */ nsstring mname; }; #endif cpp file: #include "comp-impl.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspecialthing() { /* destructor code */ } /* attribute astring name; */ ns_imethodimp cspecialthing::getname(nsastring & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsastring & aname) { mname.assign(aname); return ns_ok; } /* long add (in long a, in long b); */ ns_imethodimp cspecialthing::add(print32 a, print32 b, print32 *_retval) { *_retval = a + b; return ns_ok; } lastly, we need to create the module implementation.
Components.Constructor
the component is then returned immediately, with only the base interface nsisupports available on it; you must call nsisupports.queryinterface() on it to call methods on the object.
... "nsibinaryinputstream"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsibinaryinputstream]" // someinputstream is an existing nsiinputstream bis.setinputstream(someinputstream); // succeeds if three arguments are given, then in addition to being nsisupports.queryinterface()'d, the instance will also have had an initialization method called on it.
... the arguments used with the initialization method are the arguments passed to the components.constructor()-created function when called: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1", "nsibinaryinputstream", "setinputstream"); try { // throws, because number of arguments isn't equal to the number of // arguments nsibinaryinputstream.setinputstream takes var bis = new binaryinputstream(); } catch (e) { // someinputstream is an existing nsiinputstream bis = new binaryinputstream(someinputstream); // succeeds var bytes = bis.readbytearray(somenumberofbytes); // succeeds } compare instance creation from base principles with instance creation using componen...
...binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was initialized previously var bis = new binaryinputstream(someinputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods.
Components.classes
all of the properties and methods of the nsijscid and its ancestor interface nsijsid are available for use on the objects contained in this object.
... usage in order to retrieve the object for a given contractid, you can query the components.classes array as follows: var clazz0 = components.classes["@mozilla.org/messenger;1"]; clazz0 is the class object for the contractid @mozilla.org/messenger;1, which is not usually used by itself, but whose createinstance and getservice methods can be used to create a new instance of the component or to access the singleton instance, if the contract id represents a service.
... .createinstance(components.interfaces.nsisupportsarray); which is a shortcut to var obj = components.classes["@mozilla.org/supports-array;1"] .createinstance(); obj.queryinterface(components.interfaces.nsisupportsarray); if you don't provide a specific interface to createinstance(), it will return an xpconnect wrapper for the component, which only exposes the methods of the nsisupports interface (and under certain circumstances the special wrappedjsobject property).
... var os = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); a less known trick, useful when creating multiple instances of the same component, is to use the new operator on the class object: var clazz = components.classes["@mozilla.org/supports-array;1"]; var inst = new clazz(components.interfaces.nsisupportsarray); this implicitly calls the createinstance() method for you.
Components.utils.setGCZeal
this method lets scripts set the zeal level for garbage collection.
... you can get details on what this method does in js_setgczeal.
... this method calls through to that thusly: js_setgczeal(<current context>, zeal, js_default_zeal_freq, false); syntax components.utils.setgczeal(zeal); where zeal is the zeal value you wish to use.
... this method has no effect unless running in a debug build.
Components object
utils.lookupmethod looks up a native (i.e.
... declared in the interface) method or property of an xpcom object.
... utils.methodjit obsolete since gecko 24.0 provides access to the value of the methodjit property in the javascript environment.
... utils.methodjit_always obsolete since gecko 24.0 provides access to the value of the methodjit_always property in the javascript environment.
NS_OVERRIDE
ns_override is a macro which allows c++ code in mozilla to specify that a method is intended to override a base class method.
... if there is no base class method with the same signature, a compiler with static-checking enabled will fail to compile.
...example class a has a method getfoo() which is overridden by class b: class a { virtual nsresult getfoo(nsifoo** aresult); }; class b : public a { ns_override virtual nsresult getfoo(nsifoo** aresult); }; later, the signature of a::getfoo() is changed to remove the output parameter: class a { - virtual nsresult getfoo(nsifoo** aresult); + virtual already_addrefed<nsifoo> getfoo(); }; b::getfoo() no longer overrides a::getfoo() as was originally intended.
... a compiler with static-checking enabled will issue the following error: test.cpp:8: error: ns_override function b::getfoo(nsifoo**) does not override a base class method with the same name and signature.
IAccessibleAction
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be performed by the object.
...method overview [propget] hresult description([in] long actionindex, [out] bstr description ); hresult doaction([in] long actionindex ); [propget] hresult keybinding([in] long actionindex, [in] long nmaxbindings, [out, size_is(,nmaxbindings), length_is(, nbindings)] bstr keybindings, [out] long nbindings ); [propget] hresult localizedname([in] long actionindex, [out] bstr localizedname ); hre...
...sult nactions([out,retval] long nactions ); [propget] hresult name([in] long actionindex, [out] bstr name ); methods description() returns a description of the specified action of the object.
...there is no need to implement this method for single action controls since that would be redundant with the standard msaa programming practice of getting the mnemonic from get_acckeyboardshortcut.
IAccessibleEditableText
refer to the @ref _specialoffsets "special offsets for use in the iaccessibletext and iaccessibleeditabletext methods" for information about a special offset constant that can be used in iaccessibleeditabletext methods.
... method overview hresult copytext([in] long startoffset, [in] long endoffset ); hresult cuttext([in] long startoffset, [in] long endoffset ); hresult deletetext([in] long startoffset, [in] long endoffset ); hresult inserttext([in] long offset, [in] bstr text ); hresult pastetext([in] long offset ); hresult replacetext([in] long startoffset, [in] long endoffset, [in] bstr text ); hresult setattributes([in] long startoffset, [in] long endoffset, [in] bstr attributes ); methods copytext() copies the text range into the clipboard.
...this method is similar to the inserttext().
...this method is equivalent to calling first deletetext() with the two indices and then calling inserttext() with the replacement text at the start index.
IAccessibleValue
method overview [propget] hresult currentvalue([out] variant currentvalue ); [propget] hresult maximumvalue([out] variant maximumvalue ); [propget] hresult minimumvalue([out] variant minimumvalue ); hresult setcurrentvalue([in] variant value ); methods currentvalue() returns the value of this object as a number.
...it does not have to be the same type as that returned by method currentvalue().
...it does not have to be the same type as that returned by method currentvalue().
...the argument is clipped to the valid interval whose upper and lower bounds are returned by the methods maximumvalue() and minimumvalue(), that is if it is lower than the minimum value the new value will be the minimum and if it is greater than the maximum then the new value will be the maximum.
imgIContainerObserver
1.0 66 introduced gecko 1.7 inherits from: nsisupports last changed in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9) if you wish to listen for activities on an imgicontainer, you should implement the framechanged() method.
... method overview void framechanged(in imgirequest arequest, in imgicontainer acontainer, [const] in nsintrect adirtyrect); native code only!
... methods native code only!framechanged called when the frame for an image container has changed.
... notes the arequest parameter was added to this method in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
imgIDecoder
method overview void close(); void flush(); void init(in imgiload aload); unsigned long writefrom(in nsiinputstream instr, in unsigned long count); methods close() closes the stream.
...this object also implements the imgidecoderobserver interface; you should queryinterface() it to that interface and call its notification methods while handling the decode operation.
... implementer's note: this method is defined by this interface in order to let the output stream efficiently copy the data from the input stream into its internal buffer (if any).
... if this method was provided as an external facility, a separate char * buffer would need to be used in order to call the output stream's other write() method.
imgIRequest
inherits from: nsirequest last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void cancelandforgetobserver(in nsresult astatus); imgirequest clone(in imgidecoderobserver aobserver); void decrementanimationconsumers(); imgirequest getstaticrequest(); void incrementanimationconsumers(); void lockimage(); void requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with.
... cors_anonymous 2 cors_use_credentials 3 methods cancelandforgetobserver() cancels this request as in nsirequest.cancel(); further, also nulls out decoderobserver so it gets no further notifications from us.
...getstaticrequest() if this request is for an animated image, the method creates a new request which contains the current frame of the image.
...imgicontainer has a requestdecode method, but callers may want to request a decode before the container has necessarily been instantiated.
mozIJSSubScriptLoader
method overview jsval loadsubscript(in string url, in object targetobj optional, in string charset optional); jsval loadsubscriptwithoptions(in string url, in object options); methods loadsubscript() synchronously loads and executes the script from the specified url.
... if the script returns a value, it will be returned by this method.
... note: this method must only be called from javascript!
... note: this method must only be called from javascript!
mozIStorageFunction
last changed in gecko 1.9.1.4 (firefox 3.5.4) inherits from: nsisupports method overview nsivariant onfunctioncall(in mozistoragevaluearray afunctionarguments); methods onfunctioncall() the implementation of the function.
... javascript starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbconn.createfunction("square", 1, function(aarguments) { let value = aarguments.getint32(0); return value * value; }); // run some query that uses the function.
... let stmt = dbconn.createstatement("select square(value) from some_table"); try { while (stmt.executestep()) { // handle the results } } finally { stmt.reset(); } in earlier versions of gecko, however, you'll need to actually create an object containing the onfunctioncall method.
...class squarefunction : public mozistoragefunction { public: ns_imethod onfunctioncall(mozistoragevaluearray *aarguments, nsivariant **_result) { print32 value; nsresult rv = aarguments->getint32(&value); ns_ensure_success(rv, rv); nscomptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasint64(value * value); ns...
nsIAlertsService
implemented by: @mozilla.org/alerts-service;1 as a service: var alertsservice = components.classes["@mozilla.org/alerts-service;1"] .getservice(components.interfaces.nsialertsservice); method overview void showalertnotification(in astring imageurl, in astring title, in astring text, [optional] in boolean textclickable, [optional] in astring cookie, [optional] in nsiobserver alertlistener, [optional] in astring name, [optional] in astring dir, [optional] in astring lang, [optional] in astring data, [optional] in nsiprincipal principal,[optional] in boolean inprivatebrowsing);...
... void closealert([optional] in astring name, [optional] in nsiprincipal principal); methods showalertnotification() displays a notification window.
...it must implement an observe() method that accepts three parameters: subject: always null.
... data: the value of the cookie parameter passed into the showalertnotification method.
nsIAuthPrompt
to create an instance, use: var authprompt = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt); method overview boolean prompt(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword, in wstring defaulttext, out wstring result); boolean promptpassword(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword, inout wstring pwd); boolean promptusernameandpassword(in wstring dialogtitle, in wstring text...
... methods prompt() this method puts up a text input dialog with ok and cancel buttons.
... promptpassword() this method puts up a password dialog with ok and cancel buttons.
... promptusernameandpassword() this method puts up a username/password dialog with ok and cancel buttons.
nsICategoryManager
to use this service, use: var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); method overview string addcategoryentry(in string acategory, in string aentry, in string avalue, in boolean apersist, in boolean areplace); void deletecategory(in string acategory); void deletecategoryentry(in string acategory, in string aentry, in boolean apersist); nsisimpleenumerator enumeratecategories(); nsisimpleenumerator enumeratecategory(in string a...
...category); string getcategoryentry(in string acategory, in string aentry); methods addcategoryentry() this method sets the value for the given entry on the given category.
... note: if the category does not exist, then this method does nothing.
... note: if the category does not exist, then this method does nothing.
nsIClassInfo
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null.
...obsolete since gecko 2.0 methods gethelperforlanguage() get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage.
... getinterfaces() this method returns an ordered list of interfaces iids that instances of the class promise to implement.
... if this method is not supported by an implementation, then it should return 0 for count and null for array.
nsIConsoleService
inherits from: nsisupports last changed in gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16) implemented by: @mozilla.org/consoleservice;1 as a service: var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); method overview void getmessagearray([array, size_is(count)] out nsiconsolemessage messages, out uint32_t count);obsolete since gecko 19 void getmessagearray([optional] out uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void registerlistener...
...(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsolelistener listener); methods getmessagearray() to obtain an array of all logged messages.
... logstringmessage() a convenient method for logging simple messages.
...eturn consoleservice.getmessagearray(array, {}) || array.value; } logging a simple message a common usage is logging a message string to the console: function log(msg) { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); consoleservice.logstringmessage(msg); } alternative logging methods include components.utils.reporterror and dump().
nsIContentSecurityPolicy
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 permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri a...
... methods permitsancestry() verifies ancestry as permitted by the policy.
... shouldload() delegate method called by the service when sub-elements of the protected document are being loaded.
...short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetypeguess aextra return value shouldprocess() delegate method called by the service when sub-elements of the protected document are being processed.
nsIController
inherits from: nsisupports last changed in gecko 1.7 method overview void docommand(in string command); boolean iscommandenabled(in string command); void onevent(in string eventname); boolean supportscommand(in string command); methods docommand() when this method is called, your implementation should execute the command with the specified name.
... iscommandenabled() implement this method to indicate whether or not the specified command is enabled.
...onevent() implement this method to process the event with the specified name.
... supportscommand() implement this method to report whether or not the command with the specified name is supported.
nsICookieManager
it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list.
... methods remove() this method is called to remove an individual cookie from the cookie list, specified by host, name, and path.
...typically, the arguments to this method will be obtained directly from the desired nsicookie object.
... removeall() this method is called to remove all cookies from the cookie list.
nsICookieManager2
the nsicookiemanager2 interface contains additional methods that expand upon the nsicookiemanager interface.
...to create an object implementing this interface: components.utils.import("resource://gre/modules/services.jsm"); var cookieservice = services.cookies; method overview void add(in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry); boolean cookieexists(in nsicookie2 acookie); unsigned long countcookiesfromhost(in autf8string ahost); boolean findmatchingcookie(in nsicookie2 acookie, out unsigned lon...
...g acountfromhost); obsolete since gecko 1.9 nsisimpleenumerator getcookiesfromhost(in autf8string ahost); void importcookies(in nsifile acookiefile); methods add() adds a cookie.
...this method is something of a back door.
nsIDNSService
method overview nsicancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description...
... methods asyncresolve() begins off an asynchronous host lookup.
...warning this method may block the calling thread for a long period of time.
...note: the operating system may still have its own cache of dns records, which would be unaffected by this method.
nsIDirectoryService
xpcom/io/nsidirectoryservice.idlscriptable this interface provides methods to initialize and configure a directory service instance.
... inherits from: nsisupports last changed in gecko 1.7 method overview void init(); void registerprovider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov); init() initializes the nsidirectoryservice instance.
... this method must be called before an nsidirectoryservice instance can be used.
... in the case of the xpcom directory service, this method is called as part of xpcom initialization.
nsIDownloadManager
to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void clea...
... methods adddownload() creates an nsidownload and adds it to the list of activities being managed by the download manager.
...if you want to both add and start a download, you need to create an nsiwebbrowserpersist object, call this method, set the progresslistener to the returned nsidownload object, and then call the nsiwebbrowserpersist.saveuri() method.
... note: prior to gecko 12.0, this was a synchronous operation; that is, once this method returned, you knew that the download was in the download manager's list.
nsIDynamicContainer
method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anewindex); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainerremoving(in long long aitemid); methods oncontainermoved() this method is called ...
... oncontainernodeclosed() this method is called when the given container has just been collapsed so that the service can do any necessary cleanup.
... oncontainernodeopening() this method is called when the given container node is about to be populated so that the service can populate the container if necessary.
... oncontainerremoving() this method is called when the given container is about to be deleted from the bookmarks table, so that the service can do any necessary cleanup.
nsIFactory
inherits from: nsisupports last changed in gecko 0.9.5 method overview void createinstance(in nsisupports aouter, in nsiidref iid, [retval, iid_is(iid)] out nsqiresult result); void lockfactory(in prbool lock); methods createinstance() creates an instance of the class associated with this factory.
... lockfactory() this method provides the client a way to keep the component in memory until it is finished with it.
... gecko 1.7 note as of gecko 1.7, this method is unused.
... most implementations do nothing interesting with this method.
nsIFaviconDataCallback
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 oncomplete(in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype); methods oncomplete() called when the required favicon's information is available.
... it's up to the invoking method to state if the callback is always invoked, or called on success only.
... check the method documentation to ensure that.
...for some method we could not know the favicon's data (it could just be too expensive to get it, or the method does not require we actually have any data).
nsIFeedProcessor
to create an instance, use: var feedprocessor = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method overview void parseasync(in nsirequestobserver requestobserver, in nsiuri uri); void parsefromstream(in nsiinputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events.
... methods parseasync() parses a feed asynchronously.
... the caller must then call the processor's nsistreamlistener methods to drive the parsing process.
... you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse.
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 ad...
... methods appendfilter() appends a custom file extension filter to the dialog.
...the file picker is not valid until this method is called.
...the passed in object's done method will be called upon completion.
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable provides methods for managing message listeners on local frames.
... method overview void addmessagelistener(in astring amessage, in nsiframemessagelistener alistener, [optional] in boolean listenwhenclosed); void removemessagelistener(in astring amessage, in nsiframemessagelistener alistener); void sendasyncmessage(in astring amessage, in astring json); methods addmessagelistener() adds a message listener to the local frame.
... alistener an object implementing nsiframemessagelistener whose receivemessage method will be called when the message is received.
...an alternative method to listen for death of frame script is to use message-manager-disconnect observer: observer notifications :: message manager.
nsIHttpActivityObserver
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 observeactivity(in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata); attributes attribute type description isactive boolean true when the interface is active and should observe http activity, otherwise false.
... if this is false, the observeactivity() method should not be called.
... methods observeactivity() called when activity occurs on the http transport.
... you should implement this method to perform whatever tasks you wish to perform when http activity occurs.
nsIHttpChannelInternal
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void getrequestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if the...
... methods getrequestversion() gets the request's major and minor version numbers.
...the nsihttpupgradelistener will have its nsihttpupgradelistener.ontransportavailable() method invoked if a matching 101 is processed.
...setcookie() helper method to set a cookie with a consumer-provided cookie header, but using the channel's other information (uri's, prompters, date headers and so on.).
nsIJSID
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the following methods return objects that implement this interface: components.interfaces.name components.classes[contract] components.interfacesbyid[uuid] components.classesbyid[cid] the first two cases create a named jsid while the last two cases create an unnamed jsid.
...method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
... methods equals() this method determines if this nsijsid has the same nsid as another nsijsid.
... tostring() this methods returns a string representation of the object.
nsILocaleService
to use this service, use: var localeservice = components.classes["@mozilla.org/intl/nslocaleservice;1"] .getservice(components.interfaces.nsilocaleservice); method overview nsilocale getapplicationlocale(); astring getlocalecomponentforuseragent(); nsilocale getlocalefromacceptlanguage(in string acceptlanguage); nsilocale getsystemlocale(); nsilocale newlocale(in astring alocale); nsilocale newlocaleobject(in nsilocaledefinition localedefinition); obsolete since gecko 1.9 methods getapplicationloca...
...this method returns something similar to getsystemlocale.
...this method returns the same as getsystemlocale.getcategory("nsilocale_messages").
...calls to its getcategory method return the values originally passed to the locale definition's addcategory method.
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(); ...
... methods setdisplaycharset() sets the character set for the displayed message.
...same as just using the openurl() method.
...same as just using the openurl() method.
nsIModule
inherits from: nsisupports last changed in gecko 0.9.9 method overview boolean canunload(in nsicomponentmanager acompmgr); void getclassobject(in nsicomponentmanager acompmgr, in nscidref aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component module ca...
...if the component module is native (that is, as part of a dll), then this method may be called to determine whether or not the dll may be unloaded from memory.
... registerself() when the nsimodule is discovered, this method will be called so that any setup registration can be preformed.
... unregisterself() when the nsimodule is being unregistered, this method will be called so that any unregistration can be preformed.
nsIMsgIncomingServer
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void clearallvalues(); void cleartemporaryreturnreceiptsfilter(); void closecachedconnections(); void configuretemporaryfilters(in nsimsgfilterlist filterlist); void configuretemporaryreturnreceiptsfilter(in nsimsgfilterlist filterlist); obsolete since gecko 1.8 void displayofflinemsg(in nsimsgwindow awindow); boolean equals(in nsimsgincomingserver server); void forgetpassword(); void forgetsessionpassword(); astring generateprettynameformigration(); boolean getboolattribute(in string name); boolean getboolvalue(in strin...
... usesecauth boolean valid boolean constants constant value description defaultsocket 0 trytls 1 alwaysusetls 2 usessl 3 keepdups 0 deletedups 1 movedupstotrash 2 markdupsread 3 methods clearallvalues() this is really dangerous.
...if we have set up to filter return receipts into our sent folder, this utility method creates a filter to do that, and adds it to our filterlist if it doesn't exist.
...void configuretemporaryfilters( in nsimsgfilterlist filterlist ); parameters filterlist missing description exceptions thrown missing exception missing description configuretemporaryreturnreceiptsfilter() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) if we have set up to filter return receipts into our sent folder, this utility method creates a filter to do that, and adds it to our filterlist if it doesn't exist.
nsIMsgWindowCommands
mailnews/base/public/nsimsgwindow.idlscriptable this interface defines methods used by the back end to update the user interface in a mail or news message list.
...method overview void selectfolder(in acstring folderuri); void selectmessage(in acstring messageuri); void clearmsgpane(); methods selectfolder() this method is called by the backend to change the folder displayed in the message window.
... selectmessage() this method is called by the backend to change the displayed message.
... clearmsgpane() this method is called by the backend when it wants to clear the message pane, for instance if you select the group header .
nsINavHistoryContainerResultNode
1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_er...
...this is false for bookmark folder nodes unless the setfolderreadonly() method has been called to specifically make the folder read-only.
... methods findnodebydetails() returns a node matching specified details.
... remarks there are a number of untested methods on this interface that are not documented at present, and are disabled in the idl file.
nsIObserverService
xpcom/ds/nsiobserverservice.idlscriptable this interface provides methods to add, remove, notify, and enumerate observers of various notifications.
... implemented by @mozilla.org/observer-service;1 as a service: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); method overview void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak); nsisimpleenumerator enumerateobservers( in string atopic ); void notifyobservers( in nsisupports asubject, in string atopic, in wstring somedata ); void removeobserver( in nsiobserver anobserver, in string atopic ); methods addobserver() registers a given listener...
... notifyobservers() this method is called to notify all observers for a particular topic.
... removeobserver() this method is called to unregister an observer for a particular topic.
nsIPrintingPrompt
for the print dialog: you may stub out this service by having all the methods return ns_error_not_implemented.
... you can then fly you own dialog and then properly fill in the printsettings object before calling nsiwebbrowserprint's print method.
... defaults for platform service: showprintdialog - displays a native dialog showpagesetup() - displays a native dialog showprogress() - displays a xul dialog method overview void showpagesetup(in nsiprintsettings printsettings, in nsiobserver aobs); void showprintdialog(in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings); void showprogress(in nsiwebbrowserprint webbrowserprint, in nsiprintsettings printsettings, in nsiobserver opendialogobserver, in boolean isforprinting, out nsiwebprogresslistener webprogres...
...slistener, out nsiprintprogressparams printprogressparams, out boolean notifyonopen); methods showpagesetup() shows the print progress dialog.
nsIPropertyBag2
xpcom/ds/nsipropertybag2.idlscriptable this interface extends nsipropertybag with some methods for getting properties in specific formats.
... inherits from: nsipropertybag last changed in gecko 1.0 method overview nsivariant get(in astring prop); acstring getpropertyasacstring(in astring prop); astring getpropertyasastring(in astring prop); autf8string getpropertyasautf8string(in astring prop); boolean getpropertyasbool(in astring prop); double getpropertyasdouble(in astring prop); print32 getpropertyasint32(in astring prop); print64 getpropertyasint64(in astring prop); void getpropertyasinterface(in astring prop, in nsiidref iid, [iid_is(iid), retval] out nsqiresult result); pruint32 getpropertyasuint32(in astring prop); pruint64 getpropertyasuint64(in astring prop); prbool haskey(in astring prop); methods get() t...
...his method returns null if the value does not exist, or exists but is null.
...getpropertyasinterface() this method returns null if the value exists, but is null.
nsIProtocolHandler
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description defaultport long the default port is the port the protocol uses by default.
... methods allowport() lets a protocol override blacklisted ports.
... this method is called when there's an attempt to connect to a port that is blacklisted.
...when a uri containing this port number is encountered, this method is called to ask if the protocol handler wants to override the ban.
nsIScriptError
that subclass offered the nsiscripterror.initwithwindowid() method for that purpose; that method is now available in this interface, however.
... method overview void init(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category); void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); autf8string tostring(); attributes attribute type description category string a string indicating the category of error that occurred see categories for a list.
... infoflag 0x8 just a log message methods init() initializes the object with information describing the error which occurred.
... note: prior to gecko 12.0, this method was provided by the nsiscripterror2 interface, which has now been merged into this one.
nsIScrollable
inherits from: nsiscrollable last changed in gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) method overview long getcurscrollpos(in long scrollorientation); obsolete since gecko 29.0 long getdefaultscrollbarpreferences(in long scrollorientation); void getscrollbarvisibility(out boolean verticalvisible, out boolean horizontalvisible); void getscrollrange(in long scrollorientation, out long minpos, out long maxpos); obsolete since gecko 29.0 void setcurscrollpos(in long scrollorientation, in long curpos); obsolete since geck...
...when passing this in to a method you are requesting or setting data for the horizontal scrollbar.
...when passing this in to a method you are requesting or setting data for the vertical scrollbar.
... methods getcurscrollpos() obsolete since gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) long getcurscrollpos( in long scrollorientation ); parameters scrollorientation an integer representing the orientation of the scrollbar.
nsISeekableStream
inherits from: nsisupports last changed in gecko 1.7 method overview void seek(in long whence, in long long offset); void seteof(); long long tell(); constants constant value description ns_seek_set 0 specifies that the offset is relative to the start of the stream.
... methods seek() this method moves the stream offset of the stream implementing this interface.
... seteof() this method truncates the stream at the current offset.
... tell() this method reports the current offset, in bytes, from the start of the stream.
nsISimpleEnumerator
xpcom/ds/nsisimpleenumerator.idlscriptable this interface represents an enumeration of xpcom objects and provides methods to access elements sequentially.
... inherits from: nsisupports last changed in gecko 0.9.6 method overview nsisupports getnext(); boolean hasmoreelements(); methods getnext() called to retrieve the next element in the enumerator.
...this method is generally called within a loop to iterate over the elements in the enumerator.
...this method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getnext() calls.
nsISocketTransport
it provides methods to open blocking or non-blocking, buffered or unbuffered streams between two end-point in a ip based network.
...to create an instance, call nsisockettransportservice.createtransport() method overview prnetaddr getpeeraddr(); native code only!
... methods native code only!getpeeraddr returns the ip address of the socket connection peer.
... remarks this is a free-threaded interface, meaning that the methods on this interface may be called from any thread.
nsITaskbarTabPreview
method overview void ensureregistration(); violates the xpcom interface guidelines nativewindow gethwnd(); violates the xpcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview.
... methods violates the xpcom interface guidelines ensureregistration() used internally to ensure that the taskbar knows about this preview.
... if a preview is not registered, the api call to set its sibling (via the move() method) will fail silently.
... this method is only invoked when it's safe to make taskbar api calls.
nsIThreadEventFilter
you should implement this interface and its acceptevent() method, then pass the object implementing it as the filter.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview boolean acceptevent(in nsirunnable event);violates the xpcom interface guidelines methods violates the xpcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue.
... (see nsithreadinternal.pusheventqueue()) warning: this method must not make any calls on the thread object.
... return value implement this method to return true if the event is accepted, or false to reject it.
nsITreeSelection
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adjustselection(in long index, in long count); void clearrange(in long startindex, in long endindex); void clearselection(); void getrangeat(in long i, out long min, out long max); long getrangecount(); void invalidateselection(); void invertselection(); boolean isselected(in long index); void rangedselect(in long startindex, in long endindex, in boolean augment); void select(in long index); void selectall(); void timedselect(in long index, in l...
...this is not a reliable method of determining the selected row, as the selection may include multiple rows, or the focused row may not even be selected.
... selecteventssuppressed boolean this attribute is a boolean indicating whether or not the "select" event should fire when the selection is changed using one of our methods.
... methods adjustselection() called when the row count changes to adjust selection indices.
nsIURI
netwerk/base/public/nsiuri.idlscriptable this is an interface for an uniform resource identifier with internationalization support, offering attributes that allow setting and querying the basic components of a uri, and methods for performing basic operations on uris.
...illa.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); return ioservice.newuri(aurl, aorigincharset, abaseuri); } components of a uri prepath path scheme userpass host port ref ftp :// username@password @ hostname : portnumber /pathname?query=value #ref method overview nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring the uri host with an ascii co...
... this is useful for authentication, managing sessions, or for checking the origin of an uri to prevent cross-site scripting attacks while using methods such as window.postmessage().
... methods clone() clones the uri, returning a new nsiuri object.
nsIUTF8StringEnumerator
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string getnext(); boolean hasmore(); methods getnext() returns the next string in the enumerator.
...this method is generally called within a loop to iterate over the strings in the enumerator.
...this method is generally used to determine whether or not to initiate or continue iteration over the enumerator, athough it can be called without subsequent getnext() calls.
... calling this method doesn't affect the internal state of the enumerator.
nsIUUIDGenerator
1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by @mozilla.org/uuid-generator; as a service: var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); method overview nsidptr generateuuid(); void generateuuidinplace(in nsnonconstidptr id); native code only!
... methods generateuuid() obtains a new uuid using appropriate platform-specific methods to obtain a nsid that can be considered to be globally unique.
...return value this method returns a nsidptr containing a unique id.
... 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.
nsIUpdateChecker
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(in nsiupdatechecklistener listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped.
... current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped.
... any_checks 3 constant for the stopchecking() method indicating that all update checking should be stopped.
... methods checkforupdates() checks for available updates, notifying a listener of the results.
nsIUploadChannel2
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void explicitsetuploadstream(in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders); methods explicitsetuploadstream() sets a stream to be uploaded by this channel with the specified content-type and content-length header values.
... void explicitsetuploadstream( in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders ); parameters astream the stream to be uploaded by this channel.
...acontentlength a value of -1 indicates that the length of the stream should be determined by calling the stream's available method.
... amethod the http request method to set on the stream.
nsIWebBrowserPersist
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 l...
... methods cancelsave() cancels the current operation.
...do not call this method until the document has finished loading!
... saveuri() as of firefox 26, this method should no longer be used from add-on code.
nsIWebContentHandlerRegistrar
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of re...
... contentwindow the dom content window from which the method has been called.
... contentwindow the dom content window from which the method has been called.
... permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler'permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlerservice.allowregisterfromdifferenthost to true as in this code here: var {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/services.jsm"); var nsiwch...
nsIWebProgress
last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance.
... constants the following flags may be combined to form the anotifymask parameter for the addprogresslistener() method.
... these flags indicate the other events to observe, corresponding to the other four methods defined on nsiwebprogresslistener.
... methods addprogresslistener() registers a listener to receive web progress events.
nsIWebSocketChannel
to create an instance, use: var websocketchannel = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiwebsocketchannel); method overview void asyncopen(in nsiuri auri, in acstring aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext); void close(in unsigned short acode, in autf8string areason); void sendbinarymsg(in acstring amsg); void sendmsg(in autf8string amsg); attributes attribute type description extensions acstring sec-websocket...
... methods asyncopen() asynchronously opens the websocket connection.
...the socket listener's methods are called on the thread that calls asyncopen() and are not called until after asyncopen() returns.
... acontext an opaque parameter forwarded to alistener's methods.
nsIWinTaskbar
among these is the addition of the method getoverlayiconcontroller().
... this method is currently known to crash if used under certain conditions.
...to create an instance, use: var wintaskbar = components.classes["@mozilla.org/windows-taskbar;1"] .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 feat...
...methods createjumplistbuilder() retrieve a taskbar jump list builder.
nsIXULWindow
method overview void addchildwindow(in nsixulwindow achild); void applychromeflags(); native code only!
... highestz 9 methods addchildwindow() tell this window that it has picked up a child xul window.note that xul windows do not currently track child xul windows.
... native code only!applychromeflags back-door method to force application of chrome flags at a particular time.
... aappshell the app shell passed to nsiappshellservice's createtoplevelwindow method.
nsIAbCard/Thunderbird3
_aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32 getpropertyasuint32(in string name); [noscript] boolean getpropertyasbool(in string name); void setproperty(in autf8stri...
... methods getproperty() returns a property for the given name.
...however, such constraints might not be checked by this method.
...however, the implementation will not check this constraint at this method.
nsIMsgCloudFileProvider
inherits from: nsisupports method overview void init(in string aaccountkey); void uploadfile(in nsilocalfile afile, in nsirequestobserver acallback); acstring urlforfile(in nsilocalfile afile); void cancelfileupload(in nsilocalfile afile); void refreshuserinfo(in boolean awithui, in nsirequestobserver acallback); void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequ...
... constants the following constants are used for the status codes passed to the onstoprequest functions of the nsirequestobserver's used by the asynchronous methods of nsimsgcloudfileprovider.
... methods init() initializes an nsimsgcloudfileprovider to be associated with a particular account.
... if the provider has no appropriate url for the error, the method returns the empty string.
Using js-ctypes
this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use.
... note: js-ctypes only works with c libraries; you can't use c++ methods directly.
... after you're done when you're finished using a library, you should close it by calling the library object's close() method: lib.close(); if you fail to close the library, it will be automatically closed when it is garbage collected.
...line 6 declares msgbox() to be a method that calls the windows function messageboxw.
CType
these objects have assorted methods and properties that let you create objects of these types, find out information about them, and so forth.
... the specific properties and methods on each object vary depending on the data type represented.
... method overview methods available on all ctype objects ctype array([n]) string tosource() string tostring() properties properties of all ctype objects these properties are available on all ctype objects.
... methods available on all ctype objects array() returns a new ctype representing an array of elements of the type on which it was called.
Int64
note: it's important to note that the 64-bit integer objects created by int64 are not int64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the int64 object.
... method overview number compare(a, b); number hi(a); int64 join(high, low); number lo(a); string tosource(); string tostring([radix]); methods compare() compares two 64-bit integer values.
... tosource() this method is for internal debugging use only.
... warning: do not rely on the value returned by this method, as it's subject to change at any time, depending on the debugging needs of the developers.
Library
the library object represents a native library loaded by the ctypes open() method.
... its methods let you declare symbols exported by the library, and to manage the library.
... method overview close(); cdata declare(name, [abi, ], returntype[, argtype1, ...]); methods close() closes the library.
... alternative syntax another use for ctypes.declare is to get non-function/non-methods from libraries.
UInt64
note: it's important to note that the 64-bit integer objects created by uint64 are not uint64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the uint64 object.
... method overview number compare(a, b); number hi(a); uint64 join(high, low); number lo(a); string tosource(); string tostring([radix]); methods compare() compares two 64-bit integer values.
... tosource() this method is for internal debugging use only.
... warning: do not rely on the value returned by this method, as it's subject to change at any time, depending on the debugging needs of the developers.
Index - Firefox Developer Tools
21 debugger.memory the debugger api can help tools observe the debuggee’s memory use in various ways: 22 debugger.object a debugger.object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent.
... the referent’s properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters.
... 27 debugger.object a debugger.object instance represents an object in the debuggee, providing reflection-oriented methods to inspect and modify its referent.
... the referent's properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters.
ANGLE_instanced_arrays - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
...in webgl2, the functionality of this extension is available on the webgl2 context by default and the constants and methods are available without the "angle" suffix.
... constants this extension exposes one new constant, which can be used in the gl.getvertexattrib() method: ext.vertex_attrib_array_divisor_angle returns a glint describing the frequency divisor used for instanced rendering when used in the gl.getvertexattrib() as the pname parameter.
... methods this extension exposes three new methods.
Background Tasks API - Web APIs
the callback is passed an object which conforms to idledeadline, with didtimeout set to false and a timeremaining() method which is implemented to give the callback 50 milliseconds of time to begin with.
... the window interface is also augmented by this api to offer the new requestidlecallback() and cancelidlecallback() methods.
... <p> demonstration of using <a href="/docs/web/api/background_tasks_api"> cooperatively scheduled background tasks</a> using the <code>requestidlecallback()</code> method.
... the getrandomintinclusive() method comes from the examples for math.random(); we'll just link to it below but it needs to be included here for the example to work.
BaseAudioContext.decodeAudioData() - Web APIs
the decodeaudiodata() method of the baseaudiocontext interface is used to asynchronously decode audio file data contained in an arraybuffer.
... this is the preferred method of creating an audio source for web audio api from an audio track.
... this method only works on complete file data, not fragments of audio file data.
...when the stop() method is called on the source, the source is cleared out.
Using the Beacon API - Web APIs
navigator.sendbeacon() the beacon api's navigator.sendbeacon() method sends a beacon request to the server in the global browsing context.
... the method takes two arguments: the url and the data to send.
... if the browser successfully queues the request for delivery, the method returns true and returns false otherwise.
... window.onsubmit = function send_analytics() { var data = json.stringify({ location: location.href, time: date() }); navigator.sendbeacon('/analytics', data); }; workernavigator.sendbeacon() the beacon api's workernavigator.sendbeacon() method works identically to the usual method, but is accessible from worker global scope.
Blob - Web APIs
WebAPIBlob
the blob object represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a readablestream so its methods can be used for processing the data.
...to create a blob that contains a subset of another blob's data, use the slice() method.
... instance methods blob.prototype.arraybuffer() returns a promise that resolves with an arraybuffer containing the entire contents of the blob as binary data.
...the following code reads the content of a blob as text: const text = await (new response(blob)).text(); or by using blob.prototype.text(): const text = await blob.text(); by using other methods of filereader, it is possible to read the contents of a blob as a string or a data url.
Bluetooth.getDevices() - Web APIs
the getdevices() method of bluetooth interface of web bluetooth api exposes the bluetooth devices this origin is allowed to access.
... this method does not display any permission prompts.
... note: this method returns a bluetoothdevice for each device the origin is currently allowed to access, even the ones that are out of range or powered off.
... exceptions this method doesn't throw any exceptions.
CSSStyleSheet.removeRule() - Web APIs
the obsolete cssstylesheet method removerule() removes a rule from the stylesheet object.
... it is functionally identical to the standard, preferred method deleterule().
... note: this is a legacy method which has been replaced by the standard method deleterule().
... mystyles.removerule(0); you can rewrite this to use the standard deleterule() method very easily: mystyles.deleterule(0); specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.removerule()' in that specification.
CSSStyleSheet - Web APIs
it inherits properties and methods from its parent, stylesheet.
... this is normally used to access individual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods.
... methods inherits methods from its parent, stylesheet.
... legacy methods these methods are legacy methods first introduced by microsoft; they should not be used if they can be avoided, but are not in danger of being removed anytime soon.
CacheStorage.match() - Web APIs
the match() method of the cachestorage interface checks if a given request or url string is a key for a stored response.
... this method returns a promise for a response, or a promise which resolves to undefined if no match is found.
... note: caches.match() is a convenience method.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
CanvasRenderingContext2D.createLinearGradient() - Web APIs
the canvasrenderingcontext2d.createlineargradient() method of the canvas 2d api creates a gradient along the line connecting two given coordinates.
... this method returns a linear canvasgradient.
... syntax canvasgradient ctx.createlineargradient(x0, y0, x1, y1); the createlineargradient() method is specified by four parameters defining the start and end points of the gradient line.
... examples filling a rectangle with a linear gradient this example initializes a linear gradient using the createlineargradient() method.
CanvasRenderingContext2D.createPattern() - Web APIs
the canvasrenderingcontext2d.createpattern() method of the canvas 2d api creates a pattern using the specified image and repetition.
... this method returns a canvaspattern.
... this method doesn't draw anything to the canvas directly.
... examples creating a pattern from an image this example uses the createpattern() method to create a canvaspattern with a repeating source image.
CanvasRenderingContext2D.createRadialGradient() - Web APIs
the canvasrenderingcontext2d.createradialgradient() method of the canvas 2d api creates a radial gradient using the size and coordinates of two circles.
... this method returns a canvasgradient.
... syntax canvasgradient ctx.createradialgradient(x0, y0, r0, x1, y1, r1); the createradialgradient() method is specified by six parameters, three defining the gradient's start circle, and three defining the end circle.
... examples filling a rectangle with a radial gradient this example initializes a radial gradient using the createradialgradient() method.
CanvasRenderingContext2D.fillRect() - Web APIs
the canvasrenderingcontext2d.fillrect() method of the canvas 2d api draws a rectangle that is filled according to the current fillstyle.
... this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it.
... syntax void ctx.fillrect(x, y, width, height); the fillrect() method draws a filled rectangle whose starting point is at (x, y) and whose size is specified by width and height.
... examples a simple filled rectangle this example draws a filled green rectangle using the fillrect() method.
CanvasRenderingContext2D.fillText() - Web APIs
the canvasrenderingcontext2d method filltext(), part of the canvas 2d api, draws a text string at the specified coordinates, filling the string's characters with the current fillstyle.
... this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it.
... to draw the outlines of the characters in a string, call the context's stroketext() method.
... examples drawing filled text this example writes the words "hello world" using the filltext() method.
CanvasRenderingContext2D.strokeRect() - Web APIs
the canvasrenderingcontext2d.strokerect() method of the canvas 2d api draws a rectangle that is stroked (outlined) according to the current strokestyle and other context settings.
... this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it.
... syntax void ctx.strokerect(x, y, width, height); the strokerect() method draws a stroked rectangle whose starting point is at (x, y) and whose size is specified by width and height.
... examples a simple stroked rectangle this example draws a rectangle with a green outline using the strokerect() method.
CanvasRenderingContext2D.strokeText() - Web APIs
the canvasrenderingcontext2d method stroketext(), part of the canvas 2d api, strokes — that is, draws the outlines of — the characters of a text string at the specified coordinates.
... this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it.
... use the filltext() method to fill the text characters rather than having just their outlines drawn.
... examples drawing text outlines this example writes the words "hello world" using the stroketext() method.
CanvasRenderingContext2D.translate() - Web APIs
the canvasrenderingcontext2d.translate() method of the canvas 2d api adds a translation transformation to the current matrix.
... syntax void ctx.translate(x, y); the translate() method adds a translation transformation to the current matrix by moving the canvas and its origin x units horizontally and y units vertically on the grid.
... examples moving a shape this example draws a square that is moved from its default position by the translate() method.
... html <canvas id="canvas"></canvas> javascript the translate() method translates the context by 110 horizontally and 30 vertically.
Basic animations - Web APIs
the easiest way to do this is using the clearrect() method.
... controlling an animation shapes are drawn to the canvas by using the canvas methods directly or by calling custom functions.
... in the examples below, we'll use the window.requestanimationframe() method to control the animation.
... the requestanimationframe method provides a smoother and more efficient way for animating by calling the animation frame when the system is ready to paint the frame.
Basic usage of canvas - Web APIs
the <canvas> element has a method called getcontext(), used to obtain the rendering context and its drawing functions.
... 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.
... once you have the element node, you can access the drawing context using its getcontext() method.
...scripts can also check for support programmatically by simply testing for the presence of the getcontext() method.
Hit regions and accessibility - Web APIs
the api has the following three methods (which are still experimental in current web browsers; check the browser compatibility tables).
... <canvas id="canvas"></canvas> <script> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi, false); ctx.fill(); ctx.addhitregion({id: 'circle'}); canvas.addeventlistener('mousemove', function(event) { if (event.region) { alert('hit region: ' + event.region); } }); </script> the addhitregion() method also takes a control option to route events to an element (that is a descendant of the canvas): ctx.addhitregion({control: element}); this can be useful for routing to <input> elements, for example.
... canvasrenderingcontext2d.drawfocusifneeded() if a given element is focused, this method draws a focus ring around the current path.
... additionally, the scrollpathintoview() method can be used to make an element visible on the screen if focused, for example.
Clipboard.read() - Web APIs
WebAPIClipboardread
the read() method of the clipboard interface requests a copy of the clipboard's contents, delivering the data to the returned promise when the promise is resolved.
... unlike readtext(), the read() method can return arbitrary data, such as images.
... this method can also return text.
...be sure to review the compatibility table before using these methods.
ClipboardItem - Web APIs
note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface.
... methods this interface defines the following methods.
... examples writing to clipboard here we're writing a new clipboarditem.clipboarditem() to the clipboard by requesting a png image using the fetch api, and in turn, the responses' blob() method, to create the new clipboarditem.
...e.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } reading from the clipboard here we're returning all items on the clipboard via the clipboard.read() method.
CloseEvent.initCloseEvent() - Web APIs
the closeevent.initcloseevent() method initializes the value of a close event once it's been created (normally using the document.createevent() method).
... events initialized in this way must have been created with the document.createevent() method.
... this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
... do not use this method anymore as it is deprecated.
Constraint validation API - Web APIs
extensions to other interfaces the constraint validation api extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validitystate object, whose properties represent validation errors for the value of that element.
... methods checkvalidity() checks the element's value against its constraints.
... reportvalidity() htmlformelement method checks the element's value against its constraints and also reports the validity status; if the value is invalid, it fires an invalid event at the element, returns false, and then reports the validity status to the user in whatever way the user agent has available.
...try again!'); } }); the example renders like so: in brief: we check the valid state of the input element every time its value is changed by running the checkvalidity() method via the input event handler.
ContentIndex.delete() - Web APIs
the delete() method of the contentindex interface unregisters an item from the currently indexed content.
... syntax contentindex.delete(id).then(...); parameters this method receives no parameters.
...we receive a reference to the current serviceworkerregistration, which allows us to access the index property and thus access the delete method.
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } the delete method can also be used within the service worker scope.
CredentialsContainer.get() - Web APIs
the get() method of the credentialscontainer interface returns a promise to a single credential instance that matches the provided parameters.
... this method first collects all credentials in the credentialscontainer that meet the necessary criteria (defined in the options argument).
... this method collects credentials by calling the "collectfromcredentialstore" method for each credential type allowed by the options argument.
... this method is restricted to top-level contexts.
DOMMatrix - Web APIs
WebAPIDOMMatrix
2d 3d equivalent a m11 b m12 c m21 d m22 e m41 f m42 methods this interface includes the following methods, as well as the methods it inherits from dommatrixreadonly.
...this is equivalent to the dot product a⋅b, where matrix a is the source matrix and b is the matrix given as an input to the method.
...this is equivalent to the dot product b⋅a, where matrix a is the source matrix and b is the matrix given as an input to the method.
... static methods this interface inherits methods from dommatrixreadonly.
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.
... syntax the scale() method is specified with either one or six values.
... three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 25 25"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> <rect id="transformedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter.
... we test if the browser supports a six parameter scale() method by creating a new matrix using three parameters and observing it's is2d property — if this is false then the third parameter has been accepted by the browser as a scalez parameter, making this a 3d matrix.
DOMParser - Web APIs
WebAPIDOMParser
syntax let domparser = new domparser()​​ methods domparser.parsefromstring() syntax let doc = domparser.parsefromstring(string, mimetype) return either document or xmldocument depending on the mimetype argument.
... parameters this method has 2 parameters (both required): string the domstring to be parsed.
...this string determines a class of the the method's return value.
...lowing: mimetype doc.constructor text/html document text/xml xmldocument application/xml xmldocument application/xhtml+xml xmldocument image/svg+xml xmldocument examples parsing xml once you have created a parser object, you can parse xml from a string using the parsefromstring() method: let parser = new domparser() let doc = parser.parsefromstring(stringcontainingxmlsource, "application/xml") error handling note that if the parsing process fails, the domparser does not throw an exception, but instead returns an error document: <parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml"> (error description) <sourcetext>(a snippet of the source xml)</source...
DOMPointInit.w - Web APIs
WebAPIDOMPointInitw
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.
... this method is, by inheritance, also available as dompoint.frompoint().
... the dompointreadonly.tojson() method returns a dompointinit object that describes the same point as the original point.
... by inheritance, this method is also available as dompoint.tojson().
DOMPointInit.y - Web APIs
WebAPIDOMPointInity
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.
... this method is, by inheritance, also available as dompoint.frompoint().
... the dompointreadonly.tojson() method returns a dompointinit object that describes the same point as the original point.
... by inheritance, this method is also available as dompoint.tojson().
DOMPointInit.z - Web APIs
WebAPIDOMPointInitz
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.
... this method is, by inheritance, also available as dompoint.frompoint().
... the dompointreadonly.tojson() method returns a dompointinit object that describes the same point as the original point.
... by inheritance, this method is also available as dompoint.tojson().
DataTransfer.getData() - Web APIs
the datatransfer.getdata() method retrieves drag data (as a domstring) for the specified type.
... if the drag operation does not include data, this method returns an empty string.
...if the drag operation has no data or the operation has no data for the specified format, this method returns an empty string.
... example this example shows the use of the datatransfer object's getdata() and setdata() methods.
DataTransfer.mozSetDataAt() - Web APIs
the datatransfer.mozsetdataat() method is used to add data to a specific index in the drag event's data transfer object.
... note: this method is gecko-specific.
... return value void example this example shows the use of the mozsetdataat() method in a dragstart handler.
... function dragstart_handler(event) { var dt = event.datatransfer; var idx = dt.mozitemcount; // add two new items to the drag transfer if (idx >= 0) { dt.mozsetdataat("text/uri-list","http://www.example.com/", idx); dt.mozsetdataat("text/html", "hello world", idx+1); } } specifications this method is not defined in any web standard.
DataTransfer.mozTypesAt() - Web APIs
the datatransfer.moztypesat() method returns a list of the format types that are stored for an item at the specified index.
... note: this method is gecko-specific.
... example this example shows the use of the moztypesat() method in a drop event handler.
... i < count; i++) { output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) { output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i); output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) { output("<>\n"); dump(ex); } } } } specifications this method is not defined in any web standard.
DataTransfer.setDragImage() - Web APIs
however, if a custom image is desired, the datatransfer.setdragimage() method can be used to set the custom image to be used.
... the method's x and y coordinates define how the image should appear relative to the mouse pointer.
... this method must be called in the dragstart event handler.
... return value void example this example shows how to use the setdragimage() method.
DirectoryReaderSync - Web APIs
basic concepts before you call the only method in this interface, readentries(), create the directoryentrysync object.
... if (!data.cmd || data.cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory.
... call this method until an empty array is returned.
... entrysync readentries ( ) raises (fileexception); returns parameter none exceptions this method can raise a fileexception with the following codes: exception description not_found_err the directory does not exist.
Document.createTouch() - Web APIs
note: before gecko 25.0, this method was defined on the documenttouch mixin.
... the document.createtouch() method creates and returns a new touch object.
... note: previous versions of this method included the following additional parameters but those parameters are not included in either of the standards listed below.
... example this example illustrates using the document.createtouch() method to create touch objects.
Document.getElementsByTagNameNS() - Web APIs
note: while the w3c specification says elements is a nodelist, this method returns a htmlcollection both in gecko and internet explorer.
... opera returns a nodelist, but with a nameditem method implemented, which makes it similar to a htmlcollection.
... note: currently parameters in this method are case-sensitive, but they were case-insensitive in firefox 3.5 and before.
... note that when the node on which getelementsbytagname is invoked is not the document node, in fact the element.getelementsbytagnamens method is used.
DocumentFragment - Web APIs
methods this interface inherits the methods of its parent, node, and implements those of the parentnode interface.
... 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().
... an empty documentfragment can be created using the document.createdocumentfragment() method or the constructor.
... obsolete added the queryselector() and queryselectorall() methods.
DocumentOrShadowRoot.getSelection() - Web APIs
example function foo() { var selobj = document.getselection(); alert(selobj); var selrange = selobj.getrangeat(0); // do stuff with the range } notes string representation of the selection object in javascript, when an object is passed to a function expecting a string (like window.alert()), the object's tostring() method is called and the returned value is passed to the function.
... this can make the object appear to be a string when used with other functions when it is really an object with properties and methods.
...however, attempting to use a javascript string property or method such as length or substr directly on a selection object results in an error if it does not have that property or method and may return unexpected results if it does.
... to use a selection object as a string, call its tostring() method directly: var selectedtext = selobj.tostring(); selobj is a selection object.
Events and the DOM - Web APIs
eventtarget.addeventlistener // assuming mybutton is a button element mybutton.addeventlistener('click', greet, false) function greet(event){ // print and have a look at the event object // always print arguments in case of overlooking any other arguments console.log('greet:', arguments) alert('hello world') } this is the method you should use in modern web pages.
... note: internet explorer 6–8 didn't support this method, offering a similar eventtarget.attachevent api instead.
... warning: this method should be avoided!
... the problem with this method is that only one handler can be set per element and per event.
FileReader.readyState - Web APIs
none of the read methods called yet.
... 1 loading a read method has been called.
... empty the filereader has been created, but no readas method was called yet.
... loading a readas method was invoked.
FileSystemEntry - Web APIs
it includes methods for working with files—including copying, moving, removing, and reading files—as well as information about a file it points to—including the file name and its path from the root to the entry.
... the filesystementry interface includes methods that you would expect for manipulating files and directories, but it also includes a convenient method for obtaining the url of the entry: tourl().
... example to see an example of how tourl() works, see the method description.
... methods this interface defines the following methods.
File and Directory Entries API support in Firefox - Web APIs
using drag and drop by calling the datatransferitem.getasentry() method, which lets you get a filesystemfileentry or filesystemdirectoryentry for files dropped on a drop zone.
... you can't use the localfilesystem.requestfilesystem() method to get access to a specified local file system.
... the localfilesystem.resolvelocalfilesystemurl() method isn't implemented.
...in particular, the filesystemfileentry.createwriter() method, used to create a filewriter to handle writing to a file, is not implemented and will just treturn an error.
FormData.get() - Web APIs
WebAPIFormDataget
the get() method of the formdata interface returns the first value associated with a given key from within a formdata object.
... if you expect multiple values and want all of them, use the getall() method instead.
... note: this method is available in web workers.
...if the key doesn't exist, the method returns null.
GainNode - Web APIs
WebAPIGainNode
to prevent this from happening, never change the value directly but use the exponential interpolation methods on the audioparam interface.
...you shouldn't manually create a gain node; instead, use the method audiocontext.creategain().
...you have to set audioparam.value or use the methods of audioparam to change the effect of gain.
... methods no specific method; inherits methods from its parent, audionode.
Geolocation API - Web APIs
in both cases, the method call takes up to three arguments: a mandatory success callback: if the location retrieval is successful, the callback executes with a geolocationposition object as its only parameter, providing access to the location data.
... interfaces geolocation the main class of this api — contains methods to retrieve the user's current position, watch for changes in their position, and clear a previously-set watch.
...a geolocationposition instance is returned by a successful call to one of the methods contained inside geolocation, inside a success callback, and contains a timestamp plus a geolocationcoordinates object instance.
... geolocationpositionerror a geolocationpositionerror is returned by an unsuccessful call to one of the methods contained inside geolocation, inside an error callback, and contains an error code and message.
HTMLAnchorElement - Web APIs
the htmlanchorelement interface represents hyperlink elements and provides special properties and methods (beyond those of the regular htmlelement object interface that they inherit from) for manipulating the layout and presentation of such elements.
... methods inherits methods from its parent, htmlelement, and implements those from htmlhyperlinkelementutils.
... the blur() and focus() methods are inherited from htmlelement from html5 on, but were defined on htmlanchorelement in dom level 2 html and earlier specifications.
... recommendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement.
HTMLDialogElement.close() - Web APIs
the close() method of the htmldialogelement interface closes the dialog.
... examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method.
... from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); ...
HTMLDialogElement.show() - Web APIs
the show() method of the htmldialogelement interface displays the dialog modelessly, i.e.
... examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the show() method.
... from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); ...
HTMLDialogElement.showModal() - Web APIs
the showmodal() method of the htmldialogelement interface displays the dialog as a modal, over the top of any other dialogs that might be present.
... examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method.
... from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); ...
HTMLDialogElement - Web APIs
the htmldialogelement interface provides methods to manipulate <dialog> elements.
... it inherits properties and methods from the htmlelement interface.
... methods inherits methods from its parent, htmlelement.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <b...
HTMLFormElement.requestSubmit() - Web APIs
the htmlformelement method requestsubmit() requests that the form be submitted using a specific submit button.
... syntax htmlformelement.requestsubmit(submitter); parameters submitter optional the submit button whose attributes describe the method by which the form is to be submitted.
... usage notes the obvious question is: why does this method exist, when we've had the submit() method since the dawn of time?
... if, on the other hand, requestsubmit() isn't available, this code falls back to calling the form's submit() method.
HTMLMediaElement: pause event - Web APIs
the pause event is sent when a request to pause an activity is handled and the activity has entered its paused state, most commonly after the media has been paused through a call to the element's pause() method.
... the event is sent once the pause() method returns and after the media element's paused property has been changed to true.
...either the ' + 'pause() method was called or the autoplay attribute was toggled.'); }); using the onpause event handler property: const video = document.queryselector('video'); video.onpause = (event) => { console.log('the boolean paused property is now true.
... either the ' + 'pause() method was called or the autoplay attribute was toggled.'); }; specifications specification status html living standardthe definition of 'pause media event' in that specification.
HTMLScriptElement - Web APIs
html <script> elements expose the htmlscriptelement interface, which provides special properties and methods for manipulating the behavior and execution of <script> elements (beyond the inherited htmlelement interface).
...these algorithms describe the core ideas, but they rely on the parsing rules for <script> start and end tags in html, in foreign content, and in xml; the rules for the document.write() method; the handling of scripting; and so on.
... note: when inserted using the document.write() method, <script> elements execute (typically synchronously), but when inserted using innerhtml or outerhtml, they do not execute at all.
... methods no specific methods; inherits methods from its parent, htmlelement.
HTMLTableElement - Web APIs
the htmltableelement interface provides special properties and methods (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an html document.
... methods inherits methods from its parent, htmlelement.
... living standard added the sortable property and the stopsorting() method.
... recommendation added the createtbody() method.
HTMLVideoElement - Web APIs
the htmlvideoelement interface provides special properties and methods for manipulating video objects.
... it also inherits properties and methods of htmlmediaelement and htmlelement.
... methods inherits methods from its parent, htmlmediaelement, and from its ancestor htmlelement.
... events inherits methods from its parent, htmlmediaelement, and from its ancestor htmlelement.
IDBCursor.continuePrimaryKey() - Web APIs
the continueprimarykey() method of the idbcursor interface advances the cursor to the to the item whose key matches the key parameter as well as whose primary key matches the primary key parameter.
... calling this method more than once before new cursor data has been loaded - for example, calling continueprimarykey() twice from the same onsuccess handler - results in an invalidstateerror being thrown on the second call because the cursor’s got value flag has been unset.
... this method is only valid for cursors coming from an index.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
databases - Web APIs
the databases method of the idbfactory interface returns a list represening all the available databases, including their names and versions.
... note: this method is introduced in a draft of a specifications and browser compatibility is limited.
... syntax const promise = indexeddb.databases() parameters the method does not take in any parameters.
... exceptions this method may raise a domexception of the following types: attribute description securityerror the method is called from an opaque origin.
IDBFactory.deleteDatabase() - Web APIs
the deletedatabase() method of the idbfactory interface requests the deletion of a database.
... the method returns an idbopendbrequest object immediately, and performs the deletion operation asynchronously.
... if the database is successfully deleted, then a success event is fired on the request object returned from this method, with its result set to undefined.
... if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method.
IDBFactory - Web APIs
methods idbfactory.open the current method to request opening a connection to a database.
... idbfactory.deletedatabase a method to request the deletion of a database.
... idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value.
... idbfactory.databases a method that returns a list of all available databases, including their names and versions.
IDBObjectStore.add() - Web APIs
the add() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store.
... the add method is an insert only method.
...for updating existing records, you should use the idbobjectstore.put method instead.
... 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.createIndex() - Web APIs
the createindex() method of the idbobjectstore interface creates and returns a new idbindex object in the connected database.
... note that this method must be called only from a versionchange transaction mode callback.
... 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.
... invalidstateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e.
IDBObjectStore.deleteIndex() - Web APIs
the deleteindex() method of the idbobjectstore interface destroys the index with the specified name in the connected database, used during a version upgrade.
... note that this method must be called only from a versionchange transaction mode callback.
... note that this method synchronously modifies the idbobjectstore.indexnames property.
... 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.getAllKeys() - Web APIs
the getallkeys() method of the idbobjectstore interface returns an idbrequest object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.
... this method produces the same result for: a record that doesn't exist in the database a record that has an undefined value to tell these situations apart, you need to call the opencursor() method with the same key.
... that method provides a cursor if the record exists, and no cursor if it does not.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.put() - Web APIs
the put() method of the idbobjectstore interface updates a given record in a database, or inserts a new record if the given item does not already exist.
... the put method is an update or insert method.
... see the idbobjectstore.add method for an insert only method.
... 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.
IDBTransaction.objectStore() - Web APIs
the objectstore() method of the idbtransaction interface returns an object store that has already been added to the scope of this transaction.
... every call to this method on the same transaction object, with the same name, returns the same idbobjectstore instance.
... if this method is called on a different transaction object, a different idbobjectstore instance is returned.
... 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.
startSoftwareUpdate - Web APIs
method of installtrigger object syntax boolean startsoftwareupdate ( string url); parameters the startsoftwareupdate method has the following parameter: url a uniform resource locator specifying the location of the xpi file containing the software.
... description the startsoftwareupdate method triggers a software download and install from the specified url.
... this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi.
... note also that xpis installed with this method must have their own install.js files in which the full installation is defined.
Timing element visibility with the Intersection Observer API - Web APIs
if the document has just become visible, we reverse this process: first we go through previouslyvisibleads and set each one's dataset.lastviewstarted to the current document's time (in milliseconds since the document was created) using the performance.now() method.
...the string.padstart() method is used to ensure that the number of seconds is padded out to two digits if it's less than 10.
...articles are inserted into the content box (that is, the <main> element that contains all the site content) after being created using a method called createarticle(), which we'll look at next.
...then we call the observe() method on our intersection observer, adobserver, to start watching the ad for changes to its intersection with the viewport.
Intersection Observer API - Web APIs
implementing intersection detection in the past involved event handlers and loops calling methods like element.getboundingclientrect() to build up the needed information for every element affected.
...provides methods for creating and managing an observer which can watch any number of target elements for the same intersection configuration.
... we call window.addeventlistener() to start listening for the load event; once the page has finished loading, we get a reference to the element with the id "box" using queryselector(), then call the createobserver() method we'll create in a moment to handle building and installing the intersection observer.
... creating the intersection observer the createobserver() method is called once page load is complete to handle actually creating the new intersectionobserver and starting the process of observing the target element.
Key Values - Web APIs
accepts the currently selected option or input method sequence conversion.
... ime and composition keys keys used when using an input method editor (ime) to input text which can't readily be entered by simple keypresses, such as text in languages such as those which have more graphemes than there are character entry keys on the keyboard.
... gdk_key_multi_key (0xff20) [1] qt::key_multi_key (0x01001120) "convert" [4] the convert key, which instructs the ime to convert the current input method sequence into the resulting character.
...this accepts the current input method sequence without running conversion when using an ime.
MSCandidateWindowHide - Web APIs
mscandidatewindowhide fires after the input method editor (ime) candidate window closes and is fully hidden.
... this proprietary method is specific to internet explorer.
... syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mscandidatewindowhide", handler, usecapture) nbsp; parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
... the handler of this event will see that the iscandidatewindowvisible method returns false, and no clientrect object is returned from getcandidatewindowclientrect.
MSCandidateWindowShow - Web APIs
mscandidatewindowshow fires immediately after the input method editor (ime) candidate window is set to appear, but before it renders.
... this proprietary method is specific to internet explorer.
... syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
...you can obtain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window.
MSGestureEvent - Web APIs
though the msgestureevent.initgestureevent() method is kept for backward compatibility, the creation of an msgestureevent object should be done using the msgestureevent() constructor.
... methods this interface also inherits methods of its parents, uievent and event.
...if the event has already being dispatched, this method does nothing.
... this method is deprecated as of microsoft edge.
MediaQueryList - Web APIs
methods the mediaquerylist interface inherits methods from its parent interface, eventtarget.
...this method exists primarily for backward compatibility; if possible, you should instead use addeventlistener() to watch for the change event.
...this method has been kept for backward compatibility; if possible, you should generally use removeeventlistener() to remove change notification callbacks (which should have previously been added using addeventlistener()).
... you can find other examples on the individual property and method pages.
MouseEvent.initMouseEvent() - Web APIs
the mouseevent.initmouseevent() method initializes the value of a mouse event once it's been created (normally using the document.createevent() method).
... events initialized in this way must have been created with the document.createevent() method.
... this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
... do not use this method anymore as it is deprecated.
Navigator.requestMediaKeySystemAccess() - Web APIs
the navigator.requestmediakeysystemaccess() method returns a promise which delivers a mediakeysystemaccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream.
... this method is part of the encrypted media extensions api, which brings support for encrypted media and drm-protected video to the web.
... this method may have user-visible effects such as asking for permission to access one or more system resources.
...as a general rule, this function should be called only when it's about time to create and use a mediakeys object by calling the returned mediakeysystemaccess object's createmediakeys() method.
Navigator.vibrate() - Web APIs
WebAPINavigatorvibrate
the navigator.vibrate() method pulses the vibration hardware on the device, if such hardware exists.
... if the device doesn't support vibration, this method has no effect.
... if a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead.
... if the method was unable to vibrate because of invalid parameters, it will return false, else it returns true.
NavigatorID - Web APIs
the navigatorid interface contains methods and properties related to the identity of the browser.
... methods the navigatorid interface doesn't inherit any methods.
...this method is only kept for compatibility purposes.
... living standard added the appcodename property and the taintenabled() method, for compatibility purpose.
Node.removeChild() - Web APIs
WebAPINoderemoveChild
the node.removechild() method removes a child node from the dom and returns the removed node.
... if child is actually not a child of the element node, the method throws an exception.
... this will also happen if child was in fact a child of element at the time of the call, but was removed by an event handler invoked in the course of trying to remove the element (e.g., blur.) errors thrown the method throws an exception in 2 different ways: if the child was in fact a child of element and so existing on the dom, but was removed the method throws the following exception: uncaught notfounderror: failed to execute 'removechild' on 'node': the node to be removed is not a child of this node.
... if the child doesn't exist on the dom of the page, the method throws the following exception: uncaught typeerror: failed to execute 'removechild' on 'node': parameter 1 is not of type 'node'.
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.
... this method offers the convenience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone, import, or rename operations.
... the node.getuserdata and node.setuserdata methods are no longer available from web content.
... handler is a callback which will be called any time the node is being cloned, imported, renamed, as well as if deleted or adopted; a function can be used or an object implementing the handle method (part of the userdatahandler interface).
NodeIterator.nextNode() - Web APIs
the nodeiterator.nextnode() method returns the next node in the set represented by the nodeiterator and advances the position of the iterator within the set.
... this method returns null when there are no nodes left in the set.
... 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.
... living standard as detach() is now a no-op method, this method cannot throw anymore.
NodeIterator.previousNode() - Web APIs
the nodeiterator.previousnode() method returns the previous node in the set represented by the nodeiterator and moves the position of the iterator backwards within the set.
... this method returns null when the current node is the first node in the set.
... 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.
... living standard as detach() is now a no-op method, this method cannot throw anymore.
NodeIterator - Web APIs
syntax a nodeiterator can be created using the document.createnodeiterator() method, as follows: const nodeiterator = document.createnodeiterator(root, whattoshow, filter); properties this interface doesn't inherit any property.
... methods this interface doesn't inherit any method.
... the method detach() has been changed to be a no-op.
... the methods previousnode() and nextnode() don't raise an exception any more.
NodeList - Web APIs
WebAPINodeList
nodelist objects are collections of nodes, usually returned by properties such as node.childnodes and methods such as document.queryselectorall().
...the ubiquitous document.queryselectorall() method returns a static nodelist.
... methods nodelist.item() returns an item in the list by its index, or null if the index is out-of-bounds.
... for...of loops will loop over nodelist objects correctly: const list = document.queryselectorall('input[type=checkbox]'); for (let checkbox of list) { checkbox.checked = true; } recent browsers also support iterator methods (foreach()) as well as entries(), values(), and keys().
OES_vertex_array_object - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
...in webgl2, the functionality of this extension is available on the webgl2 context by default and the constants and methods are available without the "oes" suffix.
... constants this extension exposes one new constant, which can be used in the gl.getparameter() method: ext.vertex_array_binding_oes returns a webglvertexarrayobject object when used in the gl.getparameter() method as the pname parameter.
... methods this extension exposes four new methods.
OscillatorNode - Web APIs
an oscillatornode is created using the baseaudiocontext.createoscillator() method.
... if the default values are acceptable, you can simply call the baseaudiocontext.createoscillator() factory method.
... methods inherits methods from its parent, audioscheduledsourcenode, and adds the following: oscillatornode.setperiodicwave() sets a periodicwave which describes a periodic waveform to be used instead of one of the standard waveforms; calling this sets the type to custom.
... this replaces the now-obsolete oscillatornode.setwavetable() method.
PannerNode.setPosition() - Web APIs
the setposition() method of the pannernode interface defines the position of the audio source relative to the listener (represented by an audiolistener object stored in the audiocontext.listener attribute.) the three parameters x, y and z are unitless and describe the source's position in 3d space using the right-hand cartesian coordinate system.
... the setposition() method's default value of the position is (0, 0, 0).
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
PannerNode.setVelocity() - Web APIs
the setvelocity() method of the pannernode interface defines the velocity vector of the audio source — how fast it is moving and in what direction.
... this method was removed from the specification because of gaps in its design and implementation problems.
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
PaymentAddress - Web APIs
methods paymentaddress.tojson() a standard serializer that returns a json representation of the paymentaddress object's properties.
... examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options.
... const supportedinstruments = [ { supportedmethods: "basic-card", }, ]; const details = { total: { label: "donation", amount: { currency: "usd", value: "65.00" } }, displayitems: [ { label: "original donation amount", amount: { currency: "usd", value: "65.00" }, }, ], shippingoptions: [ { id: "standard", label: "standard shipping", amount: { currency: "usd", value: "0.00" }, selected: true, }, ], }; const options = { requestshipping: true }; async function dopaymentrequest() { const request = new paymentrequest(supportedinstruments, details, option...
... const json = response.tojson(); const httpresponse = await fetch("/pay/", { method: "post", body: json }); const result = httpresponse.ok ?
performance.getEntries() - Web APIs
the getentries() method returns a list of all performanceentry objects for the page.
... the list's members (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time.
... example function use_performanceentry_methods() { console.log("performanceentry tests ..."); if (performance.mark === undefined) { console.log("...
... performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); performance.mark("begin"); do_work(100000); performance.mark("end"); do_work(200000); performance.mark("end"); // use getentries() to iterate through the each entry let p = performance.getentries(); for (var i=0; i < p.length; i++) { console.log("entry[" + i + "]"); check_performanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.getentriesbytype("mark"); for (let i=0; i < p.length; i++) { console.log ("mark only entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); ...
performance.getEntriesByName() - Web APIs
the getentriesbyname() method returns a list of performanceentry objects for the given name and type.
... the list's members (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time.
... example function use_performanceentry_methods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("...
... performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); performance.mark("begin"); do_work(100000); performance.mark("end"); do_work(200000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } // use getentries(name, entrytype) to get specific entries p = performance.getentries({name : "begin", entrytype: "mark"}); for (var i=0; i < p.length; i++) { log("begin[" + i + "]"); check_performanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performan...
performance.getEntriesByType() - Web APIs
the getentriesbytype() method returns a list of performanceentry objects for a given type.
... the list's members (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time.
... example function useperformanceentrymethods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("...
... performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); dowork(50000); performance.mark("end"); performance.mark("begin"); dowork(100000); performance.mark("end"); dowork(200000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); checkperformanceentry(p[i]); } // use getentries(name, entrytype) to get specific entries p = performance.getentries({name : "begin", entrytype: "mark"}); for (var i=0; i < p.length; i++) { log("begin[" + i + "]"); checkperformanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.ge...
PerformanceObserverEntryList.getEntries() - Web APIs
the getentries() method of the performanceobserverentrylist interface returns a list of explicitly observed performance entry objects for a given filter.
... the list's members are determined by the set of entry types specified in the call to the observe() method.
... this method is exposed to window and worker interfaces.
...the valid entry types are listed in the performanceentry.entrytype method.
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the getentriesbyname() method of the performanceobserverentrylist interface returns a list of explicitly observed performance entry objects for a given name and entry type.
... the list's members are determined by the set of entry types specified in the call to the observe() method.
... this method is exposed to window and worker interfaces.
... candidate recommendation initial definition of getentriesbyname() method.
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the getentriesbytype() method of the performanceobserverentrylist returns a list of explicitly observed performance entry objects for a given performance entry type.
... the list's members are determined by the set of entry types specified in the call to the observe() method.
... this method is exposed to window and worker interfaces.
... candidate recommendation initial definition of getentriesbytype() method.
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
isuserverifyingplatformauthenticatoravailable() is a static method of the publickeycredential interface that returns a promise which resolves to true if a user-verifying platform authenticator is available.
... at the time of this writing, this method's result only resolves to true on windows when windows hello capabilities are available (on recent versions of this os).
... note: this method may only be used in top-level contexts and will not be available in an <iframe> for example.
... note: this is a static method which is directly called on the publickeycredential interface and not on an instance.
PushManager.register() - Web APIs
the register method is used to ask the system to request a new endpoint for notifications.
... this method has been superceded by pushmanager.subscribe().
... syntax var request = navigator.push.register(); return a domrequest object to handle the success or failure of the method call.
... if the method call is successful, the request's result will be a string, which is the endpoint url.
PushManager.unregister() - Web APIs
the unregister() method was used to ask the system to unregister and delete the specified endpoint.
... in the updated api, a subscription is can be unregistered via the pushsubscription.unsubscribe() method.
... return a domrequest object to handle the success or failure of the method call.
... if the method call is successful, the request's result will be a pushregistration object representing the endpoint that has been unregistered.
PushMessageData - Web APIs
the pushmessagedata interface of the push api provides methods which let you retrieve the push data sent by a server in various formats.
... unlike the similar methods in the fetch api, which only allow the method to be invoked once, these methods can be called multiple times.
... messages received through the push api are sent encrypted by push services and then automatically decrypted by browsers before they are made accessible through the methods of the pushmessagedata interface.
... methods pushmessagedata.arraybuffer() extracts the data as an arraybuffer object.
RTCDataChannel.close() - Web APIs
the rtcdatachannel.close() method closes the rtcdatachannel.
... either peer is permitted to call this method to initiate closure of the channel.
... the sequence of events which occurs in response to this method being called: rtcdatachannel.readystate is set to "closing".
... in firefox, the rtcdatachannel interface was implemented under the name datachannel until firefox 24, so this method was called datachannel.close().
RTCPeerConnection.addTrack() - Web APIs
the rtcpeerconnection method addtrack() adds a new media track to the set of tracks which will be transmitted to the other peer.
... reused senders this method may return either a new rtcrtpsender or, under very specific circumstances, an existing compatible sender which has not yet been used to transmit data.
... the sender's set of associated streams is set to the list of streams passed into this method, stream....
...it comes from the handlevideooffermsg() method there, which is called when an offer message is received from the remote peer.
RTCPeerConnection.close() - Web APIs
the rtcpeerconnection.close() method closes the current peer connection.
... syntax peerconnection.close(); this method has no parameters, and returns nothing.
... calling this method terminates the rtcpeerconnection's ice agent, ending any ongoing ice processing and any active streams.
... once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrtpcodeccapability objects specifying the new preferences for each codec.
... the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again.
...if any unsupported codecs are listed, the browser will throw an invalidaccesserror exception when you call this method.
... to determine which codecs are supported by the transceiver, call the sender's getcapabilities() and the receiver's getcapabilities() methods and get the codecs list from the results of each.
Request() - Web APIs
WebAPIRequestRequest
the possible options are: method: the request method, e.g., get, post.
...note that a request using the get or head method cannot have a body.
...hen(function(response) { var objecturl = url.createobjecturl(response); myimage.src = objecturl; }); in our fetch request with init example (see fetch request init live) we do the same thing except that we pass in an init object when we invoke fetch(): var myimage = document.queryselector('img'); var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg',myinit); fetch(myrequest).then(function(response) { ...
... var myinit = { method: 'get', headers: { 'content-type': 'image/jpeg' }, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', myinit); you may also pass a request object to the request() constructor to create a copy of the request (this is similar to calling the clone() method.) var copy = new request(myrequest); note: this last usage is probably only useful in serviceworkers.
Using the Resource Timing API - Web APIs
to help the developer manage the buffer size, resource timing defines two methods that extend the performance interface.
... the clearresourcetimings() method removes all "resource" type performance entries from the browser's resource performance entry buffer.
... the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the specified number of resource performance entries.
... the following example demonstrates the usage of these two methods.
Resource Timing API - Web APIs
methods the resource timing api includes two methods that extend the performance interface.
... the clearresourcetimings() method removes all "resource" type performance entries from the browser's resource performance entry buffer.
... the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the specified number of resource performance entries.
... the performanceresourcetiming interface's tojson() method returns a json serialization of a "resource" type performance entry.
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_e...
... methods name & arguments return description newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object.
...object attributes unittype, valueinspecifiedunits, and valueasstring might be modified as a result of this method.
... for example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the unittype would be changed to svg_lengthtype_mm, valueinspecifiedunits would be changed to the numeric value 5 and valueasstring would be changed to "5mm".
SVGTextContentElement - Web APIs
methods this interface also inherits methods from its parent, svggraphicselement.
...note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the css 'letter-spacing' and 'word-spacing' properties.
... note: in svg 1.1 this method returned an svgpoint.
... note: in svg 1.1 this method returned an svgpoint.
Screen Capture API - Web APIs
its sole method is mediadevices.getdisplaymedia(), whose job is to ask the user to select a screen or portion of a screen to capture in the form of a mediastream.
... additions to existing interfaces the screen capture api doesn't have any interfaces of its own; instead, it adds one method to the existing mediadevices interface.
... mediadevices interface mediadevices.getdisplaymedia() the getdisplaymedia() method is added to the mediadevices interface.
... similar to getusermedia(), this method creates a promise that resolves with a mediastream containing the display area selected by the user, in a format that matches the specified options.
ServiceWorkerContainer - Web APIs
most importantly, it exposes the serviceworkercontainer.register() method used to register service workers, and the serviceworkercontainer.controller property used to determine whether or not the current page is actively controlled.
... methods serviceworkercontainer.register() creates or updates a serviceworkerregistration for the given scripturl.
... the method returns a promise that resolves to a serviceworkerregistration or undefined.
... the method returns a promise that resolves to an array of serviceworkerregistration.
StorageEvent - Web APIs
k:href="/docs/web/api/storageevent" target="_top"><rect x="116" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">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.
... the key attribute is null when the change is caused by the storage clear() method.
...the newvalue is null when the change has been invoked by storage clear() method or the key has been removed from the storage.
... methods initstorageevent() initializes the event in a manner analogous to the similarly-named initevent() method in the dom events interfaces.
Storage Access API - Web APIs
the api provides methods that allow embedded resources to check whether they currently have access to their first-party storage, and to request access to their first-party storage from the user agent.
... the storage access api is intended to solve this problem; embedded cross-origin content can request unrestricted access to its first-party storage on a site-by-site basis via the document.requeststorageaccess() method, and check whether it already has access via the document.hasstorageaccess() method.
... storage access api methods the storage api methods are implemented on the document interface: document.hasstorageaccess() returns a promise that resolves with a boolean value indicating whether the document has access to its first-party storage.
... note: user interaction propagates to the promise returned by both of these methods, allowing the callers to take actions that require user interaction without requiring a second click from the user.
SubtleCrypto.unwrapKey() - Web APIs
the unwrapkey() method of the subtlecrypto interface "unwraps" a key.
... supported algorithms the unwrapkey() method supports the same algorithms as the wrapkey() method.
...*/ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as input to the derivekey method.
...*/ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as input to the derivekey method.
Text - Web APIs
WebAPIText
the node.normalize() method merges adjacent text objects back into a single node for each block of text.
... methods inherits methods from its parent, characterdata.
... removed the replacewholetext() method.
... added the replacewholetext() method.
TextDecoder - Web APIs
constructor textdecoder() returns a newly constructed textdecoder that will generate a code point stream with the decoding method specified in parameters.
... textdecoder.prototype.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use.
... methods the textdecoder interface doesn't inherit any method.
... textdecoder.prototype.decode() returns a domstring containing the text decoded with the method of the specific textdecoder object.
UIEvent - Web APIs
WebAPIUIEvent
although the uievent.inituievent() method is kept for backward compatibility, you should create a uievent object using the uievent() constructor.
... methods this interface also inherits methods of its parent, event.
...if the event has already being dispatched, this method does nothing.
... obsolete added the uievent() constructor, deprecated the inituievent() method and changed the type of view from abstractview to windowproxy.
URL - Web APIs
WebAPIURL
methods tostring() returns a usvstring containing the whole url.
... static methods createobjecturl() returns a domstring containing a unique blob url, that is a url with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser.
... to get the search params from the current window's url, you can do this: // https://some.site/?id=123 const parsedurl = new url(window.location.href); console.log(parsedurl.searchparams.get("id")); // "123" the tostring() method of url just returns the value of the href property, so the constructor can be used to normalize and encode a url directly.
... working draft added the static methods url.createobjecturl() and url.revokeobjecturl().
WEBGL_draw_buffers - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... constants this extension exposes new constants, which can be used in the gl.framebufferrenderbuffer(), gl.framebuffertexture2d(), gl.getframebufferattachmentparameter() ext.drawbufferswebgl(), and gl.getparameter() methods.
... methods this extension exposes one new method.
...(when using webgl2, this method is available as gl.drawbuffers() by default).
WakeLockSentinel - Web APIs
an object representing the wake lock is returned via the navigator.wakelock.request() method.
... an acquired wakelocksentinel can be released manually via the release() method, or automatically via the platform wake lock.
... event handlers onrelease fired when the release() method is called or the wake lock is released by the user agent.
... methods release() releases the wakelocksentinel, returning a promise that is resolved once the sentinel has been successfully released.
WebGLRenderingContext.getUniformLocation() - Web APIs
part of the webgl api, the webglrenderingcontext method getuniformlocation() returns the location of a specific uniform variable which is part of a given webglprogram.
... once you have the uniform's location, you can access the uniform itself using one of the other uniform access methods, passing in the uniform location as one of the inputs: getuniform() returns the value of the uniform at the given location.
...with this value in hand, you can call other webgl methods to access the value of the uniform variable.
... example in this example, taken from the animatescene() method in the article a basic 2d webgl animation example, obtains the locations of three uniforms from the shading program, then sets the value of each of the three uniforms.
Clearing with colors - Web APIs
first, we set the clear color to green, using the method clearcolor().
...next, we actually do the drawing by calling the clear() method.
...there is only a handful of methods for actual drawing (clear() is one of them).
... all other methods are for setting and querying webgl state variables (such as the clear color).
WebGL constants - Web APIs
line_width 0x0b21 passed to getparameter to get the current linewidth (set by the linewidth method).
...can also be used with getparameter to find the current culling method.
...can also be used with getparameter to find the current blending method.
...can also be used with getparameter to find the current dithering method.
Adding 2D content to a WebGL context - Web APIs
it starts by calling the gl object's createbuffer() method to obtain a buffer into which we'll store the vertex positions.
... this is then bound to the context by calling the bindbuffer() method.
...this is then converted into an array of floats and passed into the gl object's bufferdata() method to establish the vertex positions for the object.
...finally we draw the object by calling the drawarrays() method.
Writing a WebSocket server in C# - Web APIs
to create an ipaddress object from a string, use the parse static method of ipaddress.
... methods: start() system.net.sockets.tcpclient accepttcpclient() waits for a tcp connection, accepts it and returns it as a tcpclient object.
...em; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 127.0.0.1:80.{0}waiting for a connection...", environment.newline); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); } } tcpclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel.
... networkstream methods: write(byte[] buffer, int offset, int size) writes bytes from buffer, offset and size determine length of message.
Using bounded reference spaces - Web APIs
creating the reference space simply requesting support for bounded-floor when calling the xrsystem method requestsession() isn't enough to get a bounded space.
...if you wish to simulate a human's perspective on the scene, you probably want to move the viewpoint upward by a distance that approximates human eye level by transforming it by providing an appropriate transform matrix to the xrreferencespace method requestoffsetreferencespace().
... this would change the onrefspacecreated() method from the above snippet to: function onrefspacecreated(refspace) { xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); let startposition = vec3.fromvalues(0, 1.5, 0); const startorientation = vec3.fromvalues(0, 0, 1.0); xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(startposition, startorientation)); xrsession.requestanimationframe(ondrawframe); } in this code, executed after the reference space has been created, we create an xrrigidtransform representing the transform that will move the viewpoint upward by 1.5 meters.
...finally, drawing begins by calling the xrsession method requestanimationframe().
Web Audio API best practices - Web APIs
we can use the same click event example here, test for the state of the context and start it, if it is suspended, using the resume() method.
...ntext(); const button = document.queryselector('button'); button.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } }, false); you might instead be working with an offlineaudiocontext, in which case you can resume the suspended audio context with the startrendering() method.
...however, if you're using any of the audioparam's defined methods to set these values, they will take precedence over the above property setting.
... bearing this in mind, if your website or application requires timing and scheduling, it's best to stick with the audioparam methods for setting values.
Controlling multiple parameters with ConstantSourceNode - Web APIs
then we assign a handler for the play button's click event (see toggling the oscillators on and off for more on the toggleplay() method), and for the volume slider's input event (see controlling the linked oscillators to see the very short changevolume() method).
...we connect its output to the gain audioparam on both gainnode2 and gainnode3, and we start the constant node running by calling its start() method; now it's sending the value 0.5 to the two gain nodes' values, and any change to constantnode.offset will automatically set the gain of both gainnode2 and gainnode3 (affecting their audio inputs as expected).
... once all three oscillators have been created, they're started by calling each one's constantsourcenode.start() method in turn, and playing is set to true to track that the tones are playing.
... function stoposcillators() { oscnode1.stop(); oscnode2.stop(); oscnode3.stop(); playing = false; } each node is stopped by calling its constantsourcenode.stop() method, then playing is set to false.
Visualizations with Web Audio API - Web APIs
basic concepts to extract data from your audio source, you need an analysernode, which is created using the audiocontext.createanalyser() method, for example: var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); this node is then connected to your audio source at some point between your source and your destination, for example: source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination);...
... 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.
... these methods copy data into a specified array, so you need to create a new array to receive the data before invoking one.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); to actually retrieve the data and copy it into our array, we then call the data collection method we want, with the array passed as it's argument.
Web Audio API - Web APIs
audioparammap provides a maplike interface to a group of audioparam interfaces, which means it provides the methods foreach(), get(), has(), keys(), and values(), as well as a size property.
... audiobuffer the audiobuffer interface represents a short audio asset residing in memory, created from an audio file using the audiocontext.decodeaudiodata() method, or created with raw data using audiocontext.createbuffer().
...when creating the node using the createmediastreamtracksource() method to create the node, you specify which track to use.
...we have a boombox that plays our 'tape', and we can adjust the volume and stereo panning, giving us a fairly basic working audio graph.visualizations with web audio apito extract data from your audio source, you need an analysernode, which is created using the audiocontext.createanalyser() method, for example:web audio api best practicesthere's no strict right or wrong way when writing creative code.
Window.close() - Web APIs
WebAPIWindowclose
the window.close() method closes the current window, or the window on which it was called.
... this method can only be called on windows that were opened by a script using the window.open() method.
... syntax window.close(); examples closing a window opened with window.open() this example shows a method which opens a window and a second one which closes the window; this demonstrates how to use window.close() to close a window opened by calling window.open().
... //global var to store a reference to the opened window var openedwindow; function openwindow() { openedwindow = window.open('moreinfo.htm'); } function closeopenedwindow() { openedwindow.close(); } closing the current window in the past, when you called the window object's close() method directly, rather than calling close() on a window instance, the browser closed the frontmost window, whether your script created that window or not.
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.
... this method is non-standard and should not be used.
... please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses).
... specifications this method was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3.
Window: popstate event - Web APIs
these methods and their corresponding events can be used to add data to the history stack which can be used to reconstruct a dynamically generated page, or to otherwise alter the state of the content being presented while remaining on the same document.
...if the goal is to catch the moment when the new document state is already fully in place, a zero-delay settimeout() method call should be used to effectively put its inner callback function that does the processing at the end of the browser event loop: window.onpopstate = () => settimeout(dosomething, 0); when popstate is sent when the transition occurs, either due to the user triggering the browser's "back" button or otherwise, the popstate event is near the end of the process to transition to the new location.
... if current-entry's title wasn't set using one of the history api methods (pushstate() or replacestate(), set the entry's title to the string returned by its document.title attribute.
... if the history traversal is being performed with replacement enabled, the entry immediately prior to the destination entry (taking into account the delta parameter on methods such as go()) is removed from the history stack.
Window.print() - Web APIs
WebAPIWindowprint
in most browsers, this method will block while the print dialog is open.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprintchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 5opera full support 6notes full support ...
... 6notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1.1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.firefox android no sup...
...port nonotes no support nonotes notes see bug 1247609.opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend ...
Window.prompt() - Web APIs
WebAPIWindowprompt
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpromptchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 4notes full support 4notes notes this function has no effect in the modern...
...desktop versions of ie do implement this function.opera full support 3notes full support 3notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <iframe> unless its sandbox attribu...
...te has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.firefox android full support 4opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support ...
... 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend full support full supportsee implementation notes.see implementation notes.
Window.setImmediate() - Web APIs
this method is used to break up long running operations and run a callback function immediately after the browser has completed other operations such as events and display updates.
... this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+.
... notes the clearimmediate method can be used to clear the immediate actions, just like cleartimeout for settimeout.
... this method can be used instead of the settimeout(fn, 0) method to execute heavy operations.
XMLHttpRequest.open() - Web APIs
the xmlhttprequest method open() initializes a newly-created request, or re-initializes an existing one.
... note: calling this method for an already active request (one for which open() has already been called) is the equivalent of calling abort().
... syntax xmlhttprequest.open(method, url[, async[, user[, password]]]) parameters method the http request method to use, such as "get", "post", "put", "delete", etc.
...if this value is false, the send() method does not return until the response is received.
XMLSerializer - Web APIs
the xmlserializer interface provides the serializetostring() method to construct an xml string representing a dom tree.
... methods serializetostring() returns the serialized subtree of a string.
... 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.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
the xrreferencespace interface's getoffsetreferencespace() method returns a new reference space object which describes the relative difference in position between the object on which the method is called and a given point in 3d space.
...this is demonstrated in the example implementing rotation based on non-xr inputs, which demonstrates a way to use this method to let the user use their mouse to pitch and yaw their viewing angle.
... return value a new xrreferencespace object describing a reference space with the same native origin as the reference space on which the method was called, but with an origin offset indicating the distance from the object to the point given by originoffset.
... if the object on which you call this method is an xrboundedreferencespace, the returned object is one as well.
XRSystem: isSessionSupported() - Web APIs
the xrsystem method issessionsupported() returns a promise which resolves to true if the specified webxr session mode is supported by the user's webxr device.
...if it is, we set up a button to read "enter xr", to call a method onbuttonclicked(), and enable the button.
... if no session is already underway, we request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown.
... if a session is already underway when the button is clicked, we call the xrsession object's end() method to shut down the webxr session.
XRSystem: requestSession() - Web APIs
the xrsystem interface's requestsession() method returns a promise which resolves to an xrsession object through which you can manage the requested type of webxr session.
...the session's environmentblendmode indicates the method to be used to blend the content together.
... 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.
...finally, the onbuttonclicked() method calls requestsession() using the same session option passed to issessionsupported().
XRWebGLLayer - Web APIs
framebuffer read only returns a webglframebuffer suitable for passing into the bindframebuffer() method.
... methods getviewport() returns a new xrviewport instance representing the position, width, and height to which the webgl context's viewport must be set to contain drawing to the area of the framebuffer designated for the specified view's contents.
... static methods getnativeframebufferscalefactor() returns the scaling factor that can be used to scale the resolution of the recommended webgl framebuffer resolution to the rendering device's native resolution.
... let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); rendering every view in a frame each time the gpu is ready to render the scene to the xr device, the xr runtime calls the function you specified when you called the xrsession method requestanimationframe() to ask to render the frame.
Cognitive accessibility - Accessibility
headings are more obvious navigational aids compared to other methods to identify page content sections (borders, whitespace, horizontal rules, etc.).
... multiple ways to find content different users prefer different methods of finding information, so it is important to provide multiple ways for users to locate content on your site.
...methods to achieve this include: using short, simple words.
... be consistent and predictable, and use norms while unlabeled iconography is not the most effective method of conveying information, keeping the use of the icons (and if labeled, their label text) consistent helps people to understand what the icon represents.
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods.
...as this page aims to detail things which are specific to block layout and box alignment, it should be read in conjunction with the main box alignment page, which details the common features of box alignment across layout methods.
...if a content distribution method such as space-between, space-around or space-evenly is requested then the fallback alignment will be used, as the content is treated as a single alignment subject.
... aligning in these layout methods today as we do not currently have browser support for box alignment in block layout, your options for alignment are either to use one of the existing alignment methods or, to make even a single item inside a container a flex item in order to use the alignment properties as specified in flexbox.
Box alignment in grid layout - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods.
... as this page aims to detail things which are specific to css grid layout and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods.
... grid axes as a two-dimensional layout method, when working with grid layout we always have two axes on which to align our items.
...this allows them to be used for other layout methods where a gap between items makes sense.
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods; on this page we explore how box alignment works in the context of multi-column layout.
... as this page aims to detail things which are specific to multi-column layout and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods.
... column-gap the column-gap property was specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap properties for other layout methods in box alignment.
... while other layout methods treat the initial value of column-gap as 0 multicol treats it as 1em, as in general you would not want to have no gap between columns.
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
in this guide we will look at how well flexbox is supported in browsers, and look at some potential issues, resources and methods for creating workarounds and fallbacks.
...at the time the method of creating experimental implementations was to use a vendor prefix.
... useful fallback techniques given that flexbox usage is initiated with value of the display property, when needing to support very old browsers which do not support flexbox at all, fallbacks can be created by overwriting one layout method with another.
... the specification defines what happens if you use other layout methods on an element which then becomes a flex item.
Basic concepts of flexbox - CSS: Cascading Style Sheets
the flexible box module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities.
...modern layout methods encompass the range of writing modes and so we no longer assume that a line of text will start at the top left of a document and run towards the right hand side, with new lines appearing one under the other.
... after a while, thinking about start and end rather than left and right becomes natural, and will be useful to you when dealing with other layout methods such as css grid layout which follow the same patterns.
... if we instead would like the items to grow and fill the space, then we need to have a method of distributing the leftover space between the items.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
choose the method you find most helpful for the problems that you are solving and the designs that you need to implement.
...i find this named areas method very helpful at a prototyping stage, it is easy to play around with the location of elements.
... building a layout using the 12-column system to see how this layout method works in practice, we can create the same layout that we created with grid-template-areas, this time using the 12-column grid system.
...don’t forget to find examples that are impossible to build with current methods.
Event reference
emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
...for example, this event is triggered if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
... voiceschanged event web speech api the list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) versionchange indexeddb a versionchange transaction completed.
... mozbrowserfindchange firefox os browser api-specific sent when a search operation is performed on the browser <iframe> content (see htmliframeelement search methods.) mozbrowserfirstpaint firefox os browser api-specific sent when the <iframe> paints content for the first time (this doesn't include the initial paint from about:blank.) mozbrowsericonchange firefox os browser api-specific sent when the favicon of a browser <iframe> changes.
Writing Web Audio API code that works in every browser - Developer guides
furthermore, as a result of the spec being still in flux, some browsers use deprecated properties and method names that are not present in standards-compliant browsers: safari uses the old method names, firefox uses the new ones, and chrome and opera use both.
...also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names.
...if you're porting moderately "old" code (say, a year old) it's possible that it uses some methods that audiocontext-monkeypatch doesn't alias, because it helps you to write code in the new style.
... for example, the way to create instances of gainnode used to be var gain = audiocontext.creategainnode(); but nowadays it is just var gain = audiocontext.creategain(); since the old method names are not present in firefox, existing code may crash with something like creategainnode is not a function, and you now know why.
DOM onevent handlers - Developer guides
in order to allow multiple handlers to be installed for the same event on a given object, you can call its addeventlistener() method, which manages a list of handlers for the given event on the object.
... further changes to the html attribute value can be done via the setattribute method; making changes to the javascript property will have no effect.
...using .onclick log('<br>changing onclick handler using <strong> onclick property </strong> '); el.onclick = anchoronclick; log(`changed the property to: <code> ${el.onclick.tostring()} </code>`); log(`but the html attribute is unchanged: <code> ${el.getattribute("onclick")} </code><br>`); //changing handler using .setattribute log('<hr/><br> changing onclick handler using <strong> setattribute method </strong> '); el.setattribute("onclick", 'anchoronclick(event)'); log(`changed the property to: <code> ${el.onclick.tostring()} </code>`); log(`now even the html attribute has changed: <code> ${el.getattribute("onclick")} </code><br>`); result for historical reasons, some attributes/properties on the <body> and <frameset> elements instead set event handlers on their parent window object.
... when discussing the various methods of listening to events: event listener refers to a function or object registered via eventtarget.addeventlistener() event handler refers to a function registered via on… attributes or properties specifications specification status comment html living standardthe definition of 'event handlers' in that specification.
The HTML autocomplete attribute - HTML: Hypertext Markup Language
"cc-number" a credit card number or other number identifying a payment method, such as an account number.
... "cc-exp" a payment method expiration date, typically in the form "mm/yy" or "mm/yyyy".
... "cc-exp-month" the month in which the payment method expires.
... "cc-exp-year" the year in which the payment method expires.
HTML attribute: multiple - HTML: Hypertext Markup Language
file input when multiple is set on the file input type, the user can select one or more files: <form method="post" enctype="multipart/form-data"> <p> <label for="uploads"> choose the images you want to upload: </label> <input type="file" id="uploads" name="uploads" accept=".jpg, .jpeg, .png, .svg, .gif" multiple> </p> <p> <label for="text">pick a text file to upload: </label> <input type="file" id="text" name="text" accept=".txt"> </p> <p> <input type="submit" va...
... when the form is submitted,had we used method="get" each selected file's name would have been added to url parameters as?uploads=img1.jpg&uploads=img2.svg.
... <form method="get" action="#"> <p> <label for="dwarfs">select the woodsmen you like:</label> <select multiple name="drawfs" id="drawfs"> <option>grumpy@woodworkers.com</option> <option>happy@woodworkers.com</option> <option>sleepy@woodworkers.com</option> <option>bashful@woodworkers.com</option> <option>sneezy@woodworkers.com</option> <option>dopey@woodworkers.com</option> <opti...
...if you do change the appearance of a select, and even if you don't, make sure to inform the user that more than one option can be selected by another method.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
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).
...for example, a file picker that needs content that can be presented as an image, including both standard image formats and pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <label for="file">choose file to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live.
... let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces a similar-looking output to the previous example: note: you can find this example ...
... first of all, let's look at the html: <form method="post" enctype="multipart/form-data"> <div> <label for="image_uploads">choose images to upload (png, jpg)</label> <input type="file" id="image_uploads" name="image_uploads" accept=".jpg, .jpeg, .png" multiple> </div> <div class="preview"> <p>no files currently selected for upload</p> </div> <div> <button>submit</button> </div> </form> html { font-family: sans-serif...
HTTP conditional requests - HTTP
the different behaviors are defined by the method of the request used, and by the set of headers used for a precondition: for safe methods, like get, which usually tries to fetch a document, the conditional request can be used to send back the document, if relevant only.
... for unsafe methods, like put, which usually uploads a document, the conditional request can be used to upload the document, only if the original it is based on is the same as that stored on the server.
...the more flexible one makes use of if-unmodified-since and if-match and the server returns an error if the precondition fails; the client then restarts the download from the beginning: even if this method works, it adds an extra response/request exchange when the document has been changed.
... with the put method you are able to implement this.
Allow - HTTP
WebHTTPHeadersAllow
the allow header lists the set of methods supported by a resource.
... this header must be sent if the server responds with a 405 method not allowed status code to indicate which request methods can be used.
... an empty allow header indicates that the resource allows no request methods, which might occur temporarily for a given resource, for example.
... header type entity header forbidden header name no syntax allow: <http-methods> directives <http-methods> the comma-separated list of allowed http request methods.
CSP: script-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... <script>var inline = 1;</script> unsafe eval expressions the 'unsafe-eval' source expression controls several script execution methods that create code from strings.
... if 'unsafe-eval' isn't specified with the script-src directive, the following methods are blocked and won't have any effect: eval() function() when passing a string literal like to methods like: window.settimeout("alert(\"hello world!\");", 500); window.settimeout window.setinterval window.setimmediate window.execscript (ie < 11 only) strict-dynamic the 'strict-dynamic' source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script.
CSP: style-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... <style>#inline-style { background: red; }</style> unsafe style expressions the 'unsafe-eval' source expression controls several style methods that create style declarations from strings.
... if 'unsafe-eval' isn't specified with the style-src directive, the following methods are blocked and won't have any effect: cssstylesheet.insertrule() cssgroupingrule.insertrule() cssstyledeclaration.csstext specifications specification status comment content security policy level 3the definition of 'style-src' in that specification.
If-Match - HTTP
WebHTTPHeadersIf-Match
for get and head methods, the server will send back the requested resource only if it matches one of the listed etags.
... for put and other non-safe methods, it will only upload the resource in this case.
... there are two common use cases: for get and head methods, used in combination with a range header, it can guarantee that the new ranges requested comes from the same resource than the previous one.
... for other methods, and in particular for put, if-match can be used to prevent the lost update problem.
302 Found - HTTP
WebHTTPStatus302
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there.
... it is therefore recommended to set the 302 code only as a response for get or head methods and to use 307 temporary redirect instead, as the method change is explicitly prohibited in that case.
... in the cases where you want the method used to be changed to get, use 303 see other instead.
... this is useful when you want to give a response to a put method that is not the uploaded resource but a confirmation message such as: 'you successfully uploaded xyz'.
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
the non-standard generic string methods are deprecated and have been removed in firefox 68 and later.
... string generics provide string instance methods on the string object allowing string methods to be applied to any object.
... examples deprecated syntax var num = 15; string.replace(num, /5/, '2'); standard syntax var num = 15; string(num).replace(/5/, '2'); shim the following is a shim to provide support to non-supporting browsers: /*globals define*/ // assumes all supplied string instance methods already present // (one may use shims for these if not available) (function() { 'use strict'; var i, // we could also build the array of methods with the following, but the // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase', 'charat', 'charcodeat', 'indexof', 'lastindexof', 'startswi...
...th', 'endswith', 'trim', 'trimleft', 'trimright', 'tolocalelowercase', 'normalize', 'tolocaleuppercase', 'localecompare', 'match', 'search', 'slice', 'replace', 'split', 'substr', 'concat', 'localecompare' ], methodcount = methods.length, assignstringgeneric = function(methodname) { var method = string.prototype[methodname]; string[methodname] = function(arg1) { return method.apply(arg1, array.prototype.slice.call(arguments, 1)); }; }; for (i = 0; i < methodcount; i++) { assignstringgeneric(methods[i]); } }()); ...
TypeError: "x" is not a function - JavaScript
message typeerror: object doesn't support property or method {x} (edge) typeerror: "x" is not a function error type typeerror what went wrong?
...maybe the object you are calling the method on does not have this function?
...you will have to provide a function in order to have these methods working properly: when working with array or typedarray objects: array.prototype.every(), array.prototype.some(), array.prototype.foreach(), array.prototype.map(), array.prototype.filter(), array.prototype.reduce(), array.prototype.reduceright(), array.prototype.find() when working with map and set objects: map.prototype.foreach() and set.prototype.foreach() examples a typo in the function name in this case, which happens way too often, there is a typo in the method name: let x = document.getelementbyid('foo'); // typeerror: document.getel...
...ementbyid is not a function the correct function name is getelementbyid: let x = document.getelementbyid('foo'); function called on the wrong object for certain methods, you have to provide a (callback) function and it will work on specific objects only.
Array.prototype.concat() - JavaScript
the concat() method is used to merge two or more arrays.
... this method does not change the existing arrays, but instead returns a new array.
... description the concat method creates a new array consisting of the elements in the object on which it is called, followed in order by, for each argument, the elements of that argument (if the argument is an array) or the argument itself (if the argument is not an array).
... the concat method does not alter this or any of the arrays provided as arguments but instead returns a shallow copy that contains copies of the same elements combined from the original arrays.
Array.prototype.copyWithin() - JavaScript
the copywithin() method shallow copies part of an array to another location in the same array and returns it without modifying its length.
... description the copywithin works like c and c++'s memmove, and is a high-performance method to shift the data of an array.
... this especially applies to the typedarray method of the same name.
... the copywithin method is a mutable method.
Array.prototype.forEach() - JavaScript
the foreach() method executes a provided function once for each array element.
...if you need such behavior, the foreach() method is the wrong tool.
... early termination may be accomplished with: a simple for loop a for...of / for...in loops array.prototype.every() array.prototype.some() array.prototype.find() array.prototype.findindex() array methods: every(), some(), find(), and findindex() test the array elements with a predicate returning a truthy value to determine if further iteration is required.
...if you want to flatten an array using built-in methods you can use array.prototype.flat().
Array.prototype.pop() - JavaScript
the pop() method removes the last element from an array and returns that element.
... this method changes the length of the array.
... description the pop method removes the last element from an array and returns that value to the caller.
... pop is intentionally generic; this method can be called or applied to objects resembling arrays.
Array.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array.
...r = ' + newcar[0].color) this script writes: mycar = [{color: 'red', wheels: 4, engine: {cylinders: 4, size: 2.2}}, 2, 'cherry condition', 'purchased 1997'] newcar = [{color: 'red', wheels: 4, engine: {cylinders: 4, size: 2.2}}, 2] mycar[0].color = red newcar[0].color = red the new color of my honda is purple mycar[0].color = purple newcar[0].color = purple array-like objects slice method can also be called to convert array-like objects/collections to a new array.
... you just bind the method to the object.
... function list() { return array.prototype.slice.call(arguments) } let list1 = list(1, 2, 3) // [1, 2, 3] binding can be done with the call() method of function.prototype and it can also be reduced using [].slice.call(arguments) instead of array.prototype.slice.call.
Array.prototype.some() - JavaScript
the some() method tests whether at least one element in the array passes the test implemented by the provided function.
... description the some() method executes the callback function once for each element present in the array until it finds the one where callback returns a truthy value (a value that becomes true when converted to a boolean).
... caution: calling this method on an empty array returns false for any condition!
... [2, 5, 8, 1, 4].some(x => x > 10); // false [12, 5, 8, 1, 4].some(x => x > 10); // true checking whether a value exists in an array to mimic the function of the includes() method, this custom function returns true if the element exists in the array: const fruits = ['apple', 'banana', 'mango', 'guava']; function checkavailability(arr, val) { return arr.some(function(arrval) { return val === arrval; }); } checkavailability(fruits, 'kela'); // false checkavailability(fruits, 'banana'); // true checking whether a value exists using an arrow function const fruit...
Array.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the array.
... the elements are converted to strings using their tolocalestring methods and these strings are separated by a locale-specific string (such as a comma “,”).
... return r; } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
... examples using locales and options the elements of the array are converted to strings using their tolocalestring methods.
Array.prototype.unshift() - JavaScript
the unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.
... return value the new length property of the object upon which the method was called.
... description the unshift method inserts the given values to the beginning of an array-like object.
...this method can be called or applied to objects resembling arrays.
Atomics - JavaScript
the atomics object provides atomic operations as static methods.
...all properties and methods of atomics are static (as is the case with the math object, for example).
... wait and notify the wait() and notify() methods are modeled on linux futexes ("fast user-space mutex") and provide ways for waiting until a certain condition becomes true and are typically used as blocking constructs.
... static methods atomics.add() adds the provided value to the existing value at the specified index of the array.
BigInt.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified bigint object.
... description the bigint object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
... for bigint objects, the tostring() method returns a string representation of the object in the specified radix.
... the tostring() method parses its first argument, and attempts to return a string representation in the specified radix (base).
Date.UTC() - JavaScript
the date.utc() method accepts parameters similar to the date constructor, but treats them as utc.
... the utc() method differs from the date constructor in two ways: date.utc() uses universal time instead of the local time.
... if a parameter is outside of the expected range, the utc() method updates the other parameters to accommodate the value.
... utc() is a static method of date, so it's called as date.utc() rather than as a method of a date instance.
Date.parse() - JavaScript
the date.parse() method parses a string representation of a date, and returns the number of milliseconds since january 1, 1970, 00:00:00 utc or nan if the string is unrecognized or, in some cases, contains illegal date values (e.g.
... description the parse() method takes a date string (such as "2011-10-10t14:48:00") and returns the number of milliseconds since january 1, 1970, 00:00:00 utc.
... this function is useful for setting date values based on string values, for example in conjunction with the settime() method and the date object.
... because parse() is a static method of date, it is called as date.parse() rather than as a method of a date instance.
Date.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified date object.
... description date instances inherit their tostring() method from date.prototype, not object.prototype.
... the tostring() method is automatically called when a date is to be represented as a text value, e.g.
... tostring() is a generic method, it does not require that its this is a date instance.
Date.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a date object.
... description the valueof() method returns the primitive value of a date object as a number data type, the number of milliseconds since midnight 01 january, 1970 utc.
... this method is functionally equivalent to the date.prototype.gettime() method.
... this method is usually called internally by javascript and not explicitly in code.
Error - JavaScript
static methods error.capturestacktrace() a non-standard v8 function that creates the stack property on an error instance.
... instance methods error.prototype.tostring() returns a string representing the specified object.
... overrides the object.prototype.tostring() method.
... es6 custom error class versions of babel prior to 7 can handle customerror class methods, but only when they are declared with object.defineproperty().
Intl.DateTimeFormat - JavaScript
static methods intl.datetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.datetimeformat.prototype.format() getter function that formats a date according to the locale and formatting options of this datetimeformat object.
... intl.datetimeformat.prototype.formatrange() this method receives two dates and formats the date range in the most concise way based on the locale and options provided when instantiating datetimeformat.
... intl.datetimeformat.prototype.formatrangetoparts() this method receives two dates and returns an array of objects containing the locale-specific tokens representing each part of the formatted date range.
Map - JavaScript
other operations on the data fail: wrongmap.has('bla') // false wrongmap.delete('bla') // false console.log(wrongmap) // map { bla: 'blaa', bla2: 'blaaa2' } the correct usage for storing data in the map is through the set(key, value) method.
... instance methods map.prototype.clear() removes all key-value pairs from the map object.
... iteration methods map.prototype[@@iterator]() returns a new iterator object that contains an array of [key, value] for each element in the map object in insertion order.
...ey, value] of mymap) { console.log(key + ' = ' + value) } // 0 = zero // 1 = one for (let key of mymap.keys()) { console.log(key) } // 0 // 1 for (let value of mymap.values()) { console.log(value) } // zero // one for (let [key, value] of mymap.entries()) { console.log(key + ' = ' + value) } // 0 = zero // 1 = one iterating map with foreach() maps can be iterated using the foreach() method: mymap.foreach(function(value, key) { console.log(key + ' = ' + value) }) // 0 = zero // 1 = one relation with array objects let kvarray = [['key1', 'value1'], ['key2', 'value2']] // use the regular map constructor to transform a 2d key-value array into a map let mymap = new map(kvarray) mymap.get('key1') // returns "value1" // use array.from() to transform a map into a 2d key-value arra...
Math - JavaScript
math is a built-in object that has properties and methods for mathematical constants and functions.
...all properties and methods of math are static.
... you refer to the constant pi as math.pi and you call the sine function as math.sin(x), where x is the method’s argument.
... static methods math.abs(x) returns the absolute value of x.
Number.prototype.toExponential() - JavaScript
the toexponential() method returns a string representing the number object in exponential notation.
... typeerror if this method is invoked on an object that is not a number.
... if you use the toexponential() method for a numeric literal and the numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot that precedes the method call to prevent the dot from being interpreted as a decimal point.
...see the discussion of rounding in the description of the tofixed() method, which also applies to toexponential().
Number.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified number object.
... description the number object overrides the tostring() method of the object object.
...for number objects, the tostring() method returns a string representation of the object in the specified radix.
... the tostring() method parses its first argument, and attempts to return a string representation in the specified radix (base).
Object.fromEntries() - JavaScript
the object.fromentries() method transforms a list of key-value pairs into an object.
... description the object.fromentries() method takes a list of key-value pairs and returns a new object whose properties are given by those entries.
... the iterable argument is expected to be an object that implements an @@iterator method, that returns an iterator object, that produces a two element array-like object, whose first element is a value that will be used as a property key, and whose second element is the value to associate with that property key.
..., ['baz', 42] ]); const obj = object.fromentries(map); console.log(obj); // { foo: "bar", baz: 42 } converting an array to an object with object.fromentries, you can convert from array to object: const arr = [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]; const obj = object.fromentries(arr); console.log(obj); // { 0: "a", 1: "b", 2: "c" } object transformations with object.fromentries, its reverse method object.entries(), and array manipulation methods, you are able to transform objects like this: const object1 = { a: 1, b: 2, c: 3 }; const object2 = object.fromentries( object.entries(object1) .map(([ key, val ]) => [ key, val * 2 ]) ); console.log(object2); // { a: 2, b: 4, c: 6 } please do not add polyfills on mdn pages.
Object.getOwnPropertyDescriptors() - JavaScript
the object.getownpropertydescriptors() method returns all own property descriptors of a given object.
... description this method permits examination of the precise description of all own properties of an object.
... examples creating a shallow clone whereas the object.assign() method will only copy enumerable and own properties from a source object to a target object, you are able to use this method and object.create() for a shallow copy between two unknown objects: object.create( object.getprototypeof(obj), object.getownpropertydescriptors(obj) ); creating a subclass a typical way of creating a subclass is to define the subclass, set its prototype to an instance of t...
...instead, you can use this code to set the prototype: function superclass() {} superclass.prototype = { // define your methods and properties here }; function subclass() {} subclass.prototype = object.create( superclass.prototype, { // define your methods and properties here } ); specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertydescriptors' in that specification.
Object.prototype.hasOwnProperty() - JavaScript
the hasownproperty() method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inheriting it).
... description all descendents of object inherit the hasownproperty method.
... this method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check for a property in the object's prototype chain.
... if an object is an array, hasownproperty method can check whether an index exists.
handler.apply() - JavaScript
the handler.apply() method is a trap for a function call.
... syntax const p = new proxy(target, { apply: function(target, thisarg, argumentslist) { } }); parameters the following parameters are passed to the apply() method.
... return value the apply() method can return any value.
... description the handler.apply() method is a trap for a function call.
handler.defineProperty() - JavaScript
the handler.defineproperty() method is a trap for object.defineproperty().
... syntax const p = new proxy(target, { defineproperty: function(target, property, descriptor) { } }); parameters the following parameters are passed to the defineproperty() method.
... return value the defineproperty() method must return a boolean indicating whether or not the property has been successfully defined.
... description the handler.defineproperty() method is a trap for object.defineproperty().
handler.deleteProperty() - JavaScript
the handler.deleteproperty() method is a trap for the delete operator.
... syntax const p = new proxy(target, { deleteproperty: function(target, property) { } }); parameters the following parameters are passed to the deleteproperty() method.
... return value the deleteproperty() method must return a boolean indicating whether or not the property has been successfully deleted.
... description the handler.deleteproperty() method is a trap for the delete operator.
handler.get() - JavaScript
the handler.get() method is a trap for getting a property value.
... syntax const p = new proxy(target, { get: function(target, property, receiver) { } }); parameters the following parameters are passed to the get() method.
... return value the get() method can return any value.
... description the handler.get() method is a trap for getting a property value.
handler.getOwnPropertyDescriptor() - JavaScript
the handler.getownpropertydescriptor() method is a trap for object.getownpropertydescriptor().
... syntax const p = new proxy(target, { getownpropertydescriptor: function(target, prop) { } }); parameters the following parameters are passed to the getownpropertydescriptor() method.
... return value the getownpropertydescriptor() method must return an object or undefined.
... description the handler.getownpropertydescriptor() method is a trap for object.getownpropertydescriptor().
handler.has() - JavaScript
the handler.has() method is a trap for the in operator.
... syntax const p = new proxy(target, { has: function(target, prop) { } }); parameters the following parameters are passed to has() method.
... return value the has() method must return a boolean value.
... description the handler.has() method is a trap for the in operator.
handler.isExtensible() - JavaScript
the handler.isextensible() method is a trap for object.isextensible().
... syntax const p = new proxy(target, { isextensible: function(target) { } }); parameters the following parameter is passed to the isextensible() method.
... return value the isextensible() method must return a boolean value.
... description the handler.isextensible() method is a trap for object.isextensible().
handler.ownKeys() - JavaScript
the handler.ownkeys() method is a trap for reflect.ownkeys().
... syntax const p = new proxy(target, { ownkeys: function(target) { } }); parameters the following parameter is passed to the ownkeys() method.
... return value the ownkeys() method must return an enumerable object.
... description the handler.ownkeys() method is a trap for reflect.ownkeys().
handler.preventExtensions() - JavaScript
the handler.preventextensions() method is a trap for object.preventextensions().
... syntax const p = new proxy(target, { preventextensions: function(target) { } }); parameters the following parameter is passed to the preventextensions() method.
... return value the preventextensions() method must return a boolean value.
... description the handler.preventextensions() method is a trap for object.preventextensions().
Reflect.isExtensible() - JavaScript
the static reflect.isextensible() method determines if an object is extensible (whether it can have new properties added to it).
... description the reflect.isextensible method allows you determine if an object is extensible (whether it can have new properties added to it).
... it is the same method as object.isextensible().
...let frozen = object.freeze({}) reflect.isextensible(frozen) // === false difference to object.isextensible() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
RegExp.prototype.test() - JavaScript
the test() method executes a search for a match between a regular expression and a specified string.
...test() returns a boolean, unlike the string.prototype.search() method (which returns the index of a match, or -1 if not found).
... to get more information (but with slower execution), use the exec() method.
... (this is similar to the string.prototype.match() method.) as with exec() (or in combination with it), test() called multiple times on the same global regular expression instance will advance past the previous match.
Set - JavaScript
instance methods set.prototype.add(value) appends value to the set object.
... iteration methods set.prototype[@@iterator]() returns a new iterator object that yields the values for each element in the set object in insertion order.
...(for sets, this is the same as the values() method.) set.prototype.values() returns a new iterator object that yields the values for each element in the set object in insertion order.
... (for sets, this is the same as the keys() method.) set.prototype.entries() returns a new iterator object that contains an array of [value, value] for each element in the set object, in insertion order.
String.prototype.endsWith() - JavaScript
the endswith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.
... description this method lets you determine whether or not a string ends with another string.
... this method is case-sensitive.
... polyfill this method has been added to the ecmascript 6 specification and may not be available in all javascript implementations yet.
String.fromCodePoint() - JavaScript
the static string.fromcodepoint() method returns a string created by using the specified sequence of code points.
... description this method returns a string (and not a string object).
... because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created.
... polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet.
String.prototype.startsWith() - JavaScript
the startswith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.
... description this method lets you determine whether or not a string begins with another string.
... this method is case-sensitive.
... polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet.
String.prototype.toUpperCase() - JavaScript
the touppercase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn't one).
... description the touppercase() method returns the value of the string converted to uppercase.
... this method does not affect the value of the string itself since javascript strings are immutable.
... examples basic usage console.log('alphabet'.touppercase()); // 'alphabet' conversion of non-string this values to strings this method will convert any non-string value to a string, when you set its this to a value that is not a string: const a = string.prototype.touppercase.call({ tostring: function tostring() { return 'abcdef'; } }); const b = string.prototype.touppercase.call(true); // prints out 'abcdef true'.
String.prototype.trimEnd() - JavaScript
the trimend() method removes whitespace from the end of a string.
... trimright() is an alias of this method.
... description the trimend() / trimright() methods return the string stripped of whitespace from its right end.
... aliasing for consistency with functions like string.prototype.padend the standard method name is trimend.
String.prototype.trimStart() - JavaScript
the trimstart() method removes whitespace from the beginning of a string.
... trimleft() is an alias of this method.
... description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end.
... aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart.
Symbol.prototype[@@toPrimitive] - JavaScript
the [@@toprimitive]() method converts a symbol object to a primitive value.
... description the [@@toprimitive]() method of symbol returns the primitive value of a symbol object as a symbol data type.
... javascript calls the [@@toprimitive]() method to convert an object to a primitive value.
... you rarely need to invoke the [@@toprimitive]() method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected.
Symbol.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a symbol object.
... description the valueof method of symbol returns the primitive value of a symbol object as a symbol data type.
... javascript calls the valueof method to convert an object to a primitive value.
... you rarely need to invoke the valueof method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected.
TypedArray.prototype.every() - JavaScript
the every() method tests whether all elements in the typed array pass the test implemented by the provided function.
... this method has the same algorithm as array.prototype.every().
... description the every method executes the provided callback function once for each element present in the typed array until it finds one where callback returns a falsy value (a value that becomes false when converted to a boolean).
... if such an element is found, the every method immediately returns false.
TypedArray.prototype.reduce() - JavaScript
the reduce() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value.
... this method has the same algorithm as array.prototype.reduce().
... description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring.
... polyfill this method uses the same algorithm as array.prototype.reduce(), so the same polyfill can be used here: simply replace array.prototype.reduce with typedarray.prototype.reduce.
TypedArray.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of a typed array into a new typed array object.
... this method has the same algorithm as array.prototype.slice().
... description the slice method does not alter.
... if (!uint8array.prototype.slice) { object.defineproperty(uint8array.prototype, 'slice', { value: function (begin, end) { return new uint8array(array.prototype.slice.call(this, begin, end)); } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
TypedArray.prototype.some() - JavaScript
the some() method tests whether some element in the typed array passes the test implemented by the provided function.
... this method has the same algorithm as array.prototype.some().
... description the some method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value.
... // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some if (!uint8array.prototype.some) { object.defineproperty(uint8array.prototype, 'some', { value: array.prototype.some }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
WeakMap - JavaScript
a map api could be implemented in javascript with two arrays (one for keys, one for values) shared by the four api methods.
...there is no method to obtain a list of the keys.
... instance methods weakmap.prototype.delete(key) removes any value associated to the key.
....get(o2); // "azerty" wm2.get(o2); // undefined, because there is no key for o2 on wm2 wm2.get(o3); // undefined, because that is the set value wm1.has(o2); // true wm2.has(o2); // false wm2.has(o3); // true (even if the value itself is 'undefined') wm3.set(o1, 37); wm3.get(o1); // 37 wm1.has(o1); // true wm1.delete(o1); wm1.has(o1); // false implementing a weakmap-like class with a .clear() method class clearableweakmap { constructor(init) { this._wm = new weakmap(init); } clear() { this._wm = new weakmap(); } delete(k) { return this._wm.delete(k); } get(k) { return this._wm.get(k); } has(k) { return this._wm.has(k); } set(k, v) { this._wm.set(k, v); return this; } } specifications specification ecmascript (ecma-...
WebAssembly.instantiate() - JavaScript
important: this method is not the most efficient way of fetching and instantiating wasm modules.
... if at all possible, you should use the newer webassembly.instantiatestreaming() method instead, which fetches, compiles, and instantiates a module all in one step, directly from the raw bytecode, so doesn't require conversion to an arraybuffer.
... second overload example the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
...when the module is received, we create an instance from it using the webassembly.instantiate() method and invoke an exported function from inside it.
function* - JavaScript
when the iterator's next() method is called, the generator function's body is executed until the first yield expression, which specifies the value to be returned from the iterator or, with yield*, delegates to another generator function.
... the next() method returns an object with a value property containing the yielded value and a done property which indicates whether the generator has yielded its last value, as a boolean.
... calling the next() method with an argument will resume the generator function execution, replacing the yield expression where an execution was paused with the argument from next().
...console.log(gen.next()); // { value: undefined, done: true } generator as an object property const someobj = { *generator () { yield 'a'; yield 'b'; } } const gen = someobj.generator() console.log(gen.next()); // { value: 'a', done: false } console.log(gen.next()); // { value: 'b', done: false } console.log(gen.next()); // { value: undefined, done: true } generator as an object method class foo { *generator () { yield 1; yield 2; yield 3; } } const f = new foo (); const gen = f.generator(); console.log(gen.next()); // { value: 1, done: false } console.log(gen.next()); // { value: 2, done: false } console.log(gen.next()); // { value: 3, done: false } console.log(gen.next()); // { value: undefined, done: true } generator as a computed property class foo { ...
JavaScript typed arrays - JavaScript
moreover, not all methods available for normal arrays are supported by typed arrays (e.g.
...it is big-endian by default and can be set to little-endian in the getter/setter methods.
... filereader.prototype.readasarraybuffer() the filereader.prototype.readasarraybuffer() method starts reading the contents of the specified blob or file.
... xmlhttprequest.prototype.send() xmlhttprequest instances' send() method now supports typed arrays and arraybuffer objects as argument.
Autoplay guide for media and Web Audio APIs - Web media technologies
the play() method the term "autoplay" also refers to scenarios in which a script tries to trigger the playback of media that includes audio, outside the context of handling a user input event.
... this is done by calling the media element's play() method.
... document.queryselector("video").play(); example: handling play() failures it's much easier to detect a failure to autoplay media when you use the play() method to start it.
... autoplay using the web audio api in the web audio api, a web site or app can start playing audio using the start() method on a source node linked to the audiocontext.
Namespaces crash course - SVG: Scalable Vector Graphics
to resolve these problems, dom level 2 core added namespace aware equivalents of all the applicable dom level 1 methods.
... when scripting svg, it is important to use the namespace aware 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.
...entsbytagnamens (also added to element) getnameditem getnameditemns hasattribute hasattributens removeattribute removeattributens removenameditem removenameditemns setattribute setattributens setattributenode setattributenodens setnameditem setnameditemns the first parameter for all the dom2 namespace aware methods must be the namespace name (also known as the namespace uri) of the element or parameter in question.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
point or dompointreadonly instead of svgpoint implementation status unknown members of svgstylable and svglangspace available in svgelement implementation status unknown svggraphicselement instead of svglocatable and svgtransformable implementation status unknown svggeometryelement with svggeometryelement.ispointinfill() and svggeometryelement.ispointinstroke() methods partially implemented (bug 1239100).
... the methods ispointinfill() and ispointinstroke() are not implemented yet (bug 1325319).
... svggraphicselement.gettransformtoelement() removed not removed yet svggraphicselement.getctm() on the outermost element implementation status unknown animval attribute alias of baseval implementation status unknown dataset attribute for svgelement implementation status unknown moved pathlength attribute and gettotallength() and getpointatlength() methods from svgpathelement to svggeometryelement implemented (bug 1239100) document structure change notes svgsvgelement.suspendredraw(), svgsvgelement.unsuspendredraw(), and svgsvgelement.unsuspendredrawall() deprecated turned into no-ops (bug 734079) externalresourcesrequired attribute removed implementation status unknown auto value for wid...
...plementation status unknown paths change notes b and b path commands implementation status unknown z and z path commands to add path coordinate data to previous command implementation status unknown not render <path>, <polygon> and <polyline> with no data implementation status unknown svgpathseg*, svganimatedpathdata and related methods removed from svgpathelement implementation status unknown d attribute as css property implementation status unknown basic shapes change notes pathlength attribute for all basic shapes implementation status unknown svganimatedpoints.animatedpoints as alias of svganimatedpoints.points implementation status unknown auto behavio...
Gradients in SVG - SVG: Scalable Vector Graphics
the two methods have been intermixed for the purposes of this example.
...the only other one i want to mention here is the spreadmethod attribute.
... spreadmethod <?xml version="1.0" standalone="no"?> <svg width="220" height="220" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradientpad" cx="0.5" cy="0.5" r="0.4" fx="0.75" fy="0.75" spreadmethod="pad"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> <radialgradient id...
...="gradientrepeat" cx="0.5" cy="0.5" r="0.4" fx="0.75" fy="0.75" spreadmethod="repeat"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> <radialgradient id="gradientreflect" cx="0.5" cy="0.5" r="0.4" fx="0.75" fy="0.75" spreadmethod="reflect"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradientpad)"/> <rect x="10" y="120" rx="15" ry="15" width="100" height="100" fill="url(#gradientrepeat)"/> <rect x="120" y="120" rx="15" ry="15" width="100" height="100" fill="url(#gradientreflect)"/> <text x="15" y="30" fill="whit...
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
using the xsltprocessor.getparameter() method, the code can figure whether to sort in ascending or descending order.
...once instantiated, an xsltprocessor has an xsltprocessor.importstylesheet() method that takes as an argument the xslt stylesheet to be used in the transformation.
...to function correctly in netscape, this element, with the method attribute, must be used.
... as of 7.0, method="text" works as expected.
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
once instantiated, an xsltprocessor has an xsltprocessor.importstylesheet() method that takes as an argument the xslt stylesheet to be used in the transformation.
...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.
... // importnode is used to clone the nodes we want to process via xslt - true makes it do a deep clone var mynode = document.getelementbyid("example"); var clonednode = xmlref.importnode(mynode, true); // add the cloned dom into the xml document xmlref.appendchild(clonednode); once the stylesheet has been imported, xsltprocessor has to perform two methods for the actual transformation, namely xsltprocessor.transformtodocument() and xsltprocessor.transformtofragment().
... figure 2.1 : creating an xml document from a string 'xml soup' while you can use ie loadxml method to load a string containing xml you have to perform some tweaking and tuning to do the same in mozilla.
Using the WebAssembly JavaScript API - WebAssembly
this is achieved using the webassembly.compilestreaming() and webassembly.instantiatestreaming() methods.
... these methods are easier than their non-streaming counterparts, because they can turn the byte code directly into module/instance instances, cutting out the need to separately put the response into an arraybuffer.
... loading our wasm module without streaming if you can't or don't want to use the streaming methods as described above, you can use the non-streaming methods webassembly.compile / webassembly.instantiate instead.
... these methods don't directly access the byte code, so require an extra step to turn the response into an arraybuffer before compiling/instantiating the wasm module.
Communicating With Other Scripts - Archive of obsolete content
content scripts content scripts loaded into the same document at the same time using the same method can interact with each other directly as well as with the web content itself.
... 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.
... if an add-on loads two or more content scripts into the same page, or panel, using two different method (e.g.
port - Archive of obsolete content
port methods emit() the port.emit() function sends a message from one side to the other.
...the port object offers a shortcut to do this: the once() method.
...this means you can't send functions, and if the object contains methods they won't be encoded.
request - Archive of obsolete content
once a request object has been created a get request can be executed by calling its get() method, a post request by calling its post() method, and so on.
...request({ url: "https://api.twitter.com/1.1/application/rate_limit_status.json", oncomplete: function (response) { if (response.json.remaining_hits) { latesttweetrequest.get(); } else { console.log("you have been rate limited!"); } } }).get(); methods get() make a get request.
...it is returned by the get(), head(), post(), put() or delete() method of a request object.
tabs - Archive of obsolete content
to activate a tab object, call its activate method.
...it contains various tab properties, several methods for manipulation, as well as per-tab event registration.
... methods pin() pins this tab as an app tab.
core/promise - Archive of obsolete content
in the add-on sdk we follow commonjs promises/a specification and model a promise as an object with a then method, which can be used to get the eventual return (fulfillment) value or thrown exception (rejection): foo().then(function success(value) { // ...
... propagation the then method of a promise returns a new promise that is resolved with the return value of either handler.
... defer(); promise.then(deferred.resolve, deferred.reject); delay(ms, 'timeout').then(deferred.reject); return deferred.promise; } var tweets = readasync(url); timeout(tweets, 20).then(function(data) { ui.display(data); }, function() { alert('network is being too slow, try again later'); }); alternative promise apis there may be cases where you will want to provide more than just then method on your promises.
Running applications - Archive of obsolete content
using nsilocalfile.launch() this method is not implemented on all platforms, especially not on unix/linux!
... see nsilocalfile.launch() for details and make sure that all your target platforms support this method!
... this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
follow every step methodically and you'll probably be alright.
...the easiest way to accomplish the latter is to use inline implementations for all methods so you don't have any additional linking dependencies.
...the component implementation will include the methods for retrieving the path or file for the extension's home directory: mylocation.prototype = { queryinterface: function(iid) { if (iid.equals(nsisupports)) return this; if (iid.equals(myilocation)) return this; components.returncode = components.results.ns_error_no_interface; return null; }, get locationfile() { return __location__.parent.parent;...
Extension Etiquette - Archive of obsolete content
these often include areas such as: object prototypes, such as string.prototype, which are often extended to add methods to native objects.
... call .noconflict(true) where applicable many common libraries which create global variables provide a method called noconflict, or similar, which revert any global variables they've declared, and return the object itself.
... when available, these methods should always be used to prevent conflicts with third-party code.
Adding windows and dialogs - Archive of obsolete content
the prompt service has a confirm method with similar behavior: let prompts = cc["@mozilla.org/embedcomp/prompt-service;1"].
...} else { // do something else } the method returns a boolean value indicating the user's response.
...the confirmex and prompt methods are the most customizable, allowing a great deal of options that cover most common dialog cases.
Handling Preferences - Archive of obsolete content
get count() { return this._prefservice.getintpref("extensions.xulschoolhello.message.count"); }, increment : function() { let currentcount = this._prefservice.getintpref("extensions.xulschoolhello.message.count"); this._prefservice.setintpref("extensions.xulschoolhello.message.count", currentcount + 1); } one important thing to keep in mind is that the "get" methods of the service can throw an exception if the preference is not found.
... preference listeners the xpcom way to add a listener was mentioned in the xpcom section when describing the queryinterface method: this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.addobserver(prefname, this, false); this._prefservice.queryinterface(ci.nsiprefbranch); all the qi'ing is necessary because the addobserver method is in a different interface, and other than for adding and removing observers, we use the nsiprefbranch interface for everything related to preferences.
... then, create the observer method: observe : function(asubject, atopic, adata) { if ("nspref:changed" == atopic) { let newvalue = asubject.getintpref(adata); // do something.
Tabbed browser - Archive of obsolete content
opening a url in the correct window/tab there are methods available in chrome://browser/content/utilityoverlay.js that make it easy to open url in tabs such as openuilinkin and openuilink.
... gbrowser.removecurrenttab(); there is also a more generic removetab method, which accepts a xul tab element as its single parameter.
...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.
Firefox addons developer guide - Archive of obsolete content
rules: file and directory names: italic method and variable names: class name if you want to add a fixme, add: fixme: a message notes: the original document is in japanese and distributed via the xuldev.org website.
... method and function names should have parentheses after them.
... for example, here: https://developer.mozilla.org/en/firefox_addons_developer_guide/let's_build_a_firefox_extension#init_method the text of the paragraph should begin "the <code>init()</code> method is as shown...".
Using the Stylesheet Service - Archive of obsolete content
adding a stylesheet to use the stylesheet service, you get a reference to the service, create a uri and pass the uri to the stylesheet service's loadandregistersheet method.
...vice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("chrome://myext/content/myext.css", null, null); sss.loadandregistersheet(uri, sss.user_sheet); note: loadandregistersheet will load the stylesheet synchronously, so you should only call this method using local uris.
...twork/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("chrome://myext/content/myext.css", null, null); if(!sss.sheetregistered(uri, sss.user_sheet)) sss.loadandregistersheet(uri, sss.user_sheet); removing a previously registered stylesheet if you wish to remove a stylesheet that you previously registered, simply use the unregistersheet method.
Creating reusable content with CSS and XBL - Archive of obsolete content
you can use xbl to link selected elements to their own: stylesheets content properties and methods event handlers because you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse.
...div anonid="square"/> <xul:button anonid="button" type="button"> <children/> </xul:button> </content> <implementation> <field name="square"><![cdata[ document.getanonymouselementbyattribute(this, "anonid", "square") ]]></field> <field name="button"><![cdata[ document.getanonymouselementbyattribute(this, "anonid", "button") ]]></field> <method name="dodemo"> <body><![cdata[ this.square.style.backgroundcolor = "#cf4" this.square.style.marginleft = "20em" this.button.setattribute("disabled", "true") settimeout(this.cleardemo, 2000, this) ]]></body> </method> <method name="cleardemo"> <parameter name="me"/> <body><![cdata[ me.square.style.backgroundcolor = "trans...
...parent" me.square.style.marginleft = "0" me.button.removeattribute("disabled") ]]></body> </method> </implementation> <handlers> <handler event="click" button="0"><![cdata[ if (event.originaltarget == this.button) this.dodemo() ]]></handler> </handlers> </binding> </bindings> make a new css file, bind6.css.
Index of archived content - Archive of obsolete content
macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate trigger scripts and install scripts windows install file object methods install object methods properties installversion object methods properties return codes winprofile object...
... methods winreg object methods winregvalue xpjs components proposal xre xtech 2005 presentations directions of the mozilla rdf engine extending gecko with xbl and xtf mozilla e4x rich web svg and canvas in mozilla xul - mozilla's xml user interface language xtech 2006 presentations xul explorer xulrunner applic...
... npn_destroystream npn_enumerate npn_evaluate npn_forceredraw npn_getauthenticationinfo npn_getintidentifier npn_getproperty npn_getstringidentifier npn_getstringidentifiers npn_geturl npn_geturlnotify npn_getvalue npn_getvalueforurl npn_hasmethod npn_hasproperty npn_identifierisstring npn_intfromidentifier npn_invalidaterect npn_invalidateregion npn_invoke npn_invokedefault npn_memalloc npn_memflush npn_memfree npn_pluginthreadasynccall npn_posturl npn_posturlnotify npn_rel...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
this new navigational method allows us to make html user interfaces behave similarly to non-web based applications such as contact management software.
...data request \________ dynamically create a hidden iframe \_________ content is loaded -> call data binder data binder \_____ load xml||html data from iframe "container" \_____ send content to proper layout components the method presented here separates data request from data binding.
...to demonstrate how the callback mechanism is implemented, imagine the following html page loaded into the iframe as a result of a request (retrievedata method requested the html file in to be loaded in the iframe): <body onload="top.iframecallback(document);" > <mydata> this is the content that comes from the server </mydata> </body> note that when the page is loaded into the iframe, the onload event is fired and the parent.iframecallback function is called in the context of the parent document (the originator).
Monitoring WiFi access points - Archive of obsolete content
the onchange() method (lines 13 through 27) begins by enabling universalxpconnect privileges, then clearing out the div (d) that will receive the updated list of access points.
...the onerror() method simply opens an alert that displays the error code received.
...the monitoring is started up on line 47, by calling the wifi monitoring service's startwatching() method.
Dehydra Object Reference - Archive of obsolete content
the following additional properties are available on functions: property type description .isvirtual true or "pure" true for virtual methods, or "pure" for pure virtuals (e.g.
...each member of the array has the following properties: { access: 'public' | 'protected' | 'private', type: type object representing the base class } .members array of variable objects an array containing all the member variables and methods.
... function type these represent the types functions and methods in the type system: property type description .type type object the function return type.
Editor Embedding Guide - Archive of obsolete content
in calling this method, the editor is created underneath and the event listeners are all prepa if (ns_failed(rv)) return ns_error_failure; // we are not setup??!!
...-saari writing once you have created an nsicommandparams you call the "set" methods.
... first getnext (returns the next name in the name/value pair list) hasmoreelements getvaluetype (numeric enum type see nsicommandparams for values) if the name/value pair is known or it was obtained using the methods described above, it is possible to call the following methods: getbooleanvalue getlongvalue getdoublevalue getstringvalue getcstringvalue getisupportsvalue all of these take pointers to values except for getstringvalue which demands a reference to an nsastring.
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.
... the ns_nointerface error is never reported when returned by a javascript object's queryinterface() method on the nsisupports interface.
... the ns_nointerface error is never reported when returned by a javascript object's getinterface() method on the nsiinterfacerequestor interface.
Documentation for BiDi Mozilla - Archive of obsolete content
this method uses the uba to determine the directional properties of the text and reorder frames if necessary.
...for systems without bidi capabilities, the methods in nsiubidiutils are used.
...ic swapping reordering shaping numeric translation conversion to/from presentation forms nsbidipresutils layout/base/nsbidipresutils.cpp utilities for the layout engine including: resolve frames by bidi level split framesreorder frames format bidi text support for deletion and insertion of frames by editor nsbiditextframe layout/generic/nsbidiframes.cpp subclass of nsframe with additional method setoffsets, to adjust mcontentoffset and mcontentlength during bidi processing nsdirectionalframe layout/generic/nsbidiframes.cpp subclass of nsframethis is a special frame which represents a bidi control.
Layout System Overview - Archive of obsolete content
each frame implements a reflow method to compute its position and size, among other things.
...in many cases the presentation shell provides pass-through methods to the style set, and generally uses the style set to do style resolution and style sheet management.
...frame construction is generally achieved by the use of stateless methods, but in some cases there is the need to provide context to frames created as children of a container.
Introducing the Audio API extension - Archive of obsolete content
var samples = new float32array(22050); for (var i = 0; i < samples.length ; i++) { samples[i] = math.sin( i / 20 ); } output.mozwriteaudio(samples); } </script> </head> <body> <p>this demo plays a one second tone when you click the button below.</p> <button onclick="playtone();">play</button> </body> </html> the mozcurrentsampleoffset() method gives the audible position of the audio stream, meaning the position of the last heard sample.
...var currentsampleoffset = audiooutput.mozcurrentsampleoffset(); audio data written using the mozwriteaudio() method needs to be written at a regular interval in equal portions, in order to keep a little ahead of the current sample offset (the sample offset that is currently being played by the hardware can be obtained with mozcurrentsampleoffset()), where "a little" means something on the order of 500 ms of samples.
... autolatency = false; } processing an audio stream since the mozaudioavailable event and the mozwriteaudio() method both use float32array values, it is possible to take the output of one audio stream and pass it directly (or process first and then pass) to a second.
Enabling Experimental Jetpack Features - Archive of obsolete content
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
...methods import(stringmountpath string)imports the requested experimental feature into the script.
...to get a list of mount paths that are available, see the method below.
Enabling - Archive of obsolete content
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
...methods import(stringmountpath string)imports the requested experimental feature into the script.
...to get a list of mount paths that are available, see the method below.
Enabling Experimental Jetpack Features - Archive of obsolete content
ArchiveMozillaJetpackdocsMetaFuture
the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module.
...methods import(stringmountpath string)imports the requested experimental feature into the script.
...to get a list of mount paths that are available, see the method below.
Message Summary Database - Archive of obsolete content
nsimsgfolder has a method to get the database for a folder.
...there are a set of generic property methods so that core code and extensions can set attributes on msg headers without changing nsimsghdr.idl.msg threads we store thread information persistently in the database and expose these object through the [nsimsgthread interface.
...there is a method on nsimsgdatabase to get the dbfolderinfo.
Scripting - Archive of obsolete content
the platform property implements the nsiplatformglue interface, whose methods are described in the following section.
... methods of the window.platform object can be called from webapp.js or from web content.
... the following code can be used by web content to determine whether it is running in prism: if ("platform" in window) { // prism-specific code goes here } see the nsiplatformglue idl definition file for details of the methods available to prism apps.
XBL 1.0 Reference - Archive of obsolete content
bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted around the bound element.
... 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 content and css selectors and scopes binding stylesheets binding implementations introduction methods properties inheritance of implementations event handlers example - sticky notes updated and adjusted for the current firefox implementation.
gestalt - Archive of obsolete content
method of install object syntax int gestalt ( string selector ); parameters the gestalt method takes the following parameters: selector the selector code for the information you want.
...description the gestalt method is a wrapper for the gestalt function of the macintosh toolbox.
...this method returns null on unix and windows platforms.
getComponentFolder - Archive of obsolete content
method of install object syntax object getcomponentfolder (string registryname); object getcomponentfolder ( string registryname, string subdirectory); parameters the getcomponentfolder method has these parameters: registryname the pathname in the client version registry for the component whose installation directory is to be obtained.
... description the getcomponentfolder method to find the location of a previously installed software package.
... typically, you use this method with the addfile method or the adddirectory method.
refreshPlugins - Archive of obsolete content
method of install object syntax int refreshplugins( [ areloadpages ] ); parameters the refreshplugins method has the following parameter: areloadpages areloadpages is an optional boolean value indicating whether you want to reload the open web pages after you have refreshed the plug-in list.
...when you use this method in an installation script, as the example below demonstrates, you can install new plug-ins and use them to display the requested media in a web page without interrupting the experience of the user.
... note that refreshplugins must be called after the performinstall method that initiates the actual installation.
registerChrome - Archive of obsolete content
method of install object syntax int registerchrome( switch, srcdir, xpipath); parameters the registerchrome method has the following parameters: switch switch is the chrome switch indicating what type of file is being registered.
...filespecobjects like that required by this function are created using the getfolder method on the install object.
...in some situations the method may return other errors.
getString - Archive of obsolete content
method of winprofile object syntax string getstring ( string section, string key); parameters the method has the following parameters: section section in the file, such as "boot" or "drivers".
...description the getstring method is similar to the windows api function getprivateprofilestring.
... unlike that function, this method does not support using a null key to return a list of keys in a section.
writeString - Archive of obsolete content
method of winprofile object syntax boolean writestring ( string section, string key, string value); parameters the method has the following parameters: section section in the file, such as "boot" or "drivers".
... description the writestring method is similar to the windows api function writeprivateprofilestring.
...unlike the writeprivateprofilestring function, this method does not support using a null key to delete an entire section.
getValueString - Archive of obsolete content
method of winreg object syntax string getvaluestring ( string subkey, string valname); parameters the getvaluestring method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...description the getvaluestring method gets the value of a string.
... if the value is not a string, use the getvalue method instead.
setRootKey - Archive of obsolete content
method of winreg object syntax void setrootkey ( int key ); parameters the method has the following parameter: key an integer representing a root key in the registry.
...if you want to access keys in another portion, you must use this method to change the root key.
... on 16-bit windows platforms, hkey_classes_root is the only valid value and this method does nothing.
XPInstall API reference - Archive of obsolete content
objects install properties methods adddirectory addfile alert cancelinstall confirm deleteregisteredfile execute gestalt getcomponentfolder getfolder getlasterror getwinprofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins r...
...egisterchrome reseterror setpackagefolder installtrigger no properties methods compareversion enabled getversion install installchrome startsoftwareupdate installversion properties methods compareto init tostring file no properties methods copy dircreate dirgetparent dirremove dirrename diskspaceavailable execute exists isdirectory isfile macalias moddate moddatechanged move remove rename size windowsgetshortname windowsregisterserver windowsshortcut winprofile ...
... no properties methods getstring writestring winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvaluestring iskeywritable keyexists setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other information return codes see complete list examples trigger scripts and install scripts code samples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install ...
XPJS Components Proposal - Archive of obsolete content
at this point the module will use the (new) methods on the components object to register itself with the component manager as a factory module for one or more classid or progid.
...the component manager (and anyone else with a reference to that factory) can then call the factory's createinstance method at will.
...if the xpjsmanager is asked to trim itself back (by whatever means) it will call the nscanunload method (if present) on each module.
Accessing Files - Archive of obsolete content
one such method it provides is nsiscriptableio.getfile() which returns a new nsifile object.
...the exists method returns true if the file is present and false if it is not.
...the file object has a nsifile.create() method which may be used to create an empty file, or you can open a writing stream and write to the file.
Getting File Information - Archive of obsolete content
file permissions several methods may be used to check for file permissions.
... the following four methods return true or false: nsifile.isreadable() - returns true if the file can be read from.
... the four methods above are usually sufficient for most purposes.
Introduction to XUL - Archive of obsolete content
at this time these additional dom methods are available, though the code is of course the most accurate place to look for this information.
... xulelement also supports other methods for hooking up broadcasters; a function performed automatically by the xul document loader and therefore not normally used in javascript.
...however in practice, most nodes in xul have these identifiers, which enable the nodes to be retrieved easily using the aom's getelementbyid method.
getElementsByAttribute - Archive of obsolete content
if the second argument is '*', the method will match the given attribute set to any value.
... note that like most nodelists (but unlike the nodelist returned by queryselectorall), the nodelist returned by this method is live.
... note that this method is only available on xul elements; it is not part of the w3c dom.
ContextMenus - Archive of obsolete content
to cancel a context menu event, you can use the preventdefault method of the event object.
...n checkcontextmenu(event) { if (event.target.localname == "textbox") event.preventdefault(); } function init() { var container = document.getelementbyid("container"); container.addeventlistener("contextmenu", checkcontextmenu, true); } the 'checkcontextmenu' function checks to see if the textbox was the target of the context menu and, if so, cancels the event using the preventdefault method.
...the event listener is attached using the addeventlistener method within the 'init' function.
Popup Guide - Archive of obsolete content
to open a popup using script use the openpopup method or the openpopupatscreen method.
... moving a popup popups may be moved using the moveto method.
... resizing a popup the size of a popup may be adjusted using the sizeto method.
Filtering - Archive of obsolete content
whether a triple or member is added or removed, the template must be rebuilt by calling the rebuild method.
... this method will remove all of the existing generated content, delete all of the internal information pertaining to the results, and start again as if the template were just being examined for the first time.
...we'll use this method here since we've already seen examples of generating results from a container.
RDF Modifications - Archive of obsolete content
when this happens, any templates observing the datasource will be notified via the rdf observer's onassert method.
...in effect, this isn't any different than adding the same set of triples yourself using the assert method.
...the rdf observer also has two methods onbeginupdatebatch and onendupdatebatch.
SQLite Templates - Archive of obsolete content
the second method involves using a special url form: profile:filename.sqlite this form with the 'profile' prefix is used to refer to files in the profile directory.
...one possibility is to simply use methods to adjust the text within the query element and rebuild the template.
...you would likely want to add an id to the param element so that the getelementbyid method may be used to refer to it.
Sorting Results - Archive of obsolete content
this method of sorting a seq works best for the simple query syntax since it is obvious how the starting ref relates to the end member results (they are just the children), or for extended syntax queries that follow a similar pattern.
...changing the sort to change the sorting for a template's generated contents, you can either change the sort related attributes and rebuild the template, or you can call the sort method of the sort service: var listbox = document.getelementbyid("alistbox"); var sortservice = components.classes["@mozilla.org/xul/xul-sort-service;1"].
...the arguments to the sort method specify the root node (the listbox), the sort key and the sort direction.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
note: for information about how to find the directory where you installed seamonkey, see: installation directory if you cannot easily find the directory, you can use the following method to find it.
... alternate "quick and dirty" method for hooking up a single preexisting xul file to display in seamonkey: as described above, find the seamonkey\chrome folder.
...this may not be the most relevant spot for this addition, i posted this here because the above approach proved successful after hours of unsuccessful tinkering with methods that proved to be obsolete or broken for various reasons.
Introduction to XBL - Archive of obsolete content
the behavior describes the properties and methods of the scroll bar in addition to describing the xul elements that make up a scroll bar.
...the following example shows the basic skeleton of an xbl file: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl"> <binding id="binding1"> <!-- content, property, method and event descriptions go here --> </binding> <binding id="binding2"> <!-- content, property, method and event descriptions go here --> </binding> </bindings> the bindings element is the root element of an xbl file and contains one or more binding elements.
... methods: methods added to the element.
Tree Box Objects - Archive of obsolete content
note: it is not necessary to run tree.boxobject.queryinterface(components.interfaces.nsitreeboxobject) as shown in the code examples on this page because: let boxobject = tree.treeboxobject; note: is equivalent to: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); scrolling the tree you can also scroll the tree using four different methods, similar to those available for listboxes.
... additional scroll methods include the scrollbylines(), scrollbypages() and ensurerowisvisible() functions.
...this is a convenient method since when the user resizes a flexible tree, the page size will grow and shrink, so you don't need to calculate the page size manually.
XPCOM Examples - Archive of obsolete content
the cookie manager has an enumerator method which returns an object which implements nsisimpleenumerator.
...an enumerator has a hasmoreelements() method which will return true until we get to the last cookie.
... the getnext() method gets a cookie and moves the enumerator index to the next cookie.
Using spell checking in XUL - Archive of obsolete content
checking the spelling of a word to check the spelling of a word, you must first create an interface to the mozispellcheckingengine component and then call the check() method on the string you wish to test.
... this method returns true if the word is correctly spelled, or false if it's not.
... .getservice(components.interfaces.mozipersonaldictionary); if (mpersonaldictionary.check("kat", gspellcheckengine.dictionary)) { // it's spelled correctly accourdly to user personal dictionary } else { // it's spelled incorrectly } } getting a list of suggestions to get a list of suggestions for a misspelled word, you call the suggest() method, specifying the word and an object to be filled with an array of possible suggestions.
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.
...json string) from the server, parsing it on client, and building the menupopup using dom methods (such as document.createelementns).
...pass a python string/int/etc to the method requiring an nsivariant.
The Implementation of the Application Object Model - Archive of obsolete content
four interfaces with over 100 methods combined, a significant portion of which are redundant.
... statement #1 the two points raised in the previous two paragraphs, namely (1) redundancy of methods in the interfaces as well as a likely code redundancy in the implementation of some of those methods, and (2) the desire to be insulated from the layout dll should those interfaces change, imply that a layer needs to exist between the pluggable content and the content tree interfaces.
...first of all it could streamline the redundancy in the interface methods and present a new interface for pluggable content that was much smaller and easier to plug into than the 4-5 interfaces required if directly implementing the content tree interfaces.
button - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a button that can be pressed by the user.
...you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
commandset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is not displayed and serves as a container for command elements.
...you can send a custom event by calling the updatecommands method of the command dispatcher.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
dialog - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element should be used in place of the window element for dialog boxes.
...uttonaccesskeyaccept, buttonaccesskeycancel, buttonaccesskeydisclosure, buttonaccesskeyextra1, buttonaccesskeyextra2, buttonaccesskeyhelp, buttonalign, buttondir, buttondisabledaccept, buttonlabelaccept, buttonlabelcancel, buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultbutton, title properties buttons, defaultbutton methods acceptdialog, canceldialog, centerwindowonscreen, getbutton, movetoalertposition examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" buttonlabelcancel="cancel" buttonlabelaccept="save"> <d...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagna...
iframe - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an inner frame that works much like the html <iframe> element.
...most of its methods are callable directly on the element itself, such as goback and goforward.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), remove...
notificationbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the notificationbox element is used to display notifications above an element.
... properties currentnotification, allnotifications, notificationshidden methods appendnotification, getnotificationwithvalue, removeallnotifications, removecurrentnotification, removenotification, removetransientnotifications, attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, inse...
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserda...
promptBox - Archive of obsolete content
it's returned by the tabbrowser method gettabmodalpromptbox method.
...you should use the window.alert() method or the nsiprompt interface instead.
...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.
scale - Archive of obsolete content
ArchiveMozillaXULscale
« xul reference home [ examples | attributes | properties | methods | related ] a scale (sometimes referred to as a "slider") allows the user to select a value from a range.
... attributes dir, disabled, increment, max, min, movetoclick, pageincrement, tabindex, value properties disabled, max, min, increment, pageincrement, tabindex, value, methods decrease, decreasepage, increase, increasepage, examples horizontal scale: <scale min="1" max="10"/> vertical scale: <scale min="1" max="10" orient="vertical"/> attributes dir type: one of the values below the direction in which the child elements of the element are placed.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
scrollbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a box that has additional functions that can be used to scroll the content.
...do this instead: var xpcominterface =scrollbox_element.boxobject.queryinterface( components.interfaces.nsiscrollboxobject); xpcominterface.ensureelementisvisible(child_element_to_make_visible); see the nsiscrollboxobject api for other scroll-related methods.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
tab - Archive of obsolete content
ArchiveMozillaXULtab
« xul reference home [ examples | attributes | properties | methods | related ] a single tab which should be placed inside a tabs element.
...the tabbrowser element's pintab and unpintab methods handle pinning and unpinning tabs.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
toolbarbutton - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a button that appears on a toolbar.
...you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
window - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] describes the structure of a top-level window.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
...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.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
(there is a diff below.) you'll need: sasoapclient.js saxmlutils.js making a soap call var url = 'http://example.com/soap/'; var ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.reporterror(obj.tosource()); }; soapclient.proxy = url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(url, body); req.action = ns + '#' + method; soapclient.sendrequest(req...
...-- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: content, < complete: getresponse, < contenttype: soapclient.contenttype + "; charset=\"" + soapclient.charset + "\"", < beforesend: function(req) { < req.setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < req.setrequestheader("soapserver", soapclient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroundrequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.onreadystatechange = function()...
... { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers) { xhr.setrequestheader(h, headers[h]); } > xhr.send(content); ...
calICalendarViewController - Archive of obsolete content
e-360e0de38237)] interface calicalendarviewcontroller : nsisupports { void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); void modifyoccurrence (in caliitemoccurrence aoccurrence, in calidatetime anewstarttime, in calidatetime anewendtime); void deleteoccurrence (in caliitemoccurrence aoccurrence); }; methods createnewevent void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); the createnewevent method is used for creating a new calievent in the calicalendar specified by the acalendar parameter.
... modifyoccurrence void modifyoccurrence (in caliitemoccurrence aoccurrence, in calidatetime anewstarttime, in calidatetime anewendtime); the modifyoccurrence method is used to change the attributes of an already existing caliitem.
... deleteoccurrence void deleteoccurrence (in caliitemoccurrence aoccurrence); the deleteoccurrence method is called when by the calicalendarview when caliitem should be deleted.
2006-10-20 - Archive of obsolete content
method shouldload in "content-policy" category problem ?
... a student learning xpcom is having issues with the method shouldload in the interface nslcontentpolicy.
... when the method is executed firefox crashes.
Monitoring plugins - Archive of obsolete content
below are a number of javascript snippets that would be useful to developers trying to use this feature: registration to register for runtime notifications with the observer service you must create a class with an observe method which receives 3 parameters (subject, topic and data) as well as a register method that contains the following code: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice (components.interfaces.nsiobserverservice); observerservice.addobserver(this, "experimental-notify-plugin-call", false); observing as discussed above, to specif...
...y what you want done when a notification arrives your class must have an observe method, receiving 3 parameters (subject, topic and data).
... clean up to unregister your class with the observer service - when you no longer want to be listening to runtime notifications - your class must include an unregister method that contains the following code: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "experimental-notify-plugin-call"); skeleton observer class below is a skeleton class that you may use to listen to runtime notifications: function pluginobserv...
NPN_InvalidateRect - Archive of obsolete content
npn_invalidaterect() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in.
... after calling this method, the plug-in receives a paint message asynchronously.
...to immediately send a paint message, the plug-in can call npn_forceredraw() after calling this method.
NPN_InvalidateRegion - Archive of obsolete content
npn_invalidateregion() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in.
... if a plug-in calls this method, it receives a paint message later.
...to force a paint message, the plug-in can call npn_forceredraw() after calling this method.
Developing cross-browser and cross-platform pages - Archive of obsolete content
this method has the advantage of not requiring you to test for anything except whether the particular features you code are supported in the visiting browser.
... 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.
The global XML object - Archive of obsolete content
you can only define methods in xml.prototype and not fields.
... to add a method to xml.prototype, define xml.prototype.function::methodname or xml.prototype.function::[methodnamestring].
... the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.prototype.function::foocount = function foocount() { return this..foo.length(); }; <foobar><foo/><foo/><foo/></foobar>.foocount() // returns 3 ignorecomments true by default.
Date.getVarDate() - Archive of obsolete content
warning: this method is supported in internet explorer only.
... the getvardate method returns a vt_date value from a date object.
... remarks the getvardate() method is used when javascript code interacts with com objects, activex objects, or other objects that accept and return date values in vt_date format.
Enumerator.atEnd - Archive of obsolete content
the enumerator.atend method returns a boolean value indicating if the enumerator is at the end of the collection.
... the atend method returns true if the current item is the last one in the collection, the collection is empty, or the current item is undefined.
... example in following code, the atend method is used to determine if the end of a list of drives has been reached: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb free of "; s += totalgb.tofixed(3) + " gb"; } else { s += "not ready"; } s += "<br />"; e.movenex...
VBArray.lbound - Archive of obsolete content
the vbarray.lbound method returns the lowest index value used in the specified dimension of a vbarray.
... syntax safearray.lbound(dimension) remarks if the vbarray is empty, the lbound method returns undefined.
... if dimension is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error.
VBArray.ubound - Archive of obsolete content
the vbarray.ubound method returns the highest index value used in the specified dimension of the vbarray.
... remarks if the vbarray is empty, the ubound method returns undefined.
... if dim is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error.
XForms Custom Controls Examples - Archive of obsolete content
output showing images <binding id="output-image" extends="chrome://xforms/content/xforms.xml#xformswidget-base"> <content> <html:div> <html:img anonid="content"/> </html:div> </content> <implementation implements="nsixformsuiwidget"> <method name="refresh"> <body> var img = document.getanonymouselementbyattribute(this, "anonid", "content"); img.setattribute("src", this.stringvalue); return 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.
...gvalue; 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> ...
Building up a basic demo with Babylon.js - Game development
var renderloop = function () { scene.render(); }; engine.runrenderloop(renderloop); we're using the engine's runrenderloop() method to execute the renderloop() function repeatedly on every frame — the loop will continue to render indefinitely until told to stop.
... note: you probably noticed the babylon.vector3() method in use here — this defines a 3d position on the scene.
...in this case we're creating a box using the mesh.createbox method with it's own name, a size of 2, and a declaration of which scene we want it added to.
Building up a basic demo with Three.js - Game development
the setclearcolor() method sets our background to a light gray colour, instead of the default black one.
...let's create it, by adding the following line below our previous lines: var scene = new three.scene(); later, we will be using the .add() method, to add objects to this scene.
... var torusgeometry = new three.torusgeometry(7, 1, 6, 12); var phongmaterial = new three.meshphongmaterial({color: 0xff9500}); var torus = new three.mesh(torusgeometry, phongmaterial); scene.add(torus); these lines will add a torus geometry; the torusgeometry() method's parameters define, and the parameters are radius, tube diameter, radial segment count, and tubular segment count.
Implementing controls using the Gamepad API - Game development
querying the gamepad object beside connect() and disconnect(), there are two more methods in the gamepadapi object: update() and buttonpressed().
... detecting button presses the buttonpressed() method is also placed in the main game loop to listen for button presses.
... getting the gamepads the navigator.getgamepads() method has been updated with a longer explanation and an example piece of code.
Square tilemaps implementation: Static maps - Game development
this is the atlas we will be using as an example, which features five different tiles: to draw a tile from the atlas into the canvas we make use of the drawimage() method in a canvas 2d context.
... gettile(): a helper method that gets the tile index in a certain position.
...in these examples, empty tiles will be represented by index 0, so we will shift the indices of the atlases by one (and thus the first tile of the atlas will be assigned index 1, the second index 2, etc.) the gettile() helper method returns the tile contained at the specified column and row.
Move the ball - Game development
first, add the following two lines above your draw() function, to define x and y: var x = canvas.width/2; var y = canvas.height-30; next update the draw() function to use the x and y variables in the arc() method, as shown in the following highlighted line: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } now comes the important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving.
...don't worry, because there's a method to clear canvas content: clearrect().
... this method takes four parameters: the x and y coordinates of the top left corner of a rectangle, and the x and y coordinates of the bottom right corner of a rectangle.
The score - Game development
we will use a separate variable for storing the score and phaser's text() method to print it out onto the screen.
...var scoretext; var score = 0; adding score text to the game display now add this line at the end of the create() function: scoretext = game.add.text(5, 5, 'points: 0', { font: '18px arial', fill: '#0095dd' }); the text() method can take four parameters: the x and y coordinates to draw the text at.
...this can be done using the settext() method — add the two new lines seen below to the ballhitbrick() function: function ballhitbrick(ball, brick) { brick.kill(); score += 10; scoretext.settext('points: '+score); } that's it for now — reload your index.html and check that the score updates on every brick hit.
Preflight request - MDN Web Docs Glossary: Definitions of Web-related terms
a cors preflight request is a cors request that checks to see if the cors protocol is understood and a server is aware using specific methods and headers.
... it is an options request, using three http request headers: access-control-request-method, access-control-request-headers, and the origin header.
... for example, a client might be asking a server if it would allow a delete request, before sending a delete request, by using a preflight request: options /resource/foo access-control-request-method: delete access-control-request-headers: origin, x-requested-with origin: https://foo.bar.org if the server allows it, then it will respond to the preflight request with an access-control-allow-methods response header, which lists delete: http/1.1 204 no content connection: keep-alive access-control-allow-origin: https://foo.bar.org access-control-allow-methods: post, get, options, delete access...
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods.
... javascript // using a string method doesn't mutate the string var bar = "baz"; console.log(bar); // baz bar.touppercase(); console.log(bar); // baz // using an array method mutates the array var foo = []; console.log(foo); // [] foo.push("plugh"); console.log(foo); // ["plugh"] // assignment gives the primitive a new (not a mutated) value bar = bar.touppercase(); // ba...
... the wrapper's valueof() method returns the primitive value.
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
the methods that access the registry are symbol.for() and symbol.keyfor(); these mediate between the global symbol table (or "registry") and the run-time environment.
... the global symbol registry is mostly built by javascript's compiler infrastructure, and the global symbol registry's content is not available to javascript's run-time infrastructure, except through these reflective methods.
... the method symbol.for(tokenstring) returns a symbol value from the registry, and symbol.keyfor(symbolvalue) returns a token string from the registry; each is the other's inverse, so the following is true: symbol.keyfor(symbol.for("tokenstring")) === "tokenstring" // true learn more general knowledge symbol (programming) on wikipedia javascript data types and data structures symbols in ecmascript 6 symbol in the mdn js reference object.getownpropertysymbols() ...
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
if an entire interface is experimental, then the interface's name is prefixed (but not the properties or methods within).
... if an experimental property or method is added to a standardized interface, then the individual method or property is prefixed.
... interface prefixes prefixes for interface names are upper-cased: webkit (chrome, safari, newer versions of opera, almost all ios browsers (including firefox for ios); basically, any webkit based browser) moz (firefox) o (older, pre-webkit, versions of opera) ms (internet explorer and microsoft edge) property and method prefixes the prefixes for properties and methods are lower-case: webkit (chrome, safari, newer versions of opera, almost all ios browsers (including firefox for ios); basically, any webkit based browser) moz (firefox) o (old, pre-webkit, versions of opera) ms (internet explorer and microsoft edge) sample usage: var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
not all http responses can be cached, these are the following constraints for an http response to be cached: the method used in the request is itself cacheable, that is either a get or a head method.
...(for example, firefox does not support it per https://bugzilla.mozilla.org/show_bug.cgi?id=109553.) other methods, like put or delete are not cacheable and their result cannot be cached.
... when both, the method of the request and the status of the response, are cacheable, the response to the request can be cached: get /pagex.html http/1.1 (…) 200 ok (…) a put request cannot be cached.
MDN Web Docs Glossary: Definitions of Web-related terms
tp header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier idl ietf iife imap immutable index indexeddb information architecture inheritance input method editor instance internationalization internet intrinsic size ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery json k key keyword l latency ...
...e local scope local variable locale localization long task loop lossless compression lossy compression ltr (left to right) m main axis main thread markup mathml media media (audio-visual presentation) media (css) metadata method microsoft edge microsoft internet explorer middleware mime mime type minification mitm mixin mobile first modem modern web apps modularity mozilla firefox mutable mvc n namespace nan nat native navigatio...
... slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed index sql sql injection sri stacking context state machine statement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error synthetic monitoring t tag tcp tcp handshake tcp slow start telnet ...
Handling different text directions - Learn web development
once you start to look at css layout, and in particular the newer layout methods, this idea of block and inline becomes very important.
... due to the fact that writing mode and direction of text can change, newer css layout methods do not refer to left and right, and top and bottom.
...however, ultimately we expect that people will transition to the logical versions for most things, as they make a lot of sense once you start also dealing with layout methods such as flexbox and grid.
Flexbox - Learn web development
previous overview: css layout next flexbox is a one-dimensional layout method for laying out items in rows or columns.
...this is another thing that is impossible to do with traditional layout methods.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Adding vector graphics to the Web - Learn web development
in the below code, older browsers will stick with the png that they understand, while newer browsers will load the svg: background: url("fallback.png") no-repeat center; background-image: url("image.svg"); background-size: contain; like the <img> method described above, inserting svgs using css background images means that the svg can't be manipulated with javascript, and is also subject to the same css limitations.
... cons this method is only suitable if you're using the svg in only one place.
... here's a quick review: <iframe src="triangle.svg" width="500" height="500" sandbox> <img src="triangle.png" alt="triangle with three unequal sides" /> </iframe> this is definitely not the best method to choose: cons iframes do have a fallback mechanism, as you can see, but browsers only display the fallback if they lack support for iframes altogether.
Introduction to events - Learn web development
the earliest method of registering event handlers found on the web involved event handler html attributes (or inline event handlers) like the one shown above — the attribute value is literally the javascript code you want to run when the event occurs.
...with javascript, you could easily add an event handler function to all the buttons on the page no matter how many there were, using something like this: const buttons = document.queryselectorall('button'); for (let i = 0; i < buttons.length; i++) { buttons[i].onclick = bgchange; } note that another option here would be to use the foreach() built-in method available on nodelist objects: buttons.foreach(function(button) { button.onclick = bgchange; }); note: separating your programming logic from your content also makes your site more friendly to search engines.
... it so that a random color is applied to each one when selected: const divs = document.queryselectorall('div'); for (let i = 0; i < divs.length; i++) { divs[i].onclick = function(e) { e.target.style.backgroundcolor = bgchange(); } } the output is as follows (try clicking around on it — have fun): most event handlers you'll encounter have a standard set of properties and functions (methods) available on the event object; see the event object reference for a full list.
Handling text — strings in JavaScript - Learn web development
try the following: let mystring = '123'; let mynum = number(mystring); typeof mynum; conversely, every number has a method called tostring() that converts it to the equivalent string.
...in the next article, we'll build on this, looking at some of the built-in methods available to strings in javascript and how we can use them to manipulate our strings into just the form we want.
...troubleshooting javascript storing the information you need — variables basic math in javascript — numbers and operators handling text — strings in javascript useful string methods arrays assessment: silly story generator ...
What went wrong? Troubleshooting JavaScript - Learn web development
line 48 is using a document.queryselector() method to get a reference to an element by selecting it with a css selector.
... looking further up our file, we can find the paragraph in question: <p class="loworhi"></p> so we need a class selector here, which begins with a dot (.), but the selector being passed into the queryselector() method in line 48 has no dot.
... syntaxerror: missing ) after argument list this one is pretty simple — it generally means that you've missed the closing parenthesis at the end of a function/method call.
Solve common problems in your JavaScript code - Learn web development
what is the difference between a function and a method?
... how do you get and set the methods and properties of an object?
... how do you add methods to the constructor?
Dynamic behavior in Svelte: working with variables and props - Learn web development
that means that the addtodo() function is executed, the element is added to the todos array, but svelte won't detect that the push method modified the array, so it won't refresh the tasks <ul>.
...instead, we'll take out the push() method and use spread syntax to achieve the same result — we'll assign a value to the todos array equal to the todos array plus the new object.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Getting started with Vue - Learn web development
with this method, you can use a lot of the core features of vue, such as the attributes, custom components, and data-management.
...this object is where you locally register components, define component inputs (props), handle local state, define methods, and more.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Understanding client-side JavaScript frameworks - Learn web development
adding a new todo form: vue events, methods, and models we now have sample data in place and a loop that takes each bit of data and renders it inside a todoitem in our app.
... what we really need next is the ability to allow our users to enter their own todo items into the app, and for that, we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data.
...these work similarly to methods but only re-run when one of their dependencies changes.
Accessibility/LiveRegionDevGuide
in addition to the standard priority queue methods, additional methods will need to be implemented that purge the queue based on one of the priority criterion.
... the "purge by timestamp" method will be used to remove old messages that are no longer deemed relevant while "purge by politeness" is used to satisfy the aria live politeness specification.
... the later method will be explained in detail below.
Creating MozSearch plugins
<searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> <url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchterms}" /> <url type="text/html" method="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> let's say t...
...3tdqn75d4xmavcok9armhbzaw0aecibhkalc0mdy7x9abna3obazxiaa6ikecglmvqhwwyjyul2d4v2cpg8vzswx7ghyaaak7aoif7saboqcmn4ha3ahfsidtgpq%2fvlz8p4mskj2w9h8ggbjevxvhdo4fquqg%2fkdypqcg4h8luiacnq%2fsobmyi8basajfpcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczxpcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla.org/en/docs/special:search</searchform> </searchplugin> notice in this case that instead of using <param> to define parameters to the search engine, they're simply embedded inside the template url.
... this is actually the preferred way to do things when using get as the method.
MozBeforePaint
gecko 2.0 adds a new method for performing javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.
...whenever you're ready to refresh your animation, you call the window.requestanimationframe() method.
...estamp - start; d.style.left = math.min(progress/10, 200) + "px"; if (progress < 2000) { window.mozrequestanimationframe(); } else { window.removeeventlistener("mozbeforepaint", step, false); } } window.addeventlistener("mozbeforepaint", step, false); window.mozrequestanimationframe(); </script> </body> </html> as you can see, each time the mozbeforepaint event fires, our step() method is called.
Overview of Mozilla embedding APIs
do_getinterface this function simplfies retrieving interfaces via the nsiinterfacerequestor::getinterface(...) method.
...to facilitate this, a set of global functions are available to access the nsmemory methods without requiring an instance of the nsmemory service (see nsmemory.h).
...first, it provides methods for the embedding application to notify a webbrowser of activation/deactivation and to control tabbing order...
JavaScript-DOM Prototypes in Mozilla
all the methods that are supposed to show up on this jsobject are actually not properties of the object itself, but rather properties of the prototype of the jsobject for the wrapper (unless the c++ object's class info has the flag nsixpcscriptable::dont_share_prototype set, but lets assume that's not the case here).
...a foo() method).
...creates a xpconnect javascript wrapper for a dom object), xpconnect will call the scriptable helper method nsdomclassinfo::postcreate() which will make sure the prototype chain of the wrapper jsobject is properly set up.
AddonListener
these notifications come in the form of calls to methods on the listener object.
... a listener only needs to implement the methods corresponding to the events it cares about; missing methods will not cause any problems.
... method overview void onenabling(in addon addon, in boolean needsrestart) void onenabled(in addon addon) void ondisabling(in addon addon, in boolean needsrestart) void ondisabled(in addon addon) void oninstalling(in addon addon, in boolean needsrestart) void oninstalled(in addon addon) void onuninstalling(in addon addon, in boolean needsrestart) void onuninstalled(in addon addon) void onoperationcancelled(in addon addon) void onpropertychanged(in addon addon, in string properties[]) methods onenabling() called when an add-on is about to be enabled.
FxAccountsOAuthClient.jsm
components.utils.import("resource://gre/modules/fxaccountsoauthclient.jsm"); creating a new fxaccountsoauthclient new fxaccountsoauthclient(object options); method overview launchwebflow(); teardown(); attributes parameters object returns the set of parameters that initialized the firefox accounts oauth flow.
...default: /authorization return value a newly created fxaccountsoauthclient object implementing the methods described in this article.
... methods launchwebflow() opens a new tab at the firefox accounts oauth authorization url.
FxAccountsProfileClient.jsm
components.utils.import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object options); method overview fetchprofile(); attributes serverurl url profiler server url.
... return value a newly created fxaccountsprofileclient object implementing the methods described in this article.
... methods fetchprofile() fetches firefox accounts profile information.
Log.jsm
keys of prototype: leveldesc logger(); length: 2 keys of prototype: addappender(); level logstructured(); name parent removeappender(); updateappenders(); and the methods mentioned below: logger methods loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); getinputstream(); newoutputstream(); ou...
...tputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0 enumerateproperties(); length: 2 member fields variable type description level object contains the following fields: field name value all 0 config 30 debug 20 desc { 0: "all", 10: "trace", 20: "debug", 30: "config", 40: "info", 50: "warn", 60: "error", 70: "fatal" } error 30 fatal 70 ...
... info 40 numbers { "all": 0, "trace": 10, "debug": 20, "config": 30, "info": 40, "warn": 50, "error": 60, "fatal": 70 } trace 10 warn 50 repository loggerrepository logger methods void fatal(string text, [optional] object params); void error(string text, [optional] object params); void warn(string text, [optional] object params); void info(string text, [optional] object params); void config(string text, [optional] object params); void debug(string text, [optional] object params); void trace(string text, [optional] object params); ...
OS.File.Info
instances of os.file.info may be obtained by: calling global method os.file.stat() either from the main thread or from a worker thread; calling instance method stat() of os.file either from the main thread or from a worker thread.
... global object os.file.info methods object tomsg(in os.file.info value) os.file.tomsg convert an instance of os.file.info to a form that can be serialized and transmitted between threads or processes.
...on older unix filesystems it is not possible to get a creation date as it was never stored, on new unix filesystems creation date is stored but the method to obtain this date differs per filesystem, bugzilla :: bug 1167143 explores implementing solutions for all these different filesystems) lastaccessdate the date at which the file was last accessed, as a javascript date object.
PerfMeasurement.jsm
method overview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data.
...note: these values are all zeroed (or set to -1, for events not being measured) when you initialize the perfmeasurement object, then they are not zeroed again unless you explicitly call the reset() method.
...methods canmeasuresomething() indicates whether or not the platform on which your code is running supports this code module.
PromiseUtils.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promiseutils.jsm"); method overview deferred defer(); methods defer() creates a new pending promise and provides methods to resolve or reject this promise.
... this method was previously implemented as promise.defer(), which is obsolete since gecko 30.
... return value a new object, containing the new promise in the promise property, and the methods to change its state in the resolve and reject properties.
Task.jsm
method overview function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator function, allows the associated task to be resolved with a specific value.
...; return "value"; } methods async() create and return an "async function" that starts a new task.
... async() simplifies the common pattern of implementing a method via a task, like this simple object with a greet method that has a name parameter and spawns a task to send a greeting and return its reply: let greeter = { message: "hello, name!", greet: function(name) { return task.spawn((function* () { return yield sendgreeting(this.message.replace(/name/, name)); }).bind(this); }) }; with async(), the method can be declared succinctly: let greeter...
WebChannel.jsm
method overview listen(function callback); stoplistening(); send(object message, eventtarget target); attributes id string webchannel id methods listen() registers the callback for messages on this channel.
... id - webchannel id of the incoming messages message - incoming message object sendercontext - incoming message context - this should be treated as an opaque object and passed to the .send() method stoplistening() resets the callback for messages on this channel.
... parameters message the message object that will be sent sendercontext the sendercontext parameter passed to the .listen method.
Refcount tracing and balancing
for example: perl -w tools/rb/make-tree.pl --object 0x00253ab0 < my-leak.log this will build an indented tree that looks something like this (except probably a lot larger and leafier): .root: bal=1 main: bal=1 dosomethingwithfooandreturnittoo: bal=2 ns_newfoo: bal=1 let's pretend in our toy example that ns_newfoo() is a factory method that makes a new foo and returns it.
... dosomethingwithfooandreturnittoo() is a method that munges the foo before returning it to main(), the main program.
...this is probably "okay" because it's a factory method that creates an addref()-ed object.
I/O Types
prfiledesc priomethods prfileprivate prdescidentity note that the nspr documentation follows the unix convention of using the termfiles to refer to many kinds of i/o objects.
...an i/o function on a prfiledesc structure is carried out by invoking the corresponding "method" in the i/o methods table (a structure of type priomethods) of the prfiledesc structure (the "object").
... different kinds of i/o objects (such as files and sockets) have different i/o methods tables, thus implementing different behavior in response to the same i/o function call.
PR_CreateIOLayerStub
syntax #include <prio.h> prfiledesc* pr_createiolayerstub( prdescidentity ident priomethods const *methods); parameters the function has the following parameters: ident the identity to be associated with the new layer.
... methods a pointer to the priomethods structure specifying the functions for the new layer.
...the file descriptor returned contains the pointer to the i/o methods table provided.
4.3 Release Notes
release date: 01 april 2009 introduction network security services for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1.
... new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type.
... libpkix: an rfc 3280 compliant certificate path validation library (see pkixverify) pk11token.needslogin method (see needslogin) support hmacsha256, hmacsha384, and hmacsha512 (see hmactest.java) support for all nss 3.12 initialization options (see initializationvalues) new ssl error codes (see http://mxr.mozilla.org/security/sour...util/sslerrs.h) ssl_error_unsupported_extension_alert ssl_error_certificate_unobtainable_alert ssl_error_unrecognized_name_alert ssl_error_bad_cert_status_response_alert ssl_error_bad_cert_hash_value_alert new tls cipher suites (see http://mxr.mozilla.org/security/sour...sslsocket.java): tls_rsa_with_camellia_128_cbc_sha tls_dhe_dss_with_camellia_128_cbc_sha tls_dhe_rsa_with_camellia_128_cbc_sha tls_rsa_with_camelli...
NSS_3.12_release_notes.html
igestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia support (see blapit.h): nss_camellia nss_camellia_cbc camellia_block_size new macros for rsa (see blapit.h): rsa_max_modulus_bits rsa_max_exponent_bits new macros in certt.h: x.509 v3 ku_encipher_only cert_max_serial_number_bytes cert_max_dn_bytes pkix cert_rev_m_do_not_test_using_this_method cert_rev_m_test_using_this_method cert_rev_m_allow_network_fetching cert_rev_m_forbid_network_fetching cert_rev_m_allow_implicit_default_source cert_rev_m_ignore_implicit_default_source cert_rev_m_skip_test_on_missing_source cert_rev_m_require_info_on_missing_source cert_rev_m_ignore_missing_fresh_info cert_rev_m_fail_on_missing_fresh_info cert_rev_m_stop_testing_on_fresh_info cert_rev_m_continue...
..._testing_on_fresh_info cert_rev_mi_test_each_method_separately cert_rev_mi_test_all_local_information_first cert_rev_mi_no_overall_info_requirement cert_rev_mi_require_some_fresh_info_available cert_policy_flag_no_mapping cert_policy_flag_explicit cert_policy_flag_no_any cert_enable_ldap_fetch cert_enable_http_fetch new macro in utilrename.h: smime_aes_cbc_128 the nssckbi pkcs #11 module's version changed to 1.70.
...bug 384926: libpkix build problems bug 389411: mingw build error - undefined reference to `_imp__pkix_errornames' bug 389904: avoid multiple decoding/encoding while creating and using pkix_pl_x500name bug 390209: pkix aia manager tries to get certs using aia url with ocsp access method bug 390233: umbrella bug for libpkix cert validation failures discovered from running vfyserv bug 390499: libpkix does not check cached cert chain for revocation bug 390502: libpkix fails cert validation when no valid crl (nist validation policy is always enforced) bug 390530: libpkix does not support time override bug 390536: cert validation functions must validate leaf cert themselves bug 39055...
NSS API Guidelines
usually, every public routine has a private counterpart, and the implementation of the public routine looks like this: nssimplement rv * nsstype_method ( nsstype *t, nssfoo *arg1, nssbar *arg2 ) { nss_clearerrorstack(); #ifdef debug if( !nssfoo_verifypointer(arg1) ) return (rv *)null; if( !nssbar_verifypointer(arg2) ) return (rv *)null; #endif /* debug */ return nsstype_method(t, arg1, arg2); } aside from error cases, all documented entry points s...
...this method is a more complicated than the other methods: requiring the calling of search code tolerant to often repeated element inspection.
... methods/functions design init, shutdown functions if a layer has some global initialization tasks, which need to be completed before the layer can be used, that layer should supply an initialization function of the form layer_init().
NSS Sample Code Sample1
the same methods outlined // in step 4 may be used here.
...this becomes the input to // the exportkeys method on the remote server.
...use the rsa-based wrapping // methods instead.
nss tech note1
the method type : whether the component type is constructed or primitive.
...tring, sec_asn1_printable_string, sec_asn1_t61_string, sec_asn1_teletex_string, sec_asn1_t61_string, sec_asn1_videotex_string, sec_asn1_ia5_string, sec_asn1_utc_time, sec_asn1_generalized_time, sec_asn1_graphic_string, sec_asn1_visible_string, sec_asn1_general_string, sec_asn1_universal_string, sec_asn1_bmp_string note that for sec_asn1_set and sec_asn1_sequence types, you must also include the method type macro sec_asn1_constructed to construct a fully valid tag, as defined by the asn.1 standard .
...you can also use the macros sec_asn1_set_of and sec_asn1_sequence_of which define both the tag number and this modifier (but still need the method type, this may be a bug).
Necko Interfaces Overview
channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be canceled via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg.
... http) maps uri string to nsiuri instance via newuri method creates nsichannel instance from nsiuri instance via newchannel method nsistreamlistener : nsirequestobserver implemented by the consumer of a nsichannel instance passed to nsichannel::asyncopen method nsirequestobserver::onstartrequest - notifies start of async download nsistreamlistener::ondataavailable - notifies presence of downloaded data nsirequestobserver::onstoprequest - notifies completion of async download, possibly w/ error nsiloadgroup : nsirequest attribute of a nsirequest channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when download completes load groups in gecko own all channels used to load a particular page (until the channels com...
...plete) all channels owned by a load group can be canceled at once via the load group's nsirequest::cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol handler implementations (as well as by mailnews and chatzilla) synchronous i/o methods: openinputstream, openoutputstream asynchronous i/o methods: asyncread, asyncwrite nsitransport::asyncread takes a nsistreamlistener parameter original document information author(s): darin fisher last updated date: december 10, 2001 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Rhino Examples
the checkparam.js script is a useful tool to check that @param tags in java documentation comments match the parameters in the corresponding java method.
...primitivewrapfactory primitivewrapfactory.java is an example of a wrapfactory that can be used to control the wrapping behavior of the rhino engine on calls to java methods.
...the foo class - extending scriptableobject foo.java is a simple javascript host object that includes a property with an associated action and a variable argument method.
Rhino scopes and contexts
to associate the current thread with a context, simply call the enter method of context: context cx = context.enter(); once you are done with execution, simply exit the context: context.exit(); these calls will work properly even if there is already a context associated with the current thread.
...however, initstandardobjects is an expensive method to call and it allocates a fair amount of memory.
...then all we need to do is create a new object and call its setprototypemethod to set the prototype to the shared object, and the parent of the new scope to null: scriptable newscope = cx.newobject(sharedscope); newscope.setprototype(sharedscope); newscope.setparentscope(null); the call to newobject simply creates a new javascript object with no properties.
Shumway
the simple method is to install the shumway extension (or run a browser version with shumway included and enabled) and browse to your flash content with adobe flash player set "ask to activate" or "never activate" in firefox's add-ons menu (this will be listed as "shockwave flash" under the plugins tab).
...several methods exist to allow inspector access to your swf file.
...there does not currently exist a private method to contribute source code.
Tracing JIT
therefore an assembler contains several machine-specific methods which are implemented in the accompanying nanojit/native*.* files.
...each define architecture-specific methods within the assembler class.
... the architecture-specific methods found in these files are the only functions within nanojit or tracemonkey that emit raw bytes of machine-code into memory.
JS::Handle
} methods here, ptr represents the private member of js::handle<t>, typed with t.
... method description const t *address() const returns a pointer to ptr.
... if you want to add additional methods to js::handle for a specific specialization, define a js::handlebase<t> specialization containing them.
JS::PersistentRooted
methods here, ptr represents the private member of js::persistentrooted<t>, typed with t.
... method description void init(jscontext* cx) initialize with optional initial value (if not provided, it will be initialized with the initial value of the type).
... before spidermonkey 38, persistentrooted<t> itself cannot be a global variable, but from spidermonkey38, it can be declared as a global variable, and initialized later with init() method (bug 1107639).
JS::Rooted
methods here, ptr represents the private member of js::rooted<t>, typed with t.
... method description t &get() returns ptr.
... if you want to add additional methods to rooted for a specific specialization, define a js::rootedbase<t> specialization containing them.
JSObjectOps.defaultValue
description the jsobjectops.defaultvalue callback corresponds to the [[defaultvalue]] method defined in ecma 262-3 §8.6.2.6.
...it calls the javascript methods obj.valueof() and/or obj.tostring().
...on success, *vp must be a primitive value: per es5 §8.12.8, every object "must ensure that its [[defaultvalue]] internal method can return only primitive values." debug builds of spidermonkey will assert if a convert callback is successful but leaves *vp holding a primitive value.
JSPropertySpec
tinyid int8 obsolete since jsapi 31 unique id number for the property to aid in resolving getproperty and setproperty method calls.
... getter jsnativewrapper or selfhostedwrapper getter method for the property.
... setter jsnativewrapper or selfhostedwrapper setter method for the property.
JS_NewObject
the new object will inherit all of the prototype object's properties and methods, and the new object's __proto__ property will be a reference to the prototype object.
...clasp is a pointer to an existing class to use for internal methods, such as finalize.
... starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), you can create a new object in a specific compartment using the components.utils.createobjectin() method.
JS_PreventExtensions
in javascript this may be accomplished using the object.preventextensions method.
... the similar jsapi method is js_preventextensions.
... var target = {}; var handler = { preventextensions: function(obj) { return false; } }; var obj = new proxy(target, handler); // bool succeeded; // bool rv = js_preventextensions(cx, obj, &succeeded); // // rv == true, succeeded == false note that as with most jsapi methods, *succeeded is only set if js_preventextensions returns true (that is, does not fail).
JS_ValueToObject
if v is a native javascript object, this calls the object's valueof method, if any.
...(implementation note: the object's jsobjectops.defaultvalue method is called with hint=jstype_object.) the resulting object is subject to garbage collection unless the variable *objp is protected by a local root scope, an object property, or the js_addroot function.
... note that a local root scope is not sufficient to protect the resulting object in some cases involving the valueof method!
SpiderMonkey 1.8.8
obsolete apis ...list obsolete methods/structs/apis here...
...removal of jscontext* parameters to many methods the js_getclass method now takes only a jsobject*, where previously it also required a jscontext* in threadsafe builds.
... (the js_get_class macro abstracting away this difference has accordingly been removed.) javascript shell changes detail added/removed methods here...
SpiderMonkey 17
obsolete apis ...list obsolete methods/structs/apis here...
...removal of jscontext* parameters to many methods the js_getclass method now takes only a jsobject*, where previously it also required a jscontext* in threadsafe builds.
...javascript shell changes detail added/removed methods here...
SpiderMonkey 24
many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types.
... obsolete apis ...list obsolete methods/structs/apis here...
... javascript shell changes detail added/removed methods here...
Embedded Dialog API
an example of this can be found in the mfc embedding testbed application, in the method cmfcembedapp::initializewindowcreator (lxr link accurate at revision 1.20 of that file; search for the method name in later revisions).
...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.
XPCOM hashtable guide
there are three key methods, get, put, and remove, which retrieve entries from the hashtable, write entries into the hashtable, and remove entries from the hashtable respectively.
... the hashtables that hold references to pointers (nsrefptrhashtable and nsinterfacehashtable) also have getweak methods that return non-addrefed pointers.
... all of these hashtable classes can be iterated over via the iterator class and cleared via the clear method.
Inheriting from implementation classes
ns_decl_isupports ns_decl_ia } a.cpp, as usual: ns_impl_isupports1(a, ia) ns_imethodimp a::funca() { ...
... ns_decl_isupports_inherited ns_forward_ia(a::) // need to disambiguate ns_decl_ib } b.cpp: ns_impl_isupports_inherited1(b, a, ib) // this, superclass,added ifaces ns_imethodimp b::funcb() { ...
... ns_decl_isupports_inherited ns_forward_ia(b::) ns_forward_ib(b::) ns_decl_ic } c.cpp: ns_impl_isupports_inherited1(c, b, ic) ns_imethodimp c::funcc() { ...
Monitoring HTTP activity
this is very simple, requiring you to implement a single method, nsihttpactivityobserver.observeactivity(), which gets called each time an action of interest takes place on the http channel.
...this is done using the nsihttpactivitydistributor.addobserver() method in nsihttpactivitydistributor: var activitydistributor = components.classes["@mozilla.org/network/http-activity-distributor;1"] .getservice(components.interfaces.nsihttpactivitydistributor); activitydistributor.addobserver(httpobserver); observable activities there are two classes of observable activities: those that occur at the socket level and those that oc...
...observable socket activities when the activity type reported to your nsihttpactivityobserver.observeactivity() method is activity_type_socket_transport, the activity subtype, which indicates the specific type of activity that occurred, will be a socket transport status code.
Observer Notifications
this lets extensions inject api into chrome windows as needed (see nsidomglobalpropertyinitializer for an alternative method of doing this, which uses significantly less memory).
...this lets extensions inject api into content windows as needed (see nsidomglobalpropertyinitializer for an alternative method of doing this).
...if you are referencing instances of mozistoragestatement referencing places databases when this notification occurs, you should call their mozistoragestatement.finalize() method places-sync-finished sent when the places database has been successfully flushed to disk.
nsACString
methods beginreading the beginreading function returns a const pointer to the first element of the string's internal buffer.
...thus, the length of the data contained in the nsacstring should be determined by calling the nsacstring::length() method.
... the methods defined on nsacstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_cstring.
nsACString_internal
ef="http://developer.mozilla.org/en/ns_lossyconvertutf16toascii" shape="rect" title="ns_lossyconvertutf16toascii"> <area alt="" coords="251,389,435,437" href="http://developer.mozilla.org/en/ns_convertutf16toutf8" shape="rect" title="ns_convertutf16toutf8"> <area alt="" coords="309,293,445,341" href="http://developer.mozilla.org/en/nsadoptingcstring" shape="rect" title="nsadoptingcstring"> </map> method overview constructors beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ...
... methods constructors void nsacstring_internal(const nscsubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsAString
methods beginreading the beginreading function returns a const pointer to the first element of the string's internal buffer.
...thus, the length of the data contained in the nsastring should be determined by calling the nsastring::length method.
... the methods defined on nsastring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_string.
nsAString_internal
,192,437" href="http://developer.mozilla.org/en/ns_convertasciitoutf16" shape="rect" title="ns_convertasciitoutf16"> <area alt="" coords="216,389,400,437" href="http://developer.mozilla.org/en/ns_convertutf8toutf16" shape="rect" title="ns_convertutf8toutf16"> <area alt="" coords="277,293,405,341" href="http://developer.mozilla.org/en/nsadoptingstring" shape="rect" title="nsadoptingstring"> </map> method overview constructors beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ...
... methods constructors void nsastring_internal(const nssubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsAutoRef
nsautoref has a role similar to nsautoptr and nsrefptr but does not require that the handle is a pointer to an object that was created with new or has addref() and release() methods.
...no copy constructor nor copy assignment operators are available, so the handle to the resource will be held until released on destruction of the nsautoref or until explicitly reset() or transferred through provided methods.
... in order to use nsautoref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the method for releasing the resource must be provided for class t.
nsCountedRef
nscountedref has a role similar to nsrefptr but does not require that the handle is a pointer to an object that has addref() and release() methods.
...nscountedref<t> is derived from nsautoref<t> and so inherits its methods.
...in order to use nscountedref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the methods for referencing and releasing the resource must be provided for class t.
nsDependentCSubstring
names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const c...
... methods constructors void nsdependentcsubstring(const nsacstring_internal&, pruint32, pruint32) - source parameters nsacstring_internal& str pruint32 startpos pruint32 length void nsdependentcsubstring(const char*, const char*) - source parameters char* start char* end void nsdependentcsubstring(const nsreadingiterator<char>&, const nsreadingiterator<char>&) - source parameters nsreadingiterator<char>& start nsrea...
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentSubstring
names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const c...
... methods constructors void nsdependentsubstring(const nsastring_internal&, pruint32, pruint32) - source parameters nsastring_internal& str pruint32 startpos pruint32 length void nsdependentsubstring(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end void nsdependentsubstring(const nsreadingiterator<short unsigned int>&, const nsreadingiterator<short unsigned int>&) - source parame...
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsMemory
}; methods alloc the alloc function allocates a block of memory of a particular size.
... remarks to use the methods in this class, you must link your component or application against the xpcom glue library.
... the static methods defined on this class are not frozen.
amIInstallTrigger
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 enabled(); boolean install(in nsivariant aargs, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility.
... constant value description skin 1 locale 2 content 4 package 7 methods enabled() tests if installation is enabled.
...this method is deprecated, please use install() in the future.
imgILoader
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/image/loader;1 as a service: var imgiloader = components.classes["@mozilla.org/image/loader;1"] .getservice(components.interfaces.imgiloader); method overview imgirequest loadimage(in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy); imgirequest loadimagewithchannel(in nsichannel achannel, in imgidecoder...
...observer aobserver, in nsisupports cx, out nsistreamlistener alistener); boolean supportimagewithmimetype(in string mimetype); constants constant value description load_cors_anonymous 1 << 16 load_cors_use_credentials 1 << 17 methods loadimage() start the load and decode of an image.
...this must already be opened before this method is called, and there must have been no ondataavailable calls for it yet.
jsdIStackFrame
once a jsdistackframe has been invalidated all method and property accesses will throw a ns_error_not_available exception.
... method overview boolean eval(in astring bytes, in autf8string filename, in unsigned long line, out jsdivalue result); attributes attribute type description callee jsdivalue function object running in this stack frame.
... methods eval() evaluate arbitrary javascript in this stack frame.
mozIAsyncHistory
1.0 66 introduced gecko 24.0 inherits from: nsisupports last changed in gecko 24.0 (firefox 24.0 / thunderbird 24.0 / seamonkey 2.21) implemented by: @mozilla.org/browser/history;1 as a service: var asynchistory = components.classes["@mozilla.org/browser/history;1"] .getservice(components.interfaces.moziasynchistory); method overview void getplacesinfo(in jsval aplaceidentifiers, in mozivisitinfocallback acallback); void isurivisited(in nsiuri auri, in mozivisitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [optional] in mozivisitinfocallback acallback); methods getplacesinfo() starts an asynchronous request to determine whether or not a given uri has been visited;...
... acallback an object implementing the mozivisitedstatuscallback.isvisited() method.
... acallback an object implementing the mozivisitedstatuscallback.isvisited() method; this method will be called with the results once the request has been completed.
mozIPersonalDictionary
to access this service, use var personaldictionary = components.classes["@mozilla.org/spellchecker/personaldictionary;1"] .getservice(components.interfaces.mozipersonaldictionary); method overview void addcorrection(in wstring word,in wstring correction, in wstring lang); void addword(in wstring word, in wstring lang); boolean check(in wstring word, in wstring lang); void endsession(); void getcorrection(in wstring word, [array, size_is(count)] out wstring words, out pruint32 count); void ignoreword(in wstring word); void load(); void removecorrection(in wstring w...
... methods addcorrection() adds a misspelling to the list of corrections.
... note that this method is not currently implemented.
mozIPlacesAutoComplete
toolkit/components/places/public/moziplacesautocomplete.idlscriptable this interface provides some constants used by the places autocomplete search provider as well as methods to track opened pages for autocomplete purposes.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value description match_anywhere 0 match anywhere in each searchable term.
... methods registeropenpage() mark a page as being currently open.
mozIStoragePendingStatement
the mozistoragependingstatement interface represents a pending asynchronous database statement, and offers the cancel() method which allows you to cancel the pending statement.
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void cancel(); methods cancel() cancels the pending statement.
...starting with gecko 1.9.2, this information is no longer provided and the method doesn't return a value.
mozIStorageStatementCallback
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void handlecompletion(in unsigned short areason); void handleerror(in mozistorageerror aerror); void handleresult(in mozistorageresultset aresultset); constants constant value description reason_finished 0 the statement has finished executing normally.
... methods handlecompletion() called when a statement finishes executing.
...generally, this method will be called several times, each time providing one or more results.
mozIStorageValueArray
the mozistoragevaluearray interface obtains provides methods to obtain data from a given result.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview long gettypeofindex(in unsigned long aindex); long getint32(in unsigned long aindex); long long getint64(in unsigned long aindex); double getdouble(in unsigned long aindex); autf8string getutf8string(in unsigned long aindex); astring getstring(in unsigned long aindex); void getblob(in unsigned long aindex, out unsigned long adatasize, [array,size_is(adatasize)] out octet adata); boolean getisnull(in unsigned long aindex); ...
... methods gettypeofindex() returns the type of the value at the given column index.
mozIVisitInfoCallback
toolkit/components/places/public/moziasynchistory.idlscriptable this interface provides callback handling functionality for moziasynchistory.updateplaces() 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview void handleerror(in nsresult aresultcode, in moziplaceinfo aplaceinfo); void handleresult(in moziplaceinfo aplaceinfo); void oncomplete(in nsresult aresultcode, in moziplaceinfo aplaceinfo);obsolete since gecko 8.0 methods handleerror() called when a moziplaceinfo couldn't be processed.
... if more than one operation is done for a given visit, this method is only called once (for all changes at once).
... notes this method was replaced by the separate handleresult() and handleerror() methods in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5).
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!
... methods getaccessibleinparentchain() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) returns the first accessible parent of a dom node.
... acancreate if true, this method can create a new accessible.
nsIAccessibleEditableText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void copytext(in long startpos, in long endpos); void cuttext(in long startpos, in long endpos); void deletetext(in long startpos, in long endpos); void inserttext(in astring text, in long position); void pastetext(in long position); void setattributes(in long startpos, in long endpos, in nsisupports attributes); unimplemented ...
... methods copytext() copies the text range into the clipboard.
...the method is not implemented.
nsIAccessibleHyperLink
accessible/public/nsiaccessiblehyperlink.idlscriptable a cross-platform interface that supports hyperlink-specific properties and methods.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink.
... methods returns a reference to the object at the given index.
nsIAccessibleImage
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible.
... this method is the same as nsiaccessible.getbounds() excepting coordinate origin parameter.
...this method is the same as nsiaccessible.getbounds().
nsIAccessibleRelation
method overview nsiaccessible gettarget(in unsigned long index); nsiarray gettargets(); attributes attribute type description relationtype unsigned long returns the type of the relation.
...this relation is very useful for finding the content quickly, and is the proper method for finding content in gecko 1.9 and beyond.
... methods gettarget() returns accessible relation target at the given index.
nsIAccessibleRetrieval
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(...
...bsolete 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.
...this method doesn't create accessible object for returned node.
nsIAnnotationObserver
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void onitemannotationremoved(in long long aitemid, in autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotationremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item.
... onitemannotationset() this method is called when an annotation value is set for an item.
... onpageannotationset() this method is called when an annotation value is set for a uri.
nsIApplicationCache
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) each application cache has a unique client id for use with nsicacheservice.opensession() method, to access the cache's entries.
...method overview void activate(); void addnamespaces(in nsiarray namespaces); void discard(); void gatherentries(in pruint32 typebits, out unsigned long count, [array, size_is(count)] out string keys); nsiapplicationcachenamespace getmatchingnamespace(in acstring key); unsigned long gettypes(in acstring key); void initashandle(in acstring groupid, in acstring clientid); void markentry(in acstring key, in unsigned long typebits); void unmarkentry(in acstring key, in unsigned long ...
... methods activate() makes this cache the active application cache for this group.
nsIApplicationCacheService
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void cacheopportunistically(in nsiapplicationcache cache, in acstring key); nsiapplicationcache chooseapplicationcache(in acstring key); nsiapplicationcache createapplicationcache(in acstring group); void deactivategroup(in acstring group); nsiapplicationcache getactivecache(in acstring group); nsiapplicationcache getapplicationcache(in acstring clientid); void getgroups([optional] out unsigned long count, [array, size_is(count), re...
...tval] out string groupids); methods cacheopportunistically() flags the specified key as one that should be cached opportunistically.
... note: this method should propagate the entry to other application caches with the same opportunistic namespace; however, this is not currently implemented.
nsIArray
method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array.
... methods enumerate() enumerate the array.
...null is a valid result for this method, but exceptions are thrown in other circumstances.
nsIAutoCompleteListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onautocomplete(in nsiautocompleteresults result, in autocompletestatus status); void onstatus(in wstring statustext); attributes attribute type description param nsisupports private parameter used by the autocomplete widget.
... methods onautocomplete() called by the autocomplete session when the search is done or over.
...this method does not seem to have ever been implemented.
nsIBidiKeyboard
a user is a bidirectional writer if they have keyboard layouts in both left-to-right and right-to-left directions (that is users who use arabic, iranian (persian), or israel (hebrew) keyboard layout, beside an us (english) layout.) inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview boolean islangrtl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type description havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed.
... methods islangrtl() determines if the current keyboard language is right-to-left.
... (supported on: win32, mac, gtk2) note: prior to gecko 1.9 this method used a parameter 'out prbool aisrtl' to return the value.
nsIBinaryInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method overview pruint8 read8(); pruint16 read16(); pruint32 read32(); pruint64 read64(); unsigned long readarraybuffer(in pruint32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pruint32 alength, [array, size_is(alength), retval] out pruint8 abytes); void readbytes(in pruint32 alength, [size_is(alengt...
...h), retval] out string astring); acstring readcstring(); double readdouble(); float readfloat(); astring readstring(); void setinputstream(in nsiinputstream ainputstream); methods read8() reads from the stream.
... warning: this method is available from javascript; however javascript does not support 64-bit integers.
nsIClipboardDragDropHookList
method overview void addclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); nsisimpleenumerator gethookenumerator(); void removeclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); methods addclipboarddragdrophooks() this method adds a hook to the list.
... gethookenumerator() this method retrieves an enumerator for all hooks which have been added.
...removeclipboarddragdrophooks() this method removes a hook from the list.
nsIContentPrefService
to create an instance, use: var contentprefservice = components.classes["@mozilla.org/content-pref/service;1"] .getservice(components.interfaces.nsicontentprefservice); method overview void addobserver(in astring aname, in nsicontentprefobserver aobserver); nsivariant getpref(in nsivariant agroup, in astring aname, [optional] in nsicontentprefcallback acallback); nsipropertybag2 getprefs(in nsivariant agroup); nsipropertybag2 getprefsbyname(in astring aname); boolean haspref(in nsivariant agroup, in astring aname); ...
...useful for accessing and manipulating preferences in ways that are caller-specific or for which there is not yet a generic method, although generic functionality useful to multiple callers should generally be added to this unfrozen interface.
... methods addobserver() adds an observer that monitors a preference for changes.
nsIConverterOutputStream
to create an instance, use: var converteroutputstream = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); method overview void init(in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter); methods init() initialize this stream.
... must be called before any other method on this interface, or you will crash.
... the output stream passed to this method must not be null, or you will crash.
nsICrashReporter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only!
... methods annotatecrashreport() add some extra data to be submitted with a crash report.
...unlike annotatecrashreport(), this method will append to existing data.
nsIDBChangeListener
there are a couple of ways to access the message database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onhdradded(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbcha...
...uncer instigator); void onreadchanged(in nsidbchangelistener ainstigator); void onjunkscorechanged(in nsidbchangelistener ainstigator); void onhdrpropertychanged(in nsimsgdbhdr ahdrtochange, in unsigned long aoldflags, in prbool aprechange, inout pruint32 astatus, in nsidbchangelistener ainstigator); void onevent(in nsimsgdatabase adb, in string aevent); methods onhdrflagschanged() called when a message's flags change.
...others use the onhdrflagschanged() method.
nsIDNSRecord
inherits from: nsisupports last changed in gecko 1.7 method overview prnetaddr getnextaddr(in pruint16 aport); native code only!
... methods native code only!getnextaddr this function copies the value of the next ip address into the given prnetaddr struct and increments the internal address iterator.
...hasmore() this method checks if there is another address in the record.
nsIDOMHTMLTimeRanges
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.
... 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.
... methods end() returns the time offset to the end of the specified time range.
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.
... methods handle() this method is a callback which will be called if a node with user data is being cloned, imported or adopted.
nsIDOMWindowInternal
method overview firefox 3.5 note the prompt() and find() methods changed in firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required.
... void forward() void home() void stop() void print() void moveto(in long xpos, in long ypos) void moveby(in long xdif, in long ydif) void resizeto(in long width, in long height) void resizeby(in long widthdif, in long heightdif) void scroll(in long xscroll, in long yscroll) nsidomwindow window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name.
... url nsidommozurlproperty readonly: a dom url object, which provides the window.url.createobjecturl() and window.url.revokeobjecturl() methods.
nsIDOMXULElement
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.
... methods blur() attempts to remove focus from the element.
...click() unless the element is disabled, sends mouse events that simulate the effect of clicking the mouse on the element, then calls the docommand() method.
nsIDeviceMotion
method overview void addlistener(in nsidevicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only!
... methods addlistener() when called, the accelerometer support implementation must begin to notify the specified nsidevicemotionlistener by calling its nsidevicemotionlistener.onaccelerationchange() method as appropriate to share updated acceleration data.
... void addlistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object whose nsidevicemotionlistener.onaccelerationchange() method should be called with updated acceleration data.
nsIDialogParamBlock
inherits from: nsisupports last changed in gecko 1.7 method overview print32 getint( in print32 inindex ); wstring getstring( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 inindex, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports.
... methods getint() get a previously set integer.
...this method can only be called once.
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.
... method overview void enddragsession( in prbool adonedrag ) ; void dragmoved(in long ax, in long ay); native code only!
... methods native code only!dragmoved programmatically changes the drag position of the drag session.
nsIEventListenerInfo
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events.
... methods getdebugobject() returns the debugger object if the debug service is active.
...this is the method you should use if you want to get access to the actual listener, but the debugger service must be already active, which significantly slows down script execution.
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 ha...
... obsolete since gecko 7.0 methods geteventtargetchainfor() returns an array of event targets indicating all the targets that will receive the same events that are delivered to the specified target.
...note: some events, especially 'load', may actually have a shorter event target chain than what this methods returns.
nsIExternalProtocolService
method overview boolean externalprotocolhandlerexists(in string aprotocolscheme); astring getapplicationdescription(in autf8string ascheme); nsihandlerinfo getprotocolhandlerinfo(in acstring aprotocolscheme); nsihandlerinfo getprotocolhandlerinfofromos(in acstring aprotocolscheme, out boolean afound); boolean isexposedprotocol(in string aprotocolscheme); void loaduri(in nsiuri auri, [opt...
...ional] in nsiinterfacerequestor awindowcontext); void loadurl(in nsiuri aurl); void setprotocolhandlerdefaults(in nsihandlerinfo ahandlerinfo, in boolean aoshandlerexists); methods externalprotocolhandlerexists() check whether a handler for a specific protocol exists.
...if neither the application nor the os knows about a handler for the protocol, the object this method returns will represent a default handler for unknown content.
nsIFeedProgressListener
1.0 66 introduced gecko 1.8 inherits from: nsifeedresultlistener last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleentry(in nsifeedentry entry, in nsifeedresult result); void handlefeedatfirstentry(in nsifeedresult result); void handlestartfeed(in nsifeedresult result); void reporterror(in astring errortext, in long linenumber, in boolean bozo); methods handleentry() called after each entry or item is processed.
... if the document is a standalone item or entry, the handlefeedatfirstentry() method will not already have been called, and the received nsifeedentry will have a null parent value.
...in other words, by the time this method is called, it is most likely that most or all of the feed-level metadata has been processed and is available in the received nsifeedresult object.
nsIFeedResult
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 registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing.
...this value will be one of the following: atom, rss2, rss09, rss091, rss091userland, rss092, rss1, atom03, atomentry, rssitem methods registerextensionprefix() registers a prefix for a namespace used to access an extension in the feed or entry.
... warning: this method is not implemented at this time.
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.
...if the type attribute is "text", this method returns the value of the text attribute unchanged.
nsIFileProtocolHandler
netwerk/protocol/file/nsifileprotocolhandler.idlscriptable this interface provides methods to convert between nsifile and nsiuri.
... inherits from: nsiprotocolhandler last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsifile getfilefromurlspec(in autf8string url); autf8string geturlspecfromactualfile(in nsifile file); autf8string geturlspecfromdir(in nsifile file); autf8string geturlspecfromfile(in nsifile file); nsiuri newfileuri(in nsifile afile); nsiuri readurlfile(in nsifile file); methods getfilefromurlspec() converts the url string into the corresponding nsifile if possible.
...newfileuri() this method constructs a new file uri.
nsIFileView
to create an instance, use: var fileview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); method overview void setdirectory(in nsifile directory); void setfilter(in astring filterstring); void sort(in short sorttype, in boolean reversesort); attributes attribute type description reversesort boolean if true results will be sorted in ascending order.
... methods setdirectory() set the directory to be browsed.
... sort() set the method used for sorting.
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 at...
... constants constant value description eleft 0 ecenter 1 eright 2 ejustify 3 methods adddefaultproperty() registers a default style property with the editor.
...do not use this method!
nsIJSCID
js/src/xpconnect/idl/xpcjsid.idlscriptable this interface provides methods to instantiate a component and access service components.
... inherits from: nsijsid last changed in gecko 1.7 method overview nsisupports createinstance(); nsisupports getservice(); methods createinstance() nsisupports createinstance(); parameters none.
... return value see also see components.classes for usage patterns of the createinstance() and getservice() methods.
nsILocalFileMac
inherits from: nsilocalfile last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview cfurlref getcfurl(); native code only!
...obsolete since gecko 2.0 methods native code only!getcfurl note: observes the state of the followlinks attribute.
...init this object with an fsspec legacy method - leaving in place for now.
nsILoginInfo
to create an instance, use: var logininfo = components.classes["@mozilla.org/login-manager/logininfo;1"] .createinstance(components.interfaces.nsilogininfo); method overview nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attri...
... methods clone() returns a clone of this login.
... return value an nsilogininfo containing a clone of the login on which this method was invoked.
nsIMIMEInputStream
to create an instance, use: var mimeinputstream = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); method overview void addheader(in string name, in string value); void setdata(in nsiinputstream stream); attributes attribute type description addcontentlength boolean when true a "content-length" header is automatically added to the stream.
... the value of the content-length is automatically calculated using the available() method on the data stream.
... methods addheader() adds an additional header to the stream on the form "name: value".
nsIMemory
method overview voidptr alloc(in size_t size); violates the xpcom interface guidelines void free(in voidptr ptr); violates the xpcom interface guidelines void heapminimize(in boolean immediate); boolean islowmemory(); deprecated since gecko 2.0 voidptr realloc(in voidptr ptr, in size_t newsize); violates the xpcom interface guidelines methods alloc allocates a block of memory of a particular size.
...a particular nsimemory instance may choose not to implement this method.
... note: this method was deprecated in gecko 2.0.
nsIMemoryReporterManager
xpcom/base/nsimemoryreporter.idlscriptable a service that provides methods for managing nsimemoryreporter objects.
...method overview nsisimpleenumerator enumeratemultireporters(); nsisimpleenumerator enumeratereporters(); void init(); void registermultireporter(in nsimemorymultireporter reporter); void registerreporter(in nsimemoryreporter reporter); void unregistermultireporter(in nsimemorymultireporter reporter); ...
... methods enumeratemultireporters() returns an enumerator for looking at the installed memory multi-reporters.
nsIMessageListenerManager
to access this service, use: var globalmm = components.classes["@mozilla.org/globalmessagemanager;1"] .getservice(components.interfaces.nsimessagelistenermanager); method overview void addmessagelistener(in astring messagename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed) void removemessagelistener(in astring messagename, in nsimessagelistener listener); void addweakmessagelistener(in astring messagename, ...
... in nsimessagelistener listener); void removeweakmessagelistener(in astring messagename, in nsimessagelistener listener); methods addmessagelistener() register listener to receive messagename.
...an alternative method to listen for death of frame script is to use a message-manager-disconnect observer; see observer notifications :: message manager.
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.
... methods calculateupdateinterval() calculates the interval until the microsummary should be updated for the next time, depending on the page content.
...if a generator doesn't need content, pass null as the parameter to this method.
nsIMsgCustomColumnHandler
the interface inherits from nsitreeview, however when you're implementing a custom handler in javascript its not necessary to implement all of nsitreeview's methods.
...arow, acol) { }, getsortstringforrow: function(ahdr) { return ""; }, isstring: function() {return true;}, getcellproperties: function(arow, acol, aprops) { }, getrowproperties: function(arow, aprops) { }, getimagesrc: function(arow, acol) {return null;}, getsortlongforrow: function(ahdr) {return 0;} } to attach it use the nsimsgdbview.addcolumnhandler() method (recall gdbview is the global nsimsgdbview in thunderbird): gdbview.addcolumnhandler("newcolumn", columnhandler); after which it can be retrieved using the nsimsgdbview.getcolumnhandler() method: var handler = gdbview.getcolumnhandler("newcolumn"); and removed using the nsimsgdbview.removecolumnhandler() method: gdbview.removecolumnhandler("newcolumn"); method overview astring getsortstr...
...ingforrow(in nsimsgdbhdr ahdr); unsigned long getsortlongforrow(in nsimsgdbhdr ahdr); boolean isstring(); methods getsortstringforrow() if the column displays a string, this will return the string that the column should be sorted by.
nsIMsgDBView
method overview void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); void close(); ...
... methods open() opens a folder in the database.
...this method will automatically expand the destination thread.
nsIMsgDatabase
last changed in gecko 1.9 (firefox 3) inherits from: nsidbchangeannouncer method overview void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); void forcefolderdbclosed(in nsimsgfolder afolder); void close(in boolean aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key)...
... defaultviewflags nsmsgviewflagstypevalue readonly: defaultsorttype nsmsgviewsorttypevalue readonly: defaultsortorder nsmsgviewsortordervalue readonly: msghdrcachesize unsigned long folderstream nsioutputstream summaryvalid boolean methods open() opens a database folder.
... boolean ismdnneeded(in nsmsgkey key); markmdnsent() void markmdnsent(in nsmsgkey key, in boolean bneeded, in nsidbchangelistener instigator); ismdnsent() boolean ismdnsent(in nsmsgkey key); markread() methods to get and set docsets for ids.
nsIMsgSearchSession
searchsession.addscopeterm(components.interfaces.nsmsgsearchscope.offlinemail, afolder); var searchterm = searchsession.createterm(); var value = searchterm.value; value.str = avalue; searchterm.value = value; searchterm.op = searchsession.booleanor; searchterm.booleanand = false; searchsession.appendterm(searchterm); searchsession.search(null); inherits from: nsisupports method overview void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void registerlistener(in nsimsgsearchnotify listener); void unregisterlistener(in nsimsgsearchnotify listener); ...
... long readonly: runningadapter nsimsgsearchadapter readonly: searchparam voidptr not scriptable and readonly: searchtype nsmsgsearchtype readonly: numresults long readonly: window nsimsgwindow constants name value description booleanor 0 booleanand 1 methods addsearchterm() void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); parameters attrib attribute for this term.
... void addallscopes(in nsmsgsearchscopevalue attrib); parameters attrib search() void search(in nsimsgwindow awindow); parameters awindow interruptsearch() void interruptsearch(); pausesearch() these two methods are used when the search session is using a timer to do local search, and the search adapter needs to run a url (e.g., to reparse a local folder) and wants to pause the timer while running the url.
nsINavHistoryResult
viewers register themselves through the registerviewer() method.
...method overview void addobserver(in nsinavhistoryresultobserver aobserver, in boolean aownsweak); void removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type description root nsinavhistorycontainerresultnode the root of the results.
...obsolete since gecko 2.0 methods addobserver() adds an observer for changes that occur on the result.
nsIPluginHost
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsifile createtempfiletopost(in string apostdataurl); native code only!
... methods native code only!createtempfiletopost to create temp file with content len header in, it will use by http post.
... void newpluginnativewindow( out nspluginnativewindowptr apluginnativewindow ); parameters apluginnativewindow native code only!parsepostbuffertofixheaders this method parses post buffer to find out case insensitive "content-length" string and cr or lf some where after that, then it assumes there is http headers in the input buffer and continue to search for end of headers (crlfcrlf or lflf).
nsIProfileLock
toolkit/profile/public/nsitoolkitprofile.idlscriptable an object returned by the nsitoolkitprofile.lock method; as long as you hold a reference to the object, the profile remains locked.
... inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(); attributes attribute type description directory nsilocalfile the main profile directory.
... methods unlock() unlocks the profile.
nsIProfileUnlocker
profile/public/nsiprofileunlocker.idlscriptable returned by the nsitoolkitprofile.lock method; you can use this to attempt to force a profile to be unlocked.
... 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 unlock(in unsigned long aseverity); constants constant value description attempt_quit 0 politely ask the process currently holding the profile's lock to quit.
... methods unlock() tries to unlock the profile by attempting or forcing the process that currently holds the lock to quit.
nsIProgressEventSink
the channel will begin passing notifications to the progress event sink after its asyncopen method has been called.
... notifications will cease once the channel calls its listener's onstoprequest method or once the channel is canceled (via nsirequest.cancel()).
...method overview void onprogress(in nsirequest arequest, in nsisupports acontext, in unsigned long long aprogress, in unsigned long long aprogressmax); void onstatus(in nsirequest arequest, in nsisupports acontext, in nsresult astatus, in wstring astatusarg); methods onprogress() called to notify the event sink that progress has occurred for the given request.
nsIPrompt
to avoid redundancy, all methods here link to nsipromptservice.
... if you are using this interface, you must remove the nsidomwindow arguments from those methods.
...method overview void alert(in wstring dialogtitle, in wstring text); void alertcheck(in wstring dialogtitle, in wstring text, in wstring checkmsg, inout boolean checkvalue); boolean confirm(in wstring dialogtitle, in wstring text); boolean confirmcheck(in wstring dialogtitle, in wstring text, in wstring checkmsg, inout boolean checkvalue); print32 confirmex(in wstring dialogtitle, in wstring text, in unsigned long buttonflags, in wstring button0title, in wstring button1title, in wstring button2titl...
nsIProxyInfo
note: prior to gecko 1.8 host was available by the host method.
... note: prior to gecko 1.8 port was available by the port method.
... note: prior to gecko 1.8 type was available by the type method.
nsIPushSubscription
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.
... methods getkey() returns a byte array containing the key material for this subscription.
...please see method parameters in xpidl for more details on using out parameters in javascript.
nsISHistory
to create an instance, use: var shistory = components.classes["@mozilla.org/browser/shistory;1"] .createinstance(components.interfaces.nsishistory); method overview void addshistorylistener(in nsishistorylistener alistener); nsishentry getentryatindex(in long index, in boolean modifyindex); void purgehistory(in long numentries); void reloadcurrententry(); void removeshistorylistener(in nsishistorylistener alistener); attributes attribute type description count long the...
...the enumerator object thus returned by this method can be traversed using nsisimpleenumerator.
... methods addshistorylistener() called to register a listener for the session history component.
nsISHistoryListener
the listener can prevent any action (except adding a new session history entry) from happening by returning false from the corresponding callback method.
... a session history listener can be registered on a particular nsishistory instance via the nsishistory.addshistorylistener() method.
... method overview boolean onhistorygoback(in nsiuri abackuri); boolean onhistorygoforward(in nsiuri aforwarduri); boolean onhistorygotoindex(in long aindex, in nsiuri agotouri); void onhistorynewentry(in nsiuri anewuri); boolean onhistorypurge(in long anumentries); boolean onhistoryreload(in nsiuri areloaduri, in unsigned long areloadflags); methods onhistorygoback() called when navigating to a previous session history entry, for example due to an nsiwebnavigation.goback() call.
nsIScreen
implemented by: @mozilla.org/gfx/screenmanager;1 as a service: var screen = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreen); method overview void getavailrect(out long left, out long top, out long width, out long height); void getrect(out long left, out long top, out long width, out long height); void lockminimumbrightness(in unsigned long brightness); void unlockminimumbrightness(in unsigned long brightness); attributes attribute type description colordepth ...
... methods getavailrect() returns a rectangle indicating the portion of the screen that is available for use.
...each call to this method must eventually be followed by a corresponding call to unlockminimumbrightness() with the same value for the brightness parameter.
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.
...you should call nsiparserutils::parsefragment() instead of calling this method.
...you should call nsiparserutils::converttoplaintext() instead of calling this method.
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 rangearr...
... methods getrangesforinterval() return array of ranges intersecting with the given dom interval.
...if false, posts a request which is processed at some point after the method returns.
nsIServerSocketListener
the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address.
... inherits from: nsisupports last changed in gecko 1.7 method overview void onsocketaccepted(in nsiserversocket aserv, in nsisockettransport atransport); void onstoplistening(in nsiserversocket aserv, in nsresult astatus); methods onsocketaccepted() this method is called when a client connection is accepted.
... onstoplistening() this method is called when the listening socket stops for some reason.
nsISocketTransportService
to create an instance, use: var sockettransportservice = components.classes["@mozilla.org/network/socket-transport-service;1"] .getservice(components.interfaces.nsisockettransportservice); method overview void attachsocket(in prfiledescptr afd, in nsasockethandlerptr ahandler); native code only!
...obsolete since gecko 1.8 methods native code only!
...in this case, the notifywhencanattachsocket() method should be used.
nsIStringEnumerator
inherits from: nsisupports last changed in gecko 1.7 method overview astring getnext(); boolean hasmore(); methods getnext() called to retrieve the next string in the enumerator.
...this method is generally called within a loop to iterate over the strings in the enumerator.
...this method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getnext() calls.
nsISupports
last changed in gecko 1.0 method overview nsrefcnt addref();violates the xpcom interface guidelines void queryinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); nsrefcnt release();violates the xpcom interface guidelines methods violates the xpcom interface guidelines addref() notifies the object that an interface pointer has been duplicated.
...queryinterface() the queryinterface method provides runtime type discovery.
...remarks the method descriptions above were taken from essential com by don box.
nsITaskbarPreview
method overview void invalidate(); attributes attribute type description active boolean indicates whether or not the preview is marked as active (currently selected) in the taskbar.
... note: neither nsitaskbartabpreview or nsitaskbarwindowpreview makes full use of the controller; see the documentation for each interface for details on which controller methods are used.
... methods invalidate() invalidates the taskbar's cached image of the preview, forcing a redraw if necessary.
nsITelemetry
1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedh...
... void keyedscalarset(in acstring aname, in astring akey, in jsval avalue); void keyedscalarsetmaximum(in acstring aname, in astring akey, in jsval avalue); jsval snapshotkeyedscalars(in uint32_t adataset, [optional] in boolean aclear); void clearscalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in acstring amethod, in acstring aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in uint32_t adataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); ...
... methods gethistogrambyid() get an histogram by id for histograms registered in histograms.json.
nsIToolkitProfileService
method overview nsitoolkitprofile createprofile(in nsilocalfile arootdir, in autf8string aname); void flush(); nsitoolkitprofile getprofilebyname(in autf8string aname); nsiprofilelock lockprofilepath(in nsilocalfile adirectory, in nsilocalfile atempdirectory); attributes attribute type description profilecount unsigned long the numb...
... profiles nsisimpleenumerator an enumerator providing access to the list of profiles; each profile is an nsitoolkitprofile object (though you must first call aprofile.queryinterface(components.interfaces.nsitoolkitprofile) to get access to its attributes and methods).
... startoffline boolean startwithlastprofile boolean methods createprofile() creates a new profile.
nsITransport
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) this interface provides methods to open blocking or non-blocking, buffered or unbuffered streams to the resource.
...method overview void close(in nsresult areason); nsiinputstream openinputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags...
... constant value description status_reading 0x804b0008 status_writing 0x804b0009 methods close() close the transport and any open streams.
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.
... methods getcolumnat() get the column for a given index.
...invalidatecolumns() this method is called whenever a treecol is added or removed and the column cache needs to be rebuilt.
nsIURLParser
inherits from: nsisupports last changed in gecko 1.7 method overview void parseauthority(in string authority, in long authoritylen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen, out unsigned long hostnamepos, out long hostnamelen, out long port); void parsefilename(in string filename, in long filenamelen, out unsigned long basenamepos, out long basenamelen, out unsigned long extensionpos, out long extensionlen); void parsefilepath(in string filepath, in long filepathlen, out unsigned long directorypos, out long directorylen, out unsigned long basenamepos, out long basenamelen...
...hostnamelen, out long port); void parseurl(in string spec, in long speclen, out unsigned long schemepos, out long schemelen, out unsigned long authoritypos, out long authoritylen, out unsigned long pathpos, out long pathlen); void parseuserinfo(in string userinfo, in long userinfolen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen); methods the string to parse in the methods may be given as a null terminated string, in which case the length argument should be -1.
... out parameters of the methods are all optional (that is the caller may pass-in a null value if the corresponding results are not needed).
nsIUpdateTimerManager
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 registertimer(in astring id, in nsitimercallback callback, in unsigned long interval); methods registertimer() presents a user interface that checks for and displays the available updates.
... in order to avoid having to instantiate a component to call the registertimer() method, the component can instead register an update-timer category with comma-separated values as a single string representing the timer, like this: _xpcom_categories: [{ category: "update-timer", value: "contractid," + "method," + "id," + "preference," + "inter...
... method the method used to instantiate the interface; this should be either getservice or createinstance, depending on your component.
nsIUploadChannel
inherits from: nsisupports last changed in gecko 1.7 method overview void setuploadstream(in nsiinputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type description uploadstream nsiinputstream get the stream (to be) uploaded by this channel.
... methods setuploadstream() sets a stream to be uploaded by this channel.
...acontentlength a value of -1 indicates that the length of the stream should be determined by calling the stream's available method.
nsIWebBrowser
method overview void addwebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); void removewebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); attributes attribute type description containerwindow nsiwebbrowserchrome the chrome object associated with the browser instance.
... methods addwebbrowserlistener() registers a listener of the type specified by the iid to receive callbacks.
...typically this method will be called to register an object to receive nsiwebprogresslistener or nsishistorylistener notifications in which case the the iid is that of the interface.
nsIWebBrowserChrome2
1.0 66 introduced gecko 1.9 inherits from: nsiwebbrowserchrome last changed in gecko 1.9 (firefox 3) method overview void setstatuswithcontext(in unsigned long statustype, in astring statustext, in nsisupports statuscontext); methods setstatuswithcontext() called when the status text in the chrome needs to be updated.
... this method may be called instead of nsiwebbrowserchrome.setstatus().
... an implementor of this method, should still implement nsiwebbrowserchrome.setstatus().
nsIWebNavigation
it provides methods and attributes to direct an object to navigate to a new location, stop or restart an in process load, or determine where the object has previously gone.
... method overview void goback void goforward void gotoindex( in long index ) void loaduri(in wstring uri , in unsigned long loadflags , in nsiuri referrer , in nsiinputstream postdata, in nsiinputstream headers) void reload(in unsigned long reloadflags) void stop(in unsigned long stopflags) constants load flags constant value ...
... methods goback() tells the object to navigate to the previous session history item.
nsIWebNavigationInfo
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) implemented by: @mozilla.org/webnavigation-info;1 as a service: var webnavigationinfo = components.classes["@mozilla.org/webnavigation-info;1"] .getservice(components.interfaces.nsiwebnavigationinfo); method overview unsigned long istypesupported(in acstring atype, in nsiwebnavigation awebnav); constants support type constants constant value description unsupported 0 returned by istypesupported() to indicate lack of support for a type.
... methods istypesupported() determines whether or not the specified mime type is supported by the given nsiwebnavigation object.
... note: this method may cause plug-ins to be rescanned in order to ensure they are properly registered for the types they support.
nsIWebSocketListener
1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void onacknowledge(in nsisupports acontext, in pruint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsresult ...
...astatuscode); methods onacknowledge() called to acknowledge a message sent via nsiwebsocketchannel.sendmsg() or nsiwebsocketchannel.sendbinarymsg().
...in the case of errors, onstop() may be called without this method ever getting called.
nsIWritablePropertyBag2
xpcom/ds/nsiwritablepropertybag2.idlscriptable this interface extends nsipropertybag2 with methods for setting properties.
... 1.0 66 introduced gecko 1.8 inherits from: nsipropertybag2 last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setpropertyasacstring(in astring prop, in acstring value); void setpropertyasastring(in astring prop, in astring value); void setpropertyasautf8string(in astring prop, in autf8string value); void setpropertyasbool(in astring prop, in boolean value); void setpropertyasdouble(in astring prop, in double value); void setpropertyasint32(in astring prop, in print32 value); void setpropertyasint64(in astring prop, in print64 value); void setpropertyasinterface(in astring prop, in nsisupports value); void setpropertyasuint32(in astring prop, in prui...
...nt32 value); void setpropertyasuint64(in astring prop, in pruint64 value); methods setpropertyasacstring() void setpropertyasacstring( in astring prop, in acstring value ); parameters prop property to set the value of.
nsIXULBrowserWindow
xpfe/appshell/public/nsixulbrowserwindow.idlscriptable provides methods that may be called from the internals of the browser area to tell the containing xul window to update its user interface.
...note: the xulbrowserwindow object offered to javascript code provides a great many more methods and attributes than those listed here, which are only the ones available to c++ code.
...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.
nsIZipReader
modules/libjar/nsizipreader.idlscriptable this interface provides methods for reading compressed (zip) files.
... method overview void close(); void extract(in autf8string zipentry, in nsifile outfile); void extract(in string zipentry, in nsifile outfile); obsolete since gecko 10 nsiutf8stringenumerator findentries(in autf8string apattern); nsiutf8stringenumerator findentries(in string apattern); obsolete since gecko 10 nsiprincipal getcertificateprincipal(in autf8str...
... methods close() closes a zip reader.
wrappedJSObject
this article focuses on the latter kind of wrappers, which hide any properties or methods on the component that are not part of the supported interfaces as declared in xpidl.
...in this example we use getservice, but as long as we get the reference from xpcom, our component gets wrapped by xpconnect in the same way: var comp = components.classes["@myself.com/my-component;1"].getservice(); if we try to call the hello() method we defined in our component implementation, we get: > comp.hello(); typeerror on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is not the helloworld js object itself, but an xpconnect wrapper around it: > dump(comp); [xpconnect wrapped nsisupports] the idea of these wrappers is to make the javascript-implemented xpcom components look just like any ...
...assuming the nsihelloworld interface defines the hello method, we can now call it: > comp.hello() hello world!
Address Book examples
} } note: this method doesn't work with remote address books (e.g.
... * the onshow method should take the input fields in the document, * and render the requested photo in the img tag with id * atargetid.
... the * onsave method is responsible for analyzing the photo of this * type requested by the user, and storing it, as well as the * other fields required by onload/onshow to retrieve and display * the photo again.
Address book sync client design
* * this method is called regardless of whether the the operation was * successful.
...this method is * called only once, at the beginning of a sync transaction * */ void onstartoperation(in print32 atransactionid, in pruint32 amsgsize); /** * notify the observer that progress as occurred for the ab sync operation */ void onprogress(in print32 atransactionid, in pruint32 aprogress, in pruint32 aprogressmax); /** * notify the observer with...
... * * this method is called regardless of whether the the operation was * successful.
Access Thunderbird Window Areas
to access particular parts of the thunderbird window you can use these helper methods.
... an alternative to these methods is to directly access the element by it's id as in the detect when a folder opens example.
... var foldertree = getfoldertree(); var searchinput = getsearchinput(); var messagepane = getmessagepane(); var messagepaneframe = getmessagepaneframe(); var mailtoolbox = getmailtoolbox(); var currentmsgfolder = getloadedmsgfolder(); see the msgmail3panewindow.js for other helper methods ...
StructType
you can call the resulting type's define() method to assign it a non-opaque type later.
... method overview define(fields) methods inherited from ctype ctype array([n]) string tosource() string tostring() methods define() defines a previously declared opaque type's fields.
... structtype cdata method_overview cdata addressoffield(name) methods inherited from cdata cdata address() string tosource() string tostring() structtype cdata methods addressoffield() returns a new cdata object of the appropriate pointer type, whose value points to the specified field of the structure on which the method was called.
ctypes
the ctypes object contains methods and predefined data types used to create and manage a library.
... method overview ctype arraytype(type[, length]); cdata cast(data, type); ctype functiontype(abi, returntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system error.
... methods cast() casts the specified cdata object to a new type, returning a new cdata object representing the value in the new type.
Browser Side Plug-in API - Plugins
« previousnext » this chapter describes methods in the plug-in api that are available from the browser.
... the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in.
... netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream.
Plug-in Basics - Plugins
see initialization and destruction for more information about using these methods.
... plug-in methods are functions that you implement in the plug-in; gecko calls these functions.
... browser methods are functions implemented by gecko; the plug-in calls these functions.
Plug-in Side Plug-in API - Plugins
« previousnext » this chapter describes methods in the plug-in api that are available for the plug-in object.
... the names of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser.
... plugin method summary npp_destroy deletes a specific instance of a plug-in.
Debugger.Environment - Firefox Developer Tools
this allows the code using each debugger instance to place whatever properties it likes on its own debugger.object instances, without worrying about interfering with other debuggers.) if a debugger.environment instance’s referent is not a debuggee environment, then attempting to access its properties (other than inspectable) or call any its methods throws an instance of error.
...all other properties and methods of debugger.environment instances throw if applied to a non-inspectable environment.
... function properties of the debugger.environment prototype object the methods described below may only be called with a this value referring to a debugger.environment instance; they may not be used as methods of other kinds of objects.
AbsoluteOrientationSensor - Web APIs
properties no specific properties; inherits methods from its ancestors orientationsensor and sensor.
... event handlers no specific event handlers; inherits methods from its ancestor, sensor.
... methods no specific methods; inherits methods from its ancestors orientationsensor and sensor.
Animation.finish() - Web APIs
WebAPIAnimationfinish
the finish() method of the web animations api's animation interface sets the current playback time to the end of the animation corresponding to the current playback direction.
... that is, if the animation is playing forward, it sets the playback time to the length of the animation sequence, and if the animation is playing in reverse (having had its reverse() method called), it sets the playback time to 0.
... examples the following example shows how to use the finish() method and catch an invalidstate error.
AnimationEvent.initAnimationEvent() - Web APIs
summary the animationevent.initanimationevent() method initializes an animation event created using the deprecated document.createevent("animationevent") method.
... note: during the standardization process, this method was removed from the specification.
...do not use this method; instead, use the standard constructor, animationevent(), to create a synthetic animationevent.
AudioListener.setOrientation() - Web APIs
the setorientation() method of the audiolistener interface defines the orientation of the listener.
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.setPosition() - Web APIs
the setposition() method of the audiolistener interface defines the position of the listener.
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioParam.value - Web APIs
WebAPIAudioParamvalue
one solution is to use the math.fround() method, which returns the single-precision value equivalent to the 64-bit javascript value specified—when setting value, like this: const source = new audiobuffersourcenode(...); const rate = math.fround(5.3); source.playbackrate.value = rate; console.log(source.playbackrate.value === rate); in this case, the log output will be true.
... if any gradiated or ramped value changing methods have been called and the current time is within the time range over which the graduated change should occur, the value is updated based on the appropriate algorithm.
... these ramped or gradiated value-changing methods include linearramptovalueattime(), settargetattime(), and setvaluecurveattime().
BaseAudioContext.createPanner() - Web APIs
the createpanner() method of the baseaudiocontext interface is used to create a new pannernode, which is used to spatialize an incoming audio stream in 3d space.
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
BaseAudioContext - Web APIs
this occurs when the audiocontext's state changes, due to the calling of one of the state change methods (audiocontext.suspend, audiocontext.resume, or audiocontext.close).
... methods also implements methods from the interface eventtarget.
...this method only works on complete files, not fragments of audio files.
BasicCardRequest - Web APIs
obsolete properties these properties have been removed from the payment method: basic card specification and should no longer be used.
...those are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object that describes what data is needed to fullfil the payment (e.g., a shipping address).
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; var options = {requestshipping: true}; ...
BatteryManager - Web APIs
the navigator.getbattery() method returns a battery promise that is resolved in a batterymanager interface which you can use to interact with the battery status api.
... methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
... additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties.
BiquadFilterNode - Web APIs
the biquadfilternode interface represents a simple low-order filter, and is created using the audiocontext.createbiquadfilter() method.
... not used methods inherits methods from its parent, audionode.
... biquadfilternode.getfrequencyresponse() from the current filter parameter settings this method calculates the frequency response for frequencies specified in the provided array of frequencies.
Blob.arrayBuffer() - Web APIs
WebAPIBlobarrayBuffer
the arraybuffer() method in the blob interface returns a promise that resolves with the contents of the blob as binary data contained in an arraybuffer.
... exceptions while this method doesn't throw exceptions, it may reject the promise.
... usage notes while similar to the filereader.readasarraybuffer() method, arraybuffer() returns a promise rather than being an event-based api, as is the case with the filereader interface's method.
CSSStyleDeclaration - Web APIs
the cssstyledeclaration interface represents an object that is a css declaration block, and exposes style information and various style-related methods and properties.
...see the item() method below.
... methods cssstyledeclaration.getpropertypriority() returns the optional priority, "important".
CSSStyleSheet.addRule() - Web APIs
the obsolete cssstylesheet interface's addrule() legacy method adds a new rule to the stylesheet.
... you should avoid using this method, and should instead use the more standard insertrule() method.
... usage notes this method is implemented by browsers by constructing a string using the template literal `${selector}{${styleblock}}`, then passing it into the standard insertrule() method.
Using dynamic styling information - Web APIs
--> <button onclick="resetstyle('p1');">reset background color</button> </body> </html> the getcomputedstyle() method on the document.defaultview object returns all styles that have actually been computed for an element.
... see example 6: getcomputedstyle in the examples chapter for more information on how to use this method.
... using the setattribute method note that you can also change style of an element by getting a reference to it and then use its setattribute method to specify the css property and its value.
Cache.match() - Web APIs
WebAPICachematch
the match() method of the cache interface returns a promise that resolves to the response associated with the first matching request in the cache object.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... if (event.request.method === 'get' && event.request.headers.get('accept').indexof('text/html') !== -1) { console.log('handling fetch event for', event.request.url); event.respondwith( fetch(event.request).catch(function(e) { console.error('fetch failed; returning offline page instead.', e); return caches.open(offline_cache).then(function(cache) { return cache.match(offline_ur...
CacheStorage - Web APIs
note: cachestorage.match() is a convenience method.
... methods cachestorage.match() checks if a given request is a key in any of the cache objects that the cachestorage object tracks, and returns a promise that resolves to that match.
...use this method to iterate over a list of all the cache objects.
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.
... examples using the settransform method this is just a simple code snippet which uses the settransform method to create a canvaspattern with the specified pattern transformation from an svgmatrix.
... the pattern gets applied if you set it as the current fillstyle and gets drawn onto the canvas when using the fillrect() method, for example.
CanvasPattern - Web APIs
the canvaspattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the canvasrenderingcontext2d.createpattern() method.
... methods there are no inherited method.
... living standard added settransform() method in v5.
CanvasRenderingContext2D.arc() - Web APIs
the canvasrenderingcontext2d.arc() method of the canvas 2d api adds a circular arc to the current sub-path.
... syntax void ctx.arc(x, y, radius, startangle, endangle [, anticlockwise]); the arc() method creates a circular arc centered at (x, y) with a radius of radius.
... examples drawing a full circle this example draws a complete circle with the arc() method.
CanvasRenderingContext2D.beginPath() - Web APIs
the canvasrenderingcontext2d.beginpath() method of the canvas 2d api starts a new path by emptying the list of sub-paths.
... call this method when you want to create a new path.
... html <canvas id="canvas"></canvas> javascript the beginpath() method is called before beginning each line, so that they may be drawn with different colors.
CanvasRenderingContext2D.clearRect() - Web APIs
the canvasrenderingcontext2d.clearrect() method of the canvas 2d api erases the pixels in a rectangular area by setting them to transparent black.
... syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)).
...the clearrect() method then erases part of the canvas.
CanvasRenderingContext2D.clip() - Web APIs
the canvasrenderingcontext2d.clip() method of the canvas 2d api turns the current or given path into the current clipping region.
... examples a simple clipping region this example uses the clip() method to create a clipping region according to the shape of a circular arc.
...region ctx.beginpath(); ctx.arc(100, 75, 50, 0, math.pi * 2); ctx.clip(); // draw stuff that gets clipped ctx.fillstyle = 'blue'; ctx.fillrect(0, 0, canvas.width, canvas.height); ctx.fillstyle = 'orange'; ctx.fillrect(0, 0, 100, 100); result specifying a path and a fillrule this example saves two rectangles to a path2d object, which is then made the current clipping region using the clip() method.
CanvasRenderingContext2D.drawImage() - Web APIs
the canvasrenderingcontext2d.drawimage() method of the canvas 2d api provides different ways to draw an image onto the canvas.
... examples drawing an image to the canvas this example draws an image to the canvas using the drawimage() method.
... const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const image = document.getelementbyid('source'); image.addeventlistener('load', e => { ctx.drawimage(image, 33, 71, 104, 124, 21, 20, 87, 104); }); result understanding source element size the drawimage() method uses the source element's intrinsic size in css pixels when drawing.
CanvasRenderingContext2D.drawWindow() - Web APIs
the deprecated, non-standard and internal only canvasrenderingcontext2d.drawwindow() method of the canvas 2d api renders a region of a window into the canvas.
... example this method draws a snapshot of the contents of a dom window into the canvas.
... with this method, it is possible to fill a hidden iframe with arbitrary content (e.g., css-styled html text, or svg) and draw it into a canvas.
CanvasRenderingContext2D.fill() - Web APIs
the canvasrenderingcontext2d.fill() method of the canvas 2d api fills the current or given path with the current fillstyle.
... examples filling a rectangle this example fills a rectangle with the fill() method.
...the fill() method is then used to render the object to the canvas.
CanvasRenderingContext2D.getImageData() - Web APIs
the canvasrenderingcontext2d method getimagedata() of the canvas 2d api returns an imagedata object representing the underlying pixel data for a specified portion of the canvas.
... this method is not affected by the canvas's transformation matrix.
... note: image data can be painted onto a canvas using the putimagedata() method.
CanvasRenderingContext2D.putImageData() - Web APIs
the canvasrenderingcontext2d.putimagedata() method of the canvas 2d api paints data from the given imagedata object onto the canvas.
...this method is not affected by the canvas transformation matrix.
... note: image data can be retrieved from a canvas using the getimagedata() method.
CanvasRenderingContext2D.restore() - Web APIs
the canvasrenderingcontext2d.restore() method of the canvas 2d api restores the most recently saved canvas state by popping the top entry in the drawing state stack.
... if there is no saved state, this method does nothing.
... syntax void ctx.restore(); examples restoring a saved state this example uses the save() method to save the default state and restore() to restore it later, so that you are able to draw a rect with the default state later.
CanvasRenderingContext2D.stroke() - Web APIs
the canvasrenderingcontext2d.stroke() method of the canvas 2d api strokes (outlines) the current or given path with the current stroke style.
... examples a simple stroked rectangle this example creates a rectangle using the rect() method, and then draws it to the canvas using stroke().
...if you don't, the previous sub-paths will remain part of the current path, and get stroked every time you call the stroke() method.
Canvas API - Web APIs
html <canvas id="canvas"></canvas> javascript the document.getelementbyid() method gets a reference to the html <canvas> element.
... next, the htmlcanvaselement.getcontext() method gets that element's context—the thing onto which the drawing will be rendered.
...the fillrect() method places its top-left corner at (10, 10), and gives it a size of 150 units wide by 100 tall.
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.
...xt"); console.log(parent.outerhtml); // "<div><p></p>text</div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.after(span, "text"); console.log(parent.outerhtml); // "<div><p></p><span></span>text</div>" childnode.after() is unscopable the after() method is not scoped into the with statement.
... with(node) { after("foo"); } // referenceerror: after is not defined polyfill you can polyfill the after() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/after()/after().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('after')) { return; } object.defineproperty(item, 'after', { configurable: true, enumerable: true, writable: true, value: function after() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.appendchi...
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.
...); console.log(parent.outerhtml); // "<div>text<p></p></div>" inserting an element and text var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.before(span, "text"); console.log(parent.outerhtml); // "<div><span></span>text<p></p></div>" childnode.before() is unscopable the before() method is not scoped into the with statement.
... with(node) { before("foo"); } // referenceerror: before is not defined polyfill you can polyfill the before() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/before()/before().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('before')) { return; } object.defineproperty(item, 'before', { configurable: true, enumerable: true, writable: true, value: function before() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof node; docfrag.a...
ChildNode.remove() - Web APIs
WebAPIChildNoderemove
the childnode.remove() method removes the object from the tree it belongs to.
... syntax node.remove(); example using remove() <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <div id="div-03">here is div-03</div> var el = document.getelementbyid('div-02'); el.remove(); // removes the div with the 'div-02' id childnode.remove() is unscopable the remove() method is not scoped into the with statement.
... 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.prototype, documenttype.prototype]); specifications specification status comment domthe definition of...
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.
... examples using replacewith() var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.replacewith(span); console.log(parent.outerhtml); // "<div><span></span></div>" childnode.replacewith() is unscopable the replacewith() method is not scoped into the with statement.
... with(node) { replacewith("foo"); } // referenceerror: replacewith is not defined polyfill you can polyfill the replacewith() method in internet explorer 10+ and higher with the following code: function replacewithpolyfill() { 'use-strict'; // for safari, and ie > 10 var parent = this.parentnode, i = arguments.length, currentnode; if (!parent) return; if (!i) // if there are no arguments parent.removechild(this); while (i--) { // i-- decrements i and returns the value of i before the decrement currentnode = arguments[i]; if (typeof currentnode !== 'object'){ currentnode = this.ownerdocument.createtextnode(currentnode); } else if (currentnode.parentnode){ currentnode.parentnode.removechild(currentnode); ...
ChildNode - Web APIs
WebAPIChildNode
the childnode mixin contains methods and properties that are common to all types of node objects that can have a parent.
... methods there are no inherited methods.
...added the remove(), before(), after() and replacewith() methods.
Clients.matchAll() - Web APIs
WebAPIClientsmatchAll
the matchall() method of the clients interface returns a promise for a list of service worker client objects.
...if options are not included, the method returns only the service worker clients controlled by the service worker.
...in chrome 46/firefox 54 and later, this method returns clients in most recently focused order, correct as per spec.
Clients.openWindow() - Web APIs
the openwindow() method of the clients interface creates a new top level browsing context and loads a given url.
... in firefox, the method is allowed to show popups only when called as the result of a notification click event.
... in chrome for android, the method may instead open the url in an existing browsing context provided by a standalone web app previously added to the user's home screen.
CloseEvent - Web APIs
methods this interface also inherits methods from its parent, event.
...if the event has already being dispatched, this method does nothing.
... do not use this method anymore, use the closeevent() constructor instead.
CompositionEvent - Web APIs
compositionevent.data read only returns the characters generated by the input method that raised the event; its varies depending on the type of event that generated the compositionevent object.
... compositionevent.locale read only returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with ime).
... methods this interface also inherits methods of its parent, uievent, and its ancestor — event.
ConstantSourceNode - Web APIs
methods inherits methods from its parent interface, audioscheduledsourcenode.
... some browsers' implementations of these methods are part of the audioscheduledsourcenode interface.
...after starting the constant source by calling its start() method.
ContentIndex.add() - Web APIs
WebAPIContentIndexadd
the add() method of the contentindex interface registers an item with the content index.
... examples here we're declaring an item in the correct format and creating an asynchronous function which uses the add method to register it with the content index.
...rticle' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } the add method can also be used within the service worker scope.
ContentIndex - Web APIs
methods contentindex.add registers an item with the content index.
... // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index.
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the scope of the service worker.
Content Index API - Web APIs
// reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index.
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } all the above methods are available within the scope of the service worker.
...it is not fired when the contentindex.delete method is called.
CredentialsContainer.preventSilentAccess() - Web APIs
the preventsilentaccess() method of the credentialscontainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise.
...this method is typically called after a user signs out of a website, ensuring this user's login information is not automatically passed on the next site visit.
... earlier versions of the spec called this method requireusermediation().
CredentialsContainer - Web APIs
the credentialscontainer interface of the the credential management api exposes methods to request credentials and notify the user agent when events such as successful sign in or sign out happen.
... methods credentialscontainer.create()secure context returns a promise that resolves with a new credential instance based on the provided options, or null if no credential object can be created.
...earlier versions of the spec called this method requireusermediation().
Crypto.getRandomValues() - Web APIs
the crypto.getrandomvalues() method lets you get cryptographically strong random values.
... exceptions this method can throw an exception under error conditions.
...instead, use the generatekey() method.
CustomElementRegistry - Web APIs
the customelementregistry interface provides methods for registering custom elements and querying registered elements.
... methods customelementregistry.define() defines a new custom element.
...note how we use the customelementregistry.define() method to define the custom element after creating its class.
DOMHighResTimeStamp - Web APIs
methods this type has no methods.
... usage notes you can get the current timestamp value—the time that has elapsed since the context was created—by calling the performance method now().
... this method is available in both window and worker contexts.
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.
... syntax the translate() method accepts two or three values.
... examples this svg contains two squares, one red and one blue, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 50 50"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> </svg> the following javascript first creates an identity matrix, then uses the translate() method to create a new, translated matrix — which is then applied to the blue square as a transform.
DOMMatrixReadOnly - Web APIs
2d 3d equivalent a m11 b m12 c m21 d m22 e m41 f m42 methods this interface doesn't inherit any methods.
... none of the following methods alter the original matrix.
... static methods this interface inherits methods from dommatrixreadonly.
DOMPoint - Web APIs
WebAPIDOMPoint
you can also use an existing dompoint or dompointreadonly or a dompointinit dictionary to create a new point by calling the dompoint.frompoint() static method.
... methods dompoint inherits methods from its parent, dompointreadonly.
... static methods dompoint.frompoint() creates a new mutable dompoint object given an existing point (or a dompointinit dictionary) which provides the values for its properties.
DOMPointReadOnly - Web APIs
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.
... static methods dompointreadonly.frompoint() a static method that creates a new dompointreadonly object given the coordinates provided in the specified dompointinit object.
... methods matrixtransform() applies a matrix transform specified as a dommatrixinit object to the dompointreadonly object.
DOMRect - Web APIs
WebAPIDOMRect
the type of box represented by the domrect is specified by the method or property that returned it.
...only.right returns the right coordinate value of the domrect (has the same value as x + width, or x if width is negative.) domrectreadonly.bottom returns the bottom coordinate value of the domrect (has the same value as y + height, or y if height is negative.) domrectreadonly.left returns the left coordinate value of the domrect (has the same value as x, or x + width if width is negative.) methods domrect inherits methods from its parent, domrectreadonly.
... static methods domrectreadonly.fromrect() creates a new domrect object with a given location and dimensions.
DataTransfer.addElement() - Web APIs
the datatransfer.addelement() method sets the drag source to the given element.
... note: this method is gecko-specific.
... return value void example this example shows the use of the addelement() method function change_drag_node(event, node) { var dt = event.datatransfer; dt.addelement(node); } specifications this method is not defined in any web standard.
DataTransferItem.getAsFile() - Web APIs
if the item is a file, the datatransferitem.getasfile() method returns the drag data item's file object.
... if the item is not a file, this method returns null.
... example this example shows the use of the getasfile() method in a drop event handler.
DataTransferItemList.clear() - Web APIs
the datatransferitemlist method clear() removes all datatransferitem objects from the drag data items list, leaving the list empty.
...while handling drop, the drag data store is in read-only mode, and this method silently does nothing.
... return value undefined example this example shows the use of the clear() method.
DataTransferItemList.remove() - Web APIs
the datatransferitemlist.remove() method removes the datatransferitem at the specified index from the list.
... example this example shows the use of the remove() method.
..."dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } html <h1>example uses of <code>datatransferitemlist</code> methods and property</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding:...
DedicatedWorkerGlobalScope - Web APIs
workerglobalscope.performance read only returns the performance object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
...from the worker.postmessage method.) dedicatedworkerglobalscope.onmessageerror is an eventhandler representing the code to be called when the messageerror event is raised.
... methods this interface inherits methods from the workerglobalscope interface, and its parent eventtarget, and therefore implements methods from windowtimers, windowbase64, and windoweventhandlers.
Document.createNodeIterator() - Web APIs
its acceptnode() method will be called for each node in the subtree based at root which is accepted as included by the whattoshow flag to determine whether or not to include it in the list of iterable nodes (a simple callback function may also be used instead).
... the method should return one of nodefilter.filter_accept, nodefilter.filter_reject, or nodefilter.filter_skip.
... 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.
Document.createTouchList() - Web APIs
note: before gecko 25.0, this method was defined on the documenttouch mixin.
... the document.createtouchlist() method creates and returns a new touchlist object.
... example this example illustrates using the document.createtouchlist() method to create touchlist objects.
Document.createTreeWalker() - Web APIs
the document.createtreewalker() creator method returns a newly created treewalker object.
... filter optional a nodefilter, that is an object with a method acceptnode, which is called by the treewalker to determine whether or not to accept a node that has passed the whattoshow check.
... example the following example goes through all nodes in the body, reduces the set of nodes to elements, simply passes through as acceptable each node (it could reduce the set in the acceptnode() method instead), and then makes use of tree walker iterator that is created to advance through the nodes (now all elements) and push them into an array.
Document.enableStyleSheetsForSet() - Web APIs
calling this method with a null name has no effect; if you want to disable all alternate and preferred style sheets, you must pass "", the empty string.
... stylesheets that don't have a title are never affected by this method.
... this method never affects the values of document.laststylesheetset or document.preferredstylesheetset.
Document.getElementsByClassName() - Web APIs
the getelementsbyclassname method of document interface returns an array-like object of all child elements which have all of the given class name(s).
...t have both the 'red' and 'test' classes: document.getelementsbyclassname('red test') get all elements that have a class of 'test', inside of an element that has the id of 'main': document.getelementbyid('main').getelementsbyclassname('test') get the first element with a class of 'test', or undefined if there is no matching element: document.getelementsbyclassname('test')[0] we can also use methods of array.prototype on any htmlcollection by passing the htmlcollection as the method's this value.
... 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'; }); get the first element whose class is 'test' this is the most commonly used method of operation.
Document.getElementsByName() - Web APIs
the getelementsbyname() method of the document object returns a nodelist collection of elements with a given name in the document.
... the getelementsbyname method works differently in ie10 and below.
... the getelementsbyname method works differently in ie.
Document.implementation - Web APIs
notes the w3c's dom level 1 recommendation only specified the hasfeature method, which is one way to determine if a dom module is supported by a browser (see example above and what does your user agent claim to support?).
... if available, other domimplementation methods provide services for controlling things outside of a single document.
... for example, the domimplementation interface includes a createdocumenttype method with which dtds can be created for one or more documents managed by the implementation.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
the elementfrompoint() method—available on both the document and shadowroot objects—returns the topmost element at the specified coordinates (relative to the viewport).
... if the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called.
... javascript function changecolor(newcolor) { elem = document.elementfrompoint(2, 2); elem.style.color = newcolor; } the changecolor() method simply obtains the element located at the specified point, then sets that element's current foreground color property to the color specified by the newcolor parameter.
DocumentTouch - Web APIs
the documenttouch interface used to provide convenience methods for creating touch and touchlist objects, but documenttouch been removed from the standards.
... these two methods now live on the document interface.
... methods documenttouch.createtouch() creates a new touch object.
EXT_color_buffer_float - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods the following sized formats become color-renderable: gl.r16f, gl.rg16f, gl.rgba16f, gl.r32f, gl.rg32f, gl.rgba32f, gl.r11f_g11f_b10f.
... color-renderable means: the webglrenderingcontext.renderbufferstorage() method now accepts these formats.
Element.querySelectorAll() - Web APIs
the element method queryselectorall() returns a static (not live) nodelist representing a list of elements matching the specified group of selectors which are descendants of the element on which the method was called.
... note: this method is implemented based on the parentnode mixin's queryselectorall() method.
...you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); note: nodelist is not a genuine array, that is to say it doesn't have the array methods like slice, some, map etc.
Element.releasePointerCapture() - Web APIs
the releasepointercapture() method of the element interface releases (stops) pointer capture that was previously set for a specific (pointerevent) pointer.
... see the element.setpointercapture() method for a description of pointer capture and how to set it for a particular element.
... return value this method returns undefined.
Element.removeAttributeNode() - Web APIs
the removeattributenode() method of the element object removes the specified attribute from the current element.
... there is no removeattributenodens method; the removeattributenode method can remove both namespaced attributes and non-namespaced 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 'element: removeattributenode' in that specification.
Element.requestFullscreen() - Web APIs
the element.requestfullscreen() method issues an asynchronous request to make the element be displayed in full-screen mode.
... note: this method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.
...ideo"); if (!document.fullscreenelement) { elem.requestfullscreen().catch(err => { alert(`error attempting to enable full-screen mode: ${err.message} (${err.name})`); }); } else { document.exitfullscreen(); } } if the document isn't already in full-screen mode—detected by looking to see if document.fullscreenelement has a value—we call the video's requestfullscreen() method.
Element.scrollIntoViewIfNeeded() - Web APIs
the element.scrollintoviewifneeded() method scrolls the current element into the visible area of the browser window if it's not already within the visible area of the browser window.
...this method is a proprietary variation of the standard element.scrollintoview() method.
...this is a proprietary, webkit-specific method.
Element.setAttributeNode() - Web APIs
the setattributenode() method adds a new attr node to the specified element.
... 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.
ElementTraversal - Web APIs
the elementtraversal interface used to define methods that allowed access from one node to another in the document tree.
... it proved useless, as very few types of node were able to implement all its methods and properties.
... it has been split into two interfaces, containing the useful methods and properties for each kind of nodes: childnode parentnode as it was a pure interface, with no object of this type, this change has no effect on the web.
Event.msConvertURL() - Web APIs
the msconverturl method instructs the html paste operation on how to modify the src attribute that corresponds to each file in the clipboarddata.files collection, allowing otherwise inaccessible files to be converted to blob or data uris.
... this proprietary method is specific to internet explorer and the microsoft edge browser.
... return value this method does not return a value.
Event.stopPropagation() - Web APIs
the stoppropagation() method of the event interface prevents further propagation of the current event in the capturing and bubbling phases.
...if you want to stop those behaviors, see the preventdefault() method.
... examples see example 5: event propagation in the examples chapter for a more detailed example of this method and event propagation in the dom.
FeaturePolicy.allowedFeatures() - Web APIs
the allowedfeatures() method of the featurepolicy interface returns a list of directive names of all features allowed by the feature policy.enables introspection of individual directives of the feature policy it is run on.
... as such, allowedfeatures() method returns a subset of directives returned by features().
... return value an array of strings representing the feature policy directive names that are allowed by the feature policy this method is called on.
FetchEvent - Web APIs
it provides the event.respondwith() method, which allows us to provide a response to this fetch.
... methods inherits methods from its parent, extendableevent.
... if (event.request.method != 'get') return; // prevent the default, and handle the request ourselves.
File.getAsBinary() - Web APIs
WebAPIFilegetAsBinary
summary the getasbinary method allows to access the file's data in raw binary format.
... note: this method is obsolete; you should use the filereader method readasbinarystring() or readasarraybuffer() instead.
...< files.length; i++) { file = files[i]; // if file type could be detected if (file !== null) { if (accept.binary.indexof(file.type) > -1) { // file is a binary, which we accept var data = file.getasbinary(); } else if (accept.text.indexof(file.type) > -1) { // file is of type text, which we accept var data = file.getastext(); // modify data with string methods } } } specification not part of any specification.
File.getAsText() - Web APIs
WebAPIFilegetAsText
summary the getastext method provides the file's data interpreted as text using a given encoding.
... note: this method is obsolete; you should use the filereader method readastext() instead.
...ain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = files[i]; // if file type could be detected if (file !== null) { if (accept.text.indexof(file.mediatype) > -1) { // file is of type text, which we accept // make sure it's encoded as utf-8 var data = file.getastext("utf-8"); // modify data with string methods } else if (accept.binary.indexof(file.mediatype) > -1) { // binary } } } specification not part of any specification.
FileEntrySync - Web APIs
method overview filewritersync createwriter () raises (fileexception); file file () raises (fileexception); methods createwriter() creates a new filewriter associated with the file that the fileentry represents.
... returns filewritersync exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist.
... returns file exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist.
FileReader.result - Web APIs
WebAPIFileReaderresult
this property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation.
... syntax var file = instanceoffilereader.result value an appropiate string or arraybuffer based on which of the reading methods was used to initiate the read operation.
... method description readasarraybuffer() the result is a javascript arraybuffer containing binary data.
FileReader - Web APIs
this property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation.
... as filereader inherits from eventtarget, all those events can also be listened for by using the addeventlistener method.
... methods filereader.abort() aborts the read operation.
FileReaderSync.readAsBinaryString() - Web APIs
note: this method is deprecated in favor of readasarraybuffer().
... the readasbinarystring() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring.
... 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.
...if not present, the method will apply a detection algorithm for it.
... 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.
FileSystemDirectoryEntry.removeRecursively() - Web APIs
the filesystemdirectoryentry interface's method removerecursively() removes the directory as well as all of its content, hierarchically iterating over its entire subtree of descendant files and directories.
...ome for androidfirefox for androidopera for androidsafari on iossamsung 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.
FileSystemDirectoryReader.readEntries() - Web APIs
the filesystemdirectoryreader interface's readentries() method retrieves the directory entries within the directory being read and delivers them in an array to a provided callback function.
...that's done by calling the item's createreader() method.
...for each one, we call its webkitgetasentry() method to obtain a filesystementry representing the file.
FormData.append() - Web APIs
WebAPIFormDataappend
the append() method of the formdata interface appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist.
... note: this method is available in web workers.
... syntax there are two versions of this method: a two and a three parameter version: formdata.append(name, value); formdata.append(name, value, filename); parameters name the name of the field whose data is contained in value.
FormData.getAll() - Web APIs
WebAPIFormDatagetAll
the getall() method of the formdata interface returns all the values associated with a given key from within a formdata object.
... note: this method is available in web workers.
...if the key doesn't exist, the method returns an empty list.
FormData.set() - Web APIs
WebAPIFormDataset
the set() method of the formdata interface sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
... note: this method is available in web workers.
... syntax there are two versions of this method: a two and a three parameter version: formdata.set(name, value); formdata.set(name, value, filename); parameters name the name of the field whose data is contained in value.
FormDataEntryValue - Web APIs
this type is returned by the formdata.get() and formdata.getall() methods.
... the formdata.get() method returns a single value while formdata.getall() returns an array of formdataentryvalues.
... note that the formdata.append() and formdata.set() methods allow passing a blob value, which is converted to a file in the process.
Guide to the Fullscreen API - Web APIs
activating full-screen mode given an element that you'd like to present in full-screen mode (such as a <video>, for example), you can present it in full-screen mode by simply calling its requestfullscreen() method.
... let's consider this <video> element: <video controls id="myvideo"> <source src="somevideo.webm"></source> <source src="somevideo.mp4"></source> </video> we can put that video into full-screen mode as follows: var elem = document.getelementbyid("myvideo"); if (elem.requestfullscreen) { elem.requestfullscreen(); } this code checks for the existence of the requestfullscreen() method before calling it.
...you can also do so programmatically by calling the document.exitfullscreen() method.
HTMLCanvasElement.getContext() - Web APIs
the htmlcanvaselement.getcontext() method returns a drawing context on the canvas, or null if the context identifier is not supported.
... later calls to this method on the same canvas element return the same drawing context instance as was returned the last time the method was invoked with the same contexttype argument.
... to get a different drawing context object you need to pass a different contexttype or call the method on a different canvas element.
HTMLCollection.item - Web APIs
the htmlcollection method item() returns the node located at the specified offset into the collection.
... usage notes the item() method returns a numbered element from an htmlcollection.
... example var c = document.images; // this is an htmlcollection var img0 = c.item(0); // you can use the item() method this way var img1 = c[1]; // but this notation is easier and more common ...
HTMLDialogElement.open - Web APIs
examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method.
... from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); ...
HTMLFieldSetElement - Web APIs
the htmlfieldsetelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <fieldset> elements.
... methods inherits methods from its parent, htmlelement.
... the following methods have been added: checkvalidity(), setcustomvalidity().
HTMLFormElement.reset() - Web APIs
the htmlformelement.reset() method restores a form element's default values.
... this method does the same thing as clicking the form's reset button.
... if a form control (such as a reset button) has a name or id of reset it will mask the form's reset method.
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.
... examples the following example shows how to use the decode() method to control when an image is appended to the dom.
... without a promise-returning method, you would add the image to the dom in a load event handler, such as by using the img.onload event handler, and by handling the error in the error event's handler.
HTMLLIElement - Web APIs
the htmllielement interface exposes specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating list elements.
...as the standard way of defining the list type is via the css list-style-type property, use the cssom methods to set it via a script.
... methods no specific method; inherits properties from its parent, htmlelement.
HTMLMarqueeElement - Web APIs
the htmlmarqueeelement interface provides methods to manipulate <marquee> elements.
... it inherits properties and methods from the htmlelement interface.
... methods inherits methods from its parent, htmlelement.
msClearEffects - Web APIs
the mscleareffects method of the htmlmediaelement, is a proprietary method specific to internet explorer and microsoft edge.
... syntax htmlmediaelement.mscleareffects(); parameters this method has no parameters.
... return value this method does not return a value.
HTMLMediaElement.msInsertAudioEffect() - Web APIs
the htmlmediaelement.msinsertaudioeffect() method inserts the specified audio effect into the media pipeline.
... this proprietary method is specific to internet explorer and microsoft edge.
... return value this method does not return a value.
HTMLMediaElement.play() - Web APIs
the htmlmediaelement play() method attempts to begin playback of the media.
... note: the play() method may cause the user to be asked to grant permission to play the media, resulting in a possible delay before the returned promise is resolved.
... note: the whatwg and w3c versions of the specification differ (as of august, 2018) as to whether this method returns a promise or nothing at all, respectively.
HTMLMediaElement: play event - Web APIs
the play event is fired when the paused property is changed from true to false, as a result of the play method, or the autoplay attribute.
...either the ' + 'play() method was called or the autoplay attribute was toggled.'); }); using the onplay event handler property: const video = document.queryselector('video'); video.onplay = (event) => { console.log('the boolean paused property is now false.
... either the ' + 'play() method was called or the autoplay attribute was toggled.'); }; specifications specification status html living standardthe definition of 'play media event' in that specification.
HTMLMedia​Element​.textTracks - Web APIs
the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method.
... var tracks = document.queryselector('video').texttracks; for (var i = 0, l = tracks.length; i < l; i++) { /* tracks.length == 10 */ if (tracks[i].language == 'en') { console.dir(tracks[i]); } } properties & methods properties length returns the number of text tracks in texttracklist object.
... methods gettrackbyid() the gettrackbyid(id) method returns the first texttrack in the texttracklist object that matches the id, or null if there is no match.
HTMLObjectElement - Web APIs
the htmlobjectelement interface provides special properties and methods (beyond those on the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources.
... methods inherits methods from its parent, htmlelement.
... the following methods have been added: checkvalidity() and setcustomvalidity().
HTMLElement.focus() - Web APIs
the htmlelement.focus() method sets focus on the specified element, if it can be focused.
... examples focus on a text field javascript focusmethod = function getfocus() { document.getelementbyid("mytextfield").focus(); } html <input type="text" id="mytextfield" value="text field."> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the text field!</button> result focus on a button javascript focusmethod = function getfocus() { document.getelementbyid("mybutton").focus(); } html <bu...
...tton type="button" id="mybutton">click me!</button> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the button!</button> result focus with focusoption javascript focusscrollmethod = function getfocus() { document.getelementbyid("mybutton").focus({preventscroll:false}); } focusnoscrollmethod = function getfocuswithoutscrolling() { document.getelementbyid("mybutton").focus({preventscroll:true}); } html <button type="button" onclick="focusscrollmethod()">click me to focus on the button!</button> <button type="button" onclick="focusnoscrollmethod()">click me to focus on the button without scrolling!</button> <div id="container" style="height: 1000px; width: 1000px;"> <button type="button" id="mybutton" style="margin-top: 500px;">click m...
HTMLOutputElement - Web APIs
the htmloutputelement interface provides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <output> elements.
... methods this interface also inherits methods from its parent, htmlelement.
... htmloutputelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user.
HTMLSelectElement.add() - Web APIs
the htmlselectelement.add() method adds an element to the collection of option elements for this select element.
... exceptions a domerror of the type hierarchyrequesterror if the item passed to the method is an ancestor of the htmlselectelement.
... obsolete the method now throws an not_found_err exception if the item of the before parameter is not a child of this element.
HTMLTableRowElement - Web APIs
the htmltablerowelement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an html table.
... methods inherits methods from its parent, htmlelement.
... the methods insertcell and deletecell can raise exceptions.
HTMLTableSectionElement - Web APIs
the htmltablesectionelement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an html table.
... methods inherits methods from its parent, htmlelement.
... obsolete the methods insertrow and deleterow can raise exceptions.
HTMLVideoElement.msFrameStep() - Web APIs
the htmlvideoelement.msframestep() method steps the video by one frame forward or one frame backward.
... this proprietary method is specific to internet explorer and microsoft edge.
... return value this method does not return a value.
HTMLVideoElement.msInsertVideoEffect() - Web APIs
the htmlmediaelement.msinsertvideoeffect() method inserts the specified video effect into the media pipeline.
... this proprietary method is specific to internet explorer and microsoft edge.
... return value this method does not return a value.
msSetVideoRectangle - Web APIs
the htmlvideoelement.mssetvideorectangle() method sets the dimensions of a sub-rectangle within a video.
... this proprietary method is specific to internet explorer and microsoft edge.
... return value this method does not return a value.
History.back() - Web APIs
WebAPIHistoryback
the history.back() method causes the browser to move back one page in the session history.
...if there is no previous page, this method call does nothing.
... this method is asynchronous.
History.pushState() - Web APIs
WebAPIHistorypushState
in an html document, the history.pushstate() method adds a state to the browser's session history stack.
...if you pass a state object whose serialized representation is larger than this to pushstate(), the method will throw an exception.
...passing the empty string here should be safe against future changes to the method.
IDBCursorSync - Web APIs
method overview bool continue (in optional any key); void remove () raises (idbdatabaseexception); attributes attribute type description count readonly unsigned long long the total number of objects that share the current key.
... methods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter.
... remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an idbdatabaseexception with the following code: not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode.
IDBDatabase.close() - Web APIs
WebAPIIDBDatabaseclose
the close() method of the idbdatabase interface returns immediately and closes the connection in a separate thread.
...no new transactions can be created for this connection once this method is called.
... methods that create transactions throw an exception if a closing operation is pending.
IDBDatabase.deleteObjectStore() - Web APIs
the deleteobjectstore() method of the idbdatabase interface destroys the object store with the given name in the connected database, along with any indexes that reference it.
... as with idbdatabase.createobjectstore, this method can be called only within a versionchange transaction.
... 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
the cmp() method of the idbfactory interface compares two values as keys to determine equality and ordering for indexeddb operations, such as storing and iterating.
... note: do not use this method for comparing arbitrary javascript values, because many javascript values are either not valid indexeddb keys (booleans and objects, for example) or are treated as equivalent indexeddb keys (for example, since indexeddb ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent).
... 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.
IDBIndex.openCursor() - Web APIs
the opencursor() method of the idbindex interface returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range.
... the method sets the position of the cursor to the appropriate record, based on the specified direction.
... 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
the openkeycursor() method of the idbindex interface returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index.
... the method sets the position of the cursor to the appropriate key, based on the specified direction.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBKeyRange.includes() - Web APIs
the includes() method of the idbkeyrange interface returns a boolean indicating whether a specified key is inside the key range.
... exceptions this method may raise a domexception of the following type: attribute description dataerror the supplied key was not a valid key.
... example var keyrangevalue = idbkeyrange.bound('a', 'k', false, false); var myresult = keyrangevalue.includes('f'); // returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the indexed db specification.
IDBObjectStore.delete() - Web APIs
the delete() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, deletes the specified record or records.
... bear in mind that if you are using a idbcursor, you can use the idbcursor.delete() method to more efficiently delete the current record — without having to explicitly look up the record's key.
... exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this object store's transaction is inactive.
IDBTransaction - Web APIs
methods inherits from: eventtarget idbtransaction.abort() rolls back all the changes to objects in the database associated with this transaction.
... if this transaction has been aborted or completed, this method fires an error event.
...this mode is for updating the version number of transactions that were started using the setversion() method of idbdatabase objects.
IDBVersionChangeRequest - Web APIs
warning: the latest specification does not include this interface anymore as the idbdatabase.setversion() method has been removed.
...it is used only by the setversion() method of idbdatabase.
... methods inherits from: idbrequest idbversionchangerequest.setversion updates the version of the database.
IdleDeadline.timeRemaining() - Web APIs
the timeremaining() method on the idledeadline interface returns the estimated number of milliseconds remaining in the current idle period.
... the callback can call this method at any time to determine how much time it can continue to work before it must return.
... if the idledeadline object's didtimeout property is true, this method returns zero.
enabled - Web APIs
method of installtrigger object syntax boolean enabled (); parameters none returns true if software installation is enabled for this client machine; otherwise, false.
... the method reflects the value of the software installation preference in the user interface, and of the xpinstall.enabled preference in pref.js.
... example the following code uses the startsoftwareupdate method to unconditionally trigger a download from http://royalairways/royalpkg.xpi as long as software installation is enabled on the browser: if (installtrigger.enabled() ) { installtrigger.startsoftwareupdate ("http://royalair.com/rasoft.xpi"); } ...
getVersion - Web APIs
method of installtrigger object syntax installversion getversion ( string component ); parameters the getversion method has one parameter: component the name of a component in the client version registry.
... returns if software installation is disabled, this method returns null.
... if the component has not been registered in the client version registry or if the specified component was installed with a null version, this method returns null.
install - Web APIs
method of installtrigger object syntax int install(array xpilist [, function callbackfunc ] ) parameters the install method has the following parameters: xpilist an array of files to be installed (see example below).
... description in the example below, a special javascript object constructor is used to create an object that can be passed to the install() method.
... as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js files in which the full installation is defined.
installChrome - Web APIs
method of installtrigger object syntax int installchrome( type, url, name ) parameters the installchrome method has the following parameters: type type can be installtrigger.skin or installtrigger.locale.
...description installchrome is a special method for installing new chrome in netscape 6 and mozilla.
... the method performs a simplified installation of language packs or netscape 6/mozilla skins, and saves you the trouble of writing separate installation scripts in the xpi files or using the more sophisticated methods of the install and file objects.
InstallTrigger - Web APIs
overview for very simple installations, the install methods on the installtrigger object may be all that's needed in the installation script.
...in either case, you must trigger the installation process by creating a web page script in which installtrigger methods download the specified xpi file and "trigger" the execution of the install.js script at the top level of that xpi.
... the principal method on the installtrigger object is install, which downloads and installs one or more software packages archived in the xpi file format.
IntersectionObserver.takeRecords() - Web APIs
the intersectionobserver method takerecords() returns an array of intersectionobserverentry objects, one for each targeted element which has experienced an intersection change since the last time the intersections were checked, either explicitly through a call to this method or implicitly by an automatic call to the observer's callback.
... note: if you use the callback to monitor these changes, you don't need to call this method.
... calling this method clears the pending intersection list, so the callback will not be run.
KeyboardEvent.initKeyboardEvent() - Web APIs
the keyboardevent.initkeyboardevent() method initializes the attributes of a keyboard event object.
... this method was introduced in draft of dom level 3 events, but deprecated in newer draft.
... gecko won't support this feature since implementing this method as experimental broke existing web apps (see bug 999645).
KeyboardEvent - Web APIs
methods this interface also inherits methods of its parents, uievent and event.
... obsolete methods keyboardevent.initkeyevent() initializes a keyboardevent object.
...this led to the implementation of non-standard initialization methods, the early dom events level 2 version, keyboardevent.initkeyevent() by gecko browsers and the early dom events level 3 version, keyboardevent.initkeyboardevent() by others.
Keyboard API - Web APIs
the keyboard api provides methods for working with a physical keyboard that is attached to a device running a browser.
...keyboard provides the keyboard.getlayoutmap method, which returns a promise that resolves with a keyboardlayoutmap object that contains members for converting codes to keys.
... writing system keys the codes passed keyboard.lock and the various methods of the keyboardlayoutmap interface are called “writing system keys”.
LocalMediaStream - Web APIs
the primary reason for this interface to exist was to add a stop() method to its mediastream parent interface.
... methods localmediastream.stop() stops the stream.
...this method is no longer available with the deprecation of localmediastream.
Location: replace() - Web APIs
WebAPILocationreplace
the replace() method of the location interface replaces the current resource with the one at the provided url.
... the difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to navigate to it.
...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.
LockManager.request() - Web APIs
the request() method of the lockmanager interface requests a lock object with parameters specifying its name and characteristics.
... examples general example the following example shows the basic use of the request() method with an asynchronous function as the callback.
...in this function await means the method will not return until the callback is complete.
LockedFile.truncate() - Web APIs
summary the truncate method is used to remove some data within the file.
... if the method is called with no argument, the operation removes all the bytes starting at the index set in lockedfile.location.
... if the method is called with an argument, the operation removes all the bytes starting at the index corresponding to the parameter and regardless of the value of lockedfile.location.
MSCandidateWindowUpdate - Web APIs
mscandidatewindowupdate fires after the input method editor (ime) candidate window has been identified as needing to change size, but before any visual updates have rendered.
... this proprietary method is specific to internet explorer.
... syntax event property object.oncandidatewindowupdate = handler; addeventlistener method object.addeventlistener("mscandidatewindowupdate", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event.
MSManipulationEvent.initMSManipulationEvent() - Web APIs
the initmsmanipulationevent method is used to create a msmanipulationevent that can be called from javascript.
... this proprietary method is specific to internet explorer.
... return value this method does not return a value.
MediaConfiguration - Web APIs
the mediaconfiguration mediacapabilities dictionary of the media capabilities api describes how media and audio files must be configured, or defined, to be passed as a parameter of the mediacapabilities.encodinginfo() and mediacapabilities.encodinginfo() methods.
... a valid media decoding configuration, to be submitted as the parameter for mediacapabilities.decodinginfo() method, has it's `type` set as: file: for plain playback file.
... a valid media encoding configuration, to be submitted as the parameter for mediacapabilities.encodinginfo() method, has it's `type` set as: record: for recording media.
MediaDevices.getUserMedia() - Web APIs
the mediadevices.getusermedia() method prompts the user for permission to use a media input which produces a mediastream with tracks containing the requested types of media.
...getusermedia() is one method which will require the use of feature policy, and your code needs to be prepared to deal with this.
... encryption based security the getusermedia() method is only available in secure contexts.
MediaElementAudioSourceNode - Web APIs
a mediaelementsourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediaelementsource() method.
... number of inputs 0 number of outputs 1 channel count defined by the media in the htmlmediaelement passed to the audiocontext.createmediaelementsource method that created it.
... methods inherits methods from its parent, audionode.
MediaRecorder.requestData() - Web APIs
the mediarecorder.requestdata() method (part of the mediarecorder api) is used to raise a dataavailable event containing a blob object of the captured media as it was when the method was called.
... 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.
... syntax mediarecorder.requestdata() errors an invalidstate error is raised if the requestdata() method is called while the mediarecorder object’s mediarecorder.state is not "recording" — the media cannot be captured if recording is not occurring.
MediaRecorder.resume() - Web APIs
the mediarecorder.resume() method (part of the mediarecorder api) is used to resume media recording when it has been previously paused.
... 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.
... syntax mediarecorder.resume() errors an invalidstate error is raised if the resume() method is called while the mediarecorder object’s mediarecorder.state is "inactive" — the recording cannot be resumed if it is not already paused; if mediarecorder.state is already "recording", resume() has no effect.
MediaRecorder.stop() - Web APIs
the mediarecorder.stop() method (part of the mediarecorder api) is used to stop media capture.
... 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.
... syntax mediarecorder.stop() errors an invalidstate error is raised if the stop() method is called while the mediarecorder object’s mediarecorder.state is "inactive" — it makes no sense to stop media capture if it is already stopped.
MediaStreamAudioSourceNode - Web APIs
a mediastreamaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamsource() method.
... number of inputs 0 number of outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamsource() method that created it.
... methods inherits methods from its parent, audionode.
MediaStreamTrack.stop() - Web APIs
the mediastreamtrack.stop() method stops the track.
...then the stream's track list is obtained by calling its gettracks() method.
... from there, all that remains to do is to iterate over the track list using foreach() and calling each track's stop() method.
MediaStreamTrackAudioSourceNode - Web APIs
a mediastreamtrackaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamtracksource() method.
... number of inputs 0 number of outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamtracksource() method that created it.
... methods inherits methods from its parent, audionode.
MediaStream Image Capture API - Web APIs
the example below simply says give me whatever video device is available, though the getusermedia() method allows more specific capabilities to be requested.
... this method returns a promise that resolves with a mediastream object.
...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".
Using the MediaStream Recording API - Web APIs
const mediarecorder = new mediarecorder(stream); there are a series of methods available in the mediarecorder interface that allow you to control recording of the media stream; in web dictaphone we just make use of two, and listen to some events.
...we register an event handler to do this using mediarecorder.ondataavailable: let chunks = []; mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } note: the browser will fire dataavailable events as needed, but if you want to intervene you can also include a timeslice when invoking the start() method — for example start(10000) — to control this interval, or call mediarecorder.requestdata() to trigger an event when you need it.
... lastly, we use the mediarecorder.stop() method to stop the recording when the stop button is pressed, and finalize the blob ready for use somewhere else in our application.
MerchantValidationEvent - Web APIs
properties merchantvalidationevent.methodname secure context a domstring providing a unique payment method identifier for the payment handler that's requiring validation.
... this may be either one of the standard payment method identifier strings or a url that both identifies and handles requests for the payment handler, such as https://apple.com/apple-pay.
... methods merchantvalidationevent.complete() secure context pass the data retrieved from the url specified by validationurl into complete() to complete the validation process for the paymentrequest.
MessageEvent - Web APIs
methods this interface also inherits methods from its parent, event.
...if the onmessage event is attached using addeventlistener, the port is manually started using its start() method: myworker.port.start(); when the port is started, both scripts post messages to the worker and handle messages sent from it using port.postmessage() and port.onmessage, respectively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.v...
...the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads.
MessagePort.start() - Web APIs
WebAPIMessagePortstart
the start() method of the messageport interface starts the sending of messages queued on the port.
... this method is only needed when using eventtarget.addeventlistener; it is implied when using messagechannel.onmessage.
... example in the following code block, you can see a handlemessage handler function, run when a message is sent back to this document using onmessage: channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } another option would be to do this using eventtarget.addeventlistener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document: channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); specifications specification status comment html living standardthe definition of 'start()' in that specifica...
msSetMediaProtectionManager - Web APIs
the mssetmediaprotectionmanager method specifies the media protection manager for a given media pipeline.
... this proprietary method is specific to internet explorer and microsoft edge.
... return value this method does not return a value.
Navigator.getUserMedia() - Web APIs
the deprecated navigator.getusermedia() method prompts the user for permission to use up to one video input device (such as a camera or shared screen) and up to one audio input device (such as a microphone) as the source for a mediastream.
... this is a legacy method.
...for details, see the constraints section under the modern mediadevices.getusermedia() method, as well as the article capabilities, constraints, and settings.
Navigator.msLaunchUri() - Web APIs
the mslaunchuri() method is a microsoft extension to the navigator interface, which starts a service or app, such as an email client, that handles a given protocol.
... this proprietary method is specific to internet explorer, and microsoft edge versions 18 and lower.
...the mslaunchuri() method does not support http, secure hypertext transfer protocol (https), file transfer protocol (ftp), file, res, javascript, or microsoft visual basic scripting edition (vbscript) protocols.
msSaveBlob - Web APIs
the navigator.mssaveblob() method saves the file or blob to disk.
... this method behaves in the same way as navigator.mssaveoropenblob() except that this disables the file open option.
... notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header, where x-download-options removes the file open button from the browser file download dialog: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> x-download-options: noopen specifications not part of any specifications.
msSaveOrOpenBlob - Web APIs
the navigator.mssaveoropenblob() method saves the file or blob to disk.
... this method behaves in the same way as navigator.mssaveblob() except that this enables the file open option.
... notes when a site calls this method, the behavior is the same as when windows internet explorer downloads a file with the following in the header: content-length: <blob.size> content-type: <blob.type> content-disposition: attachment;filename=<defaultname> specifications not part of any specifications.
Navigator - Web APIs
WebAPINavigator
navigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.
... navigator.credentials returns the credentialscontainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
... methods doesn't inherit any method, but implements those defined in navigatorid, navigatorcontentutils, navigatorusermedia, and navigatorstorageutils.
NavigatorID.taintEnabled() - Web APIs
the navigatorid.taintenabled() method always returns false.
... tainting was a security method used by javascript 1.2.
... it has long been removed; this method only stays for maintaining compatibility with very old scripts.
Node.appendChild() - Web APIs
WebAPINodeappendChild
the node.appendchild() method adds a node to the end of the list of children of a specified parent node.
...the node.clonenode() method can be used to make a copy of the node before appending it under the new parent.
...the parentnode.append() method supports multiple arguments and appending strings.
Node.insertBefore() - Web APIs
WebAPINodeinsertBefore
the node.insertbefore() method inserts a node before a reference node as a child of a specified parent node.
...nt"> <span id="childelement">foo bar</span> </div> <script> // create a new, plain <span> element let sp1 = document.createelement("span") // get the reference element let sp2 = document.getelementbyid("childelement") // get the parent element let parentdiv = sp2.parentnode // insert the new element into before sp2 parentdiv.insertbefore(sp1, sp2) </script> note: there is no insertafter() method.
... it can be emulated by combining the insertbefore method with node.nextsibling.
NodeList.item() - Web APIs
WebAPINodeListitem
this method doesn't throw exceptions as long as you provide arguments.
...this is usually obtained from another dom property or method, such as childnodes.
... nodeitem is the indexth node in the nodelist returned by the item method.
OES_texture_float - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods this extension extends webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d(): the type parameter now accepts gl.float.
...if you set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use floating-point textures, the texture will be marked as incomplete.
OES_texture_half_float - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods this extension extends webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d(): the type parameter now accepts ext.half_float_oes.
...if you set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use half floating-point textures, the texture will be marked as incomplete.
OfflineAudioContext - Web APIs
methods also inherits methods from its parent interface, baseaudiocontext.
... deprecated methods offlineaudiocontext.resume() resumes the progression of time in an audio context that has previously been suspended.
... note: the resume() method is still available — it is now defined on the baseaudiocontext interface (see baseaudiocontext.resume()) and thus can be accessed by both the audiocontext and offlineaudiocontext interfaces.
OffscreenCanvas - Web APIs
methods offscreencanvas.getcontext() returns a rendering context for the offscreen canvas.
...once a new frame has finished rendering in this context, the transfertoimagebitmap() method can be called to save the most recent rendered image.
... this method returns an imagebitmap object, which can be used in a variety of web apis and also in a second canvas without creating a transfer copy.
PannerNode.setOrientation() - Web APIs
the setorientation() method of the pannernode interface defines the direction the audio source is playing in.
... example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
PannerNode - Web APIs
methods inherits methods from its parent, audionode.
... examples in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
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.
... ] appending text let parent = document.createelement("div") parent.append("some text") console.log(parent.textcontent) // "some text" appending an element and text let parent = document.createelement("div") let p = document.createelement("p") parent.append("some text", p) console.log(parent.childnodes) // nodelist [ #text "some text", <p> ] parentnode.append() is unscopable the append() method is not scoped into the with statement.
... let parent = document.createelement("div") with(parent) { append("foo") } // referenceerror: append is not defined polyfill you can polyfill the append() method in internet explorer 9 and higher with the following code: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/append()/append().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('append')) { return; } object.defineproperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumentfragment(); argarr.foreach(function (argitem) { var isnod...
ParentNode.prepend() - Web APIs
the parentnode.prepend() method inserts a set of node objects or domstring objects before the first child of the parentnode.
...lement("div"); parent.append("some text"); parent.prepend("headline: "); console.log(parent.textcontent); // "headline: some text" appending an element and text var parent = document.createelement("div"); var p = document.createelement("p"); parent.prepend("some text", p); console.log(parent.childnodes); // nodelist [ #text "some text", <p> ] parentnode.prepend() is unscopable the prepend() method is not scoped into the with statement.
... 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.createdocumentfragment(); argarr.foreach(function (argitem) { var isnode = argitem instanceof nod...
ParentNode.querySelectorAll() - Web APIs
the parentnode mixin defines the queryselectorall() method as returning a nodelist representing a list of elements matching the specified group of selectors which are descendants of the object on which the method was called.
... if you need only a single result, consider the queryselector() method instead.
... 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.
ParentNode - Web APIs
the parentnode mixin contains methods and properties that are common to all types of node objects that can have children.
... methods parentnode.append() inserts a set of node objects or domstring objects after the last child of the parentnode.
...added the parentnode.children property, and the parentnode.queryselector(), parentnode.queryselectorall(), parentnode.append(), and parentnode.prepend() methods.
PaymentDetailsUpdate - Web APIs
this can be done either by calling the paymentrequestupdateevent.updatewith() method or by using the paymentrequest.show() method's detailspromise parameter to provide a promise that returns a paymentdetailsupdate that updates the payment information before the user interface is even enabled for the first time.
... modifiers optional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers.
... for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!").
PaymentRequest - Web APIs
methods paymentrequest.canmakepayment() secure context indicates whether the paymentrequest object can make a payment before calling show().
... paymentmethodchange secure context with some payment handlers (e.g., apple pay), dispatched whenever the user changes payment instrument, like switching from a credit card to a debit card.
... also available using the onpaymentmethodchange event handler property.
PaymentRequestUpdateEvent.updateWith() - Web APIs
the updatewith() method of the paymentrequestupdateevent interface updates the details of an existing paymentrequest.
... modifiers optional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers.
... for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!").
PaymentResponse.complete() - Web APIs
the paymentrequest method complete() of the payment request api notifies the user agent that the user interaction is over, and causes any remaining user interface to be closed.
... this method must be called after the user accepts the payment request and the promise returned by the paymentrequest.show() method is resolved.
...var payment = new paymentrequest(supportedinstruments, details, options); payment.show().then(function(paymentresponse) { var fetchoptions = { method: 'post', credentials: include, body: json.stringify(paymentresponse) }; var serverpaymentrequest = new request('secure/payment/endpoint'); fetch(serverpaymentrequest, fetchoptions).then( response => { if (response.status < 400) { paymentresponse.complete("success"); } else { paymentresponse.complete("fail"); }; }).catch( reason => { paymentresponse.comp...
PaymentResponse: payerdetailchange event - Web APIs
if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries.
... const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed.
... const errors = await promise.all(promisestovalidate).then(results => results.reduce((errors, result), object.assign(errors, result)) ); // if we found any errors, wait for them to be corrected if (object.getownpropertynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things/", { 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 => { ...
PaymentValidationErrors - Web APIs
when validation of the paymentresponse returned by the paymentrequest.show() or paymentresponse.retry() methods fails, your code creates a paymentvalidationerrors object to pass into retry() so that the user agent knows what needs to be fixed and what if any error messages to display to the user.
... paymentmethod optional any payment method specific errors which may have occurred.
...for example, if the user chose to pay by credit card using the basic-card payment method, this is a basiccarderrors object.
performance.clearMarks() - Web APIs
the clearmarks() method removes the named mark from the browser's performance entry buffer.
... if the method is called with no arguments, all performance entries with an entry type of "mark" will be removed from the performance entry buffer.
... return value void example the following example shows both uses of the clearmarks() method.
performance.clearMeasures() - Web APIs
the clearmeasures() method removes the named measure from the browser's performance entry buffer.
... if the method is called with no arguments, all performance entries with an entry type of "measure" will be removed from the performance entry buffer.
... return value void example the following example shows both uses of the clearmeasures() method.
performance.clearResourceTimings() - Web APIs
the clearresourcetimings() method removes all performance entries with an entrytype of "resource" from the browser's performance data buffer and sets the size of the performance data buffer to zero.
... to set the size of the browser's performance data buffer, use the performance.setresourcetimingbuffersize() method.
... syntax performance.clearresourcetimings(); arguments void return value none this method has no return value.
performance.mark() - Web APIs
WebAPIPerformancemark
the mark() method creates a timestamp in the browser's performance entry buffer with the given name.
... the application defined timestamp can be retrieved by one of the performance interface's getentries*() methods (getentries(), getentriesbyname() or getentriesbytype()).
...if the name given to this method already exists in the performancetiming interface, syntaxerror is thrown.
PerformanceEntry - Web APIs
a performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application.
... methods performanceentry.tojson() returns a json representation of the performanceentry object.
... candidate recommendation added tojson() serializer method.
Using Pointer Events - Web APIs
this may be a finger (or elbow, ear, nose, whatever, but typically a finger), stylus, mouse, or any other method for specifying a single point on the surface.
... example the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus, mouse, or other method of pointing at a location.
... this lets us get the coordinates of the previous position of each touch and use the appropriate context methods to draw a line segment joining the two positions together.
PublicKeyCredential - Web APIs
methods publickeycredential.getclientextensionresults()secure context if any extensions were requested, this method will return the results of processing those extensions.
... publickeycredential.isuserverifyingplatformauthenticatoravailable()secure context a static method returning a promise which resolves to true if an authenticator bound to the platform is capable of verifying the user.
... with the current state of implementation, this method only resolves to true when windows hello is available on the system.
PushManager.registrations() - Web APIs
the registrations method is used to ask the system about existing push endpoint registrations.
... syntax var request = navigator.push.registrations(); return a domrequest object to handle the success or failure of the method call.
... if the method call is successful, the request's result will be an array of pushregistration objects.
PushManager - Web APIs
methods pushmanager.getsubscription() retrieves an existing push subscription.
... deprecated methods pushmanager.haspermission() returns a promise that resolves to the pushpermissionstatus of the requesting webapp, which will be one of granted, denied, or default.
...in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method.
RTCDataChannel - Web APIs
to create a data channel and ask a remote peer to join you, call the rtcpeerconnection's createdatachannel() method.
...this event is sent to the channel when a message is received from the other peer.onopen the rtcdatachannel.onopen property is an eventhandler which specifies a function to be called when the open event is fired; this is a simple event which is sent when the data channel's underlying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established.methodsalso inherits methods from: eventtargetclose()the rtcdatachannel.close() method closes the rtcdatachannel.
... either peer is permitted to call this method to initiate closure of the channel.send()the send() method of the rtcdatachannel interface sends data across the data channel to the remote peer.
RTCOfferOptions.iceRestart - Web APIs
note: rather than manually creating and submitting an offer with icerestart set to true, you should consider calling the rtcpeerconnection method restartice() instead.
...you should ideally do this by calling the rtcpeerconnection's restartice() method, if it's available.
... pc.oniceconnectionstatechange = function(evt) { if (pc.iceconnectionstate === "failed") { if (pc.restartice) { pc.restartice(); } else { pc.createoffer({ icerestart: true }) .then(pc.setlocaldescription) .then(sendoffertoserver); } } } if the state changes to failed, this handler starts by looking to see if the rtcpeerconnection includes the restartice() method; if it does, we call that to request an ice restart.
RTCPeerConnection.addStream() - Web APIs
the obsolete rtcpeerconnection method addstream() adds a mediastream as a local source of audio or video.
... instead of using this obsolete method, you should instead use addtrack() once for each track you wish to send to the remote peer.
... navigator.mediadevices.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); pc.addstream(stream); }); migrating to addtrack() compatibility allowing, you should update your code to instead use the addtrack() method: navigator.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); stream.gettracks().foreach(function(track) { pc.addtrack(track, stream); }); }); the newer addtrack() api avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not).
RTCPeerConnection.getIdentityAssertion() - Web APIs
the rtcpeerconnection.getidentityassertion() method initiates the gathering of an identity assertion.
... the method returns immediately.
... syntax pc.getidentityassertion(); there is neither parameter nor return value for this method.
RTCPeerConnection.getStats() - Web APIs
the rtcpeerconnection method getstats() returns a promise which resolves with data providing statistics about either the overall connection or about the specified mediastreamtrack.
... exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following errors: invalidaccesserror there is no rtcrtpsender or rtcrtpreceiver whose track matches the specified selector, or selector matches more than one sender or receiver.
...check the browser compatibility table to verify the state of this method.
RTCPeerConnection.setLocalDescription() - Web APIs
the rtcpeerconnection method setlocaldescription() changes the local description associated with the connection.
...the method takes a single parameter—the session description—and it returns a promise which is fulfilled once the description has been changed, asynchronously.
... this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called.
RTCPeerConnection.setRemoteDescription() - Web APIs
the rtcpeerconnection method setremotedescription() sets the specified session description as the remote peer's current offer or answer.
...the method takes a single parameter—the session description—and it returns a promise which is fulfilled once the description has been changed, asynchronously.
... this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport.
... let startreport; async function networkteststart(pc) { if (pc) { startreport = await pc.getstats(); } } given an rtcpeerconnection, pc, this calls its getstats() method to obtain a statistics report object, which it stores in startreport for use once the end-of-test data has been collected by networkteststop().
...ize: ${bytessent} bytes.</div>`; statsbox.innerhtml += logentry; } else { statsbox.innerhtml += `<div class="stats-error">unable to find initial statistics for id ${endremoteoutbound.id}.</div>` } } statsbox.scrollto(0, statsbox.scrollheight); } } } here's what's going on in the networkteststop() function: after calling the rtcpeerconnection method getstats() to get the latest statistics report for the connection and storing it in endreport, this is an rtcstatsreport object, which maps strings taken from the rtcstatstype enumerated type to objects of the corresponding rtcstats-based type.
RTCRtpSender - Web APIs
methods rtcrtpsender.getparameters() returns a rtcrtpparameters object describing the current configuration for the encoding and transmission of media on the track.
...this method can be used, for example, to toggle between the front- and rear-facing cameras on a device.
... static methods rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the system's capabilities for sending a specified kind of media data.
Range.compareNode() - Web APIs
WebAPIRangecompareNode
warning: this method has been removed from gecko 1.9 (firefox 3) and will not exist in future versions of firefox, which was the only browser implementing it; you should switch to range.compareboundarypoints() as soon as possible.
... 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.
... specifications this method is not standard and therefore not part of any specification.
Range.setStart() - Web APIs
WebAPIRangesetStart
the range.setstart() method sets the start position of a range.
... examples highlight part of an element this example uses the range.setstart() and range.setend() methods to add part of an address to a range.
...const endoffset = 5; // end at fifth node: dodge city, ks const range = document.createrange(); range.setstart(address, startoffset); range.setend(address, endoffset); const mark = document.createelement('mark'); range.surroundcontents(mark); result get characters from a text node this example uses the range.setstart() and range.setend() methods to define the contents of a range.
ReadableStream - Web APIs
methods readablestream.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer.
... readablestream.tee() the tee method tees this readable stream, returning a two-element array containing the two resulting branches as new readablestream instances.
... readablestream[@@asynciterator]() alias of getiterator method.
RelativeOrientationSensor - Web APIs
properties no specific properties; inherits methods from its ancestors orientationsensor and sensor.
... event handlers no specific event handlers; inherits methods from its ancestor, sensor.
... methods no specific methods; inherits methods from its ancestors orientationsensor and sensor.
Reporting API - Web APIs
this method is not as failsafe as the report-to method described above — any page crash could stop you retrieving the reports — but it is easier to set up, and more flexible.
... methods are then available on the observer to start collecting reports (reportingobserver.observe()), retrieve the reports currently in the report queue (reportingobserver.takerecords()), and disconnect the observer so it can no longer collect records (reportingobserver.disconnect()).
... note: if you look at the complete source code, you'll notice that we actually call the deprecated getusermedia() method twice.
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.
... interface overview also implement none methods none properties readonly svgpointlist points readonly svgpointlist animatedpoints normative document svg 1.1 (2nd edition) properties name type description points svgpointlist provides access to the base (i.e., static) contents of the points attribute.
... methods the svganimatedpoints interface do not provide any specific methods.
SVGAnimationElement - Web APIs
methods this interface also inherits methods from its parent, svgelement.
...the behavior of this method is equivalent to beginelementat(0).
...the behavior of this method is equivalent to endelementat(0).
SVGTransform - Web APIs
interface overview also implement none methods void setmatrix(in svgmatrix matrix) void settranslate(in float tx, in float ty) void setscale(in float sx, in float sy) void setrotate(in float angle, in float cx, in float cy) void setskewx(in float angle) void setskewy(in float angle) properties readonly unsigned short type readonly float angle readonly svgmatrix ...
...in case the matrix object is changed directly (i.e., without using the methods on the svgtransform interface itself) then the type of the svgtransform changes to svg_transform_matrix.
... methods name & arguments return description setmatrix(in svgmatrix matrix) void sets the transform type to svg_transform_matrix, with parameter matrix defining the new transformation.
SVGTransformable - Web APIs
svg transformable interface interface svgtransformable contains properties and methods that apply to all elements which have attribute transform.
... interface overview also implement none methods none properties readonly svganimatedtransformlist transform normative document svg 1.1 (2nd edition) properties name type description transform svganimatedtransformlist corresponds to attribute transform on the given element.
... methods the svgtransformable interface do not provide any specific methods.
SVGViewElement - Web APIs
the svgviewelement interface provides access to the properties of <view> elements, as well as methods to manipulate them.
...each of the domstring values can be associated with the corresponding element using the getelementbyid() method call.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
Screen.lockOrientation() - Web APIs
the lockorientation() method of the screen interface locks the screen into a specified orientation.
... the screenorientation.lock() method should be used instead.
... note: this method only works for installed web apps or for web pages in full-screen mode.
Screen.unlockOrientation() - Web APIs
the screen.unlockorientation() method removes all the previous screen locks set by the page/app.
... the screenorientation.unlock() method should be used instead.
... note: this method only works for installed web apps or for web pages in full-screen mode.
Screen Wake Lock API - Web APIs
you acquire a wakelocksentinel object by calling the navigator.wakelock.request() promise based method that resolves if the platform allows it.
...it can also be released manually via the wakelocksentinel.release() method.
...the wakelock.request method is promise based and so we can create an asynchronous function, which in turn updates the ui to reflect the wake lock is active.
Selection.toString() - Web APIs
the selection.tostring() method returns a string currently being represented by the selection object, i.e.
... description this method returns the currently selected text.
... in javascript, this method is called automatically when a function the selection object is passed to requires a string: alert(window.getselection()) // what is called alert(window.getselection().tostring()) // what is actually being effectively called.
Selection API - Web APIs
concepts and usage to retrieve the current text range the user has selected, you can use the window.getselection() or document.getselection() method, storing the return value — a selection object — in a variable for futher use.
...rnet android full support yescontainsnode experimentalchrome full support yesedge full support 12firefox full support 4notes full support 4notes notes before firefox 35, the method didn't throw if node was null.ie no support noopera full support yessafari full support yeswebview android full support yeschrome android full support yesfirefox android ...
... full support 4notes full support 4notes notes before firefox 35, the method didn't throw if node was null.opera android full support yessafari ios full support yessamsung internet android full support yesdeletefromdocument experimentalchrome full support yesedge full support 12firefox full support 55ie ?
Sensor APIs - Web APIs
the examples below show three methods for detecting sensor apis.
...this interface cannot be used directly, instead it provides properties and methods accessed by interfaces that inherit from it.
...instead it provides properties, event handlers, and methods accessed by interfaces that inherit from it.
ServiceWorkerGlobalScope - Web APIs
additionally, synchronous requests are not allowed from within a service worker — only asynchronous requests, like those initiated via the fetch() method, can be used.
...controlled pages can use the messageport.postmessage() method to send messages to service workers.
... methods serviceworkerglobalscope.skipwaiting() allows the current service worker registration to progress from waiting to active state while service worker clients are using it.
SharedWorker - Web APIs
methods inherits methods from its parent, eventtarget, and implements methods from abstractworker.
...if the onmessage event is attached using addeventlistener, the port is manually started using its start() method: myworker.port.start(); when the port is started, both scripts post messages to the worker and handle messages sent from it using port.postmessage() and port.onmessage, respectively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.v...
...the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads.
SourceBuffer - Web APIs
sourcebuffer.onupdate fired whenever sourcebuffer.appendbuffer() method or the sourcebuffer.remove() completes.
... sourcebuffer.onupdateend fired whenever sourcebuffer.appendbuffer() method or the sourcebuffer.remove() has ended.
... methods inherits methods from its parent interface, eventtarget.
SpeechSynthesis - Web APIs
methods speechsynthesis also inherits methods from its parent interface, eventtarget.
... voiceschanged fired when the list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed.
... inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
StaticRange - Web APIs
the dom staticrange interface extends abstractrange to provide a method to specify a range of content in the dom whose contents don't update to reflect changes which occur within the dom tree.
... it offers the same set of properties and methods as abstractrange.
... methods staticrange.torange() returns a new range object which describes the same range as the source staticrange, but is "live" with values that change to reflect changes in the contents of the dom tree.
Streams API concepts - Web APIs
in javascript, this is achieved via the readablestream.tee() method — it outputs an array containing two identical copies of the original readable stream, which can then be read independently by two separate readers.
...there are two methods available in the spec to facilitate this: readablestream.pipethrough() — pipes the stream through a transform stream, which is a pair comprised of a writable stream that has data written to it, and a readable stream that then has the data read out of it — this acts as a kind of treadmill that constantly takes data in and transforms it to a new state.
... if later on the consumer again wants to receive data, we can use the pull method in the stream creation to tell our underlying source to feed our stream with data.
SubtleCrypto.deriveBits() - Web APIs
the derivebits() method of the subtlecrypto interface can be used to derive an array of bits from a base key.
... this method is very similar to subtlecrypto.derivekey(), except that derivekey() returns a cryptokey object rather than an arraybuffer.
... let salt; /* get some key material to use as input to the derivebits method.
SubtleCrypto.importKey() - Web APIs
the importkey() method of the subtlecrypto interface imports a key: that is, it takes as input a key in an external, portable format and gives you a cryptokey object that you can use in the web crypto api.
... the pkcs #8 format is defined in rfc 5208., using the asn.1 notation: privatekeyinfo ::= sequence { version version, privatekeyalgorithm privatekeyalgorithmidentifier, privatekey privatekey, attributes [0] implicit attributes optional } the importkey() method expects to receive this object as an arraybuffer containing the der-encoded form of the privatekeyinfo.
... subjectpublickey is defined in rfc 5280, section 4.1 using the asn.1 notation: subjectpublickeyinfo ::= sequence { algorithm algorithmidentifier, subjectpublickey bit string } just like pkcs #8, the importkey() method expects to receive this object as an arraybuffer containing the der-encoded form of the subjectpublickeyinfo.
TransitionEvent.initTransitionEvent() - Web APIs
the transitionevent.inittransitionevent() method initializes a transition event created using the deprecated document.createevent("transitionevent") method.
... note: this method has been dropped during the standard process.
... specifications this method is non-standard and not part of any specification, though it was present in early drafts of css transitions.
URL.revokeObjectURL() - Web APIs
the url.revokeobjecturl() static method releases an existing object url which was previously created by calling url.createobjecturl().
... call this method when you've finished using an object url to let the browser know not to keep the reference to the file any longer.
... note: this method is not available from service workers, due to issues with the blob interface's life cycle and the potential for leaks.
URLSearchParams.set() - Web APIs
the set() method of the urlsearchparams interface sets the value associated with a given search parameter to the given value.
... if there were several matching values, this method deletes the others.
... if the search parameter doesn't exist, this method creates it.
WEBGL_debug_shaders - Web APIs
the webgl_debug_shaders extension is part of the webgl api and exposes a method to debug shaders from privileged contexts.
... webgl extensions are available using the webglrenderingcontext.getextension() method.
... methods webgl_debug_shaders.gettranslatedshadersource() returns the translated shader source.
WEBGL_draw_buffers.drawBuffersWEBGL() - Web APIs
the webgl_draw_buffers.drawbufferswebgl() method is part of the webgl api and allows you to define the draw buffers to which all fragment colors are written.
... this method is part of the webgl_draw_buffers extension.
... note: when using webgl2, this method is available as gl.drawbuffers() by default and the constants are named gl.color_attachment1 etc.
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
the webgl2renderingcontext.uniform[1234][uif][v]() methods of the webgl api specify values of uniform variables.
...possible types: a number for unsigned integer values (methods with ui), for integer values (methods with i), or for floats (methods with f).
... a uint32array for unsigned integer vector methods (methods with uiv).
WebGLRenderingContext.clear() - Web APIs
the webglrenderingcontext.clear() method of the webgl api clears buffers to preset values.
... the scissor box, dithering, and buffer writemasks can affect the clear() method.
... examples the clear() method accepts multiple values.
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
the webglrenderingcontext.compressedteximage2d() and webgl2renderingcontext.compressedteximage3d() methods of the webgl api specify a two- or three-dimensional texture image in a compressed format.
... compressed image formats must be enabled by webgl extensions before using these methods.
...compressed image formats must be enabled by webgl extensions before using this method.
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
the webglrenderingcontext.compressedtexsubimage2d() method of the webgl api specifies a two-dimensional sub-rectangle for a texture image in a compressed format.
... compressed image formats must be enabled by webgl extensions before using this method or a webgl2renderingcontext must be used.
...compressed image formats must be enabled by webgl extensions before using this method.
WebGLRenderingContext.getContextAttributes() - Web APIs
the webglrenderingcontext.getcontextattributes() method returns a webglcontextattributes object that contains the actual context parameters.
... examples given this <canvas> element <canvas id="canvas"></canvas> and given this webgl context var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getcontextattributes(); the getcontextattributes method returns an object that describes the attributes set on this context, for example: { alpha: true, antialias: true, depth: true, failifmajorperformancecaveat: false, powerpreference: "default", premultipliedalpha: true, preservedrawingbuffer: false, stencil: false, desynchronized: false } the context attributes can be set when creating the context using the htmlcanvaselement.get...
...context() method: canvas.getcontext('webgl', { antialias: false, depth: false }); see getcontext() for more information about the individual attributes.
WebGLRenderingContext.makeXRCompatible() - Web APIs
the webglrenderingcontext method makexrcompatible() ensures that the rendering context described by the webglrenderingcontext is ready to render the scene for the immersive webxr device on which it will be displayed.
... exceptions this method doesn't throw traditional exceptions; instead, the promise rejects with one of the following errors as the value passed into the rejection handler: aborterror switching the context over to the webxr-compatible context failed.
... while this method is available through the webglrenderingcontext interface, it's actually defined by the webxr device api rather than by webgl.
WebRTC connectivity - Web APIs
see the individual articles on these properties and methods for more specifics, and codecs used by webrtc for information about codecs supported by webrtc and which are compatible with which browsers.
...this is known as an ice candidate and details the available methods the peer is able to communicate (directly or through a turn server).
...this candidate should still be added to the connection using addicecandidate() method, as usual, in order to deliver that notification to the remote peer.
Taking still photos with WebRTC - Web APIs
video.setattribute('width', width); video.setattribute('height', height); canvas.setattribute('width', width); canvas.setattribute('height', height); streaming = true; } }, false); this callback does nothing unless it's the first time it's been called; this is tested by looking at the value of our streaming variable, which is false the first time this method is run.
... handle clicks on the button to capture a still photo each time the user clicks the startbutton, we need to add an event listener to the button, to be called when the click event is issued: startbutton.addeventlistener('click', function(ev){ takepicture(); ev.preventdefault(); }, false); this method is simple enough: it just calls our takepicture() function, defined below in the section capturing a frame from the stream, then calls event.preventdefault() on the received event to prevent the click from being handled more than once.
... wrapping up the startup() method there are only two more lines of code in the startup() method: clearphoto(); } this is where we call the clearphoto() method we'll describe below in the section clearing the photo box.
WebSocket.close() - Web APIs
WebAPIWebSocketclose
the websocket.close() method closes the websocket connection or connection attempt, if any.
... if the connection is already closed, this method does nothing.
... note: in gecko, this method didn't support any parameters prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5).
Writing WebSocket client applications - Web APIs
to do this, simply call the websocket object's send() method for each message you want to send: examplesocket.send("here's some text that the server is urgently awaiting!"); you can send data as a string, blob, or arraybuffer.
... as establishing a connection is asynchronous and prone to failure there is no guarantee that calling the send() method immediately after creating a websocket object will be successful.
... closing the connection when you've finished using the websocket connection, call the websocket method close(): examplesocket.close(); it may be helpful to examine the socket's bufferedamount attribute before attempting to close the connection to determine if any data has yet to be transmitted on the network.
Writing a WebSocket server in Java - Web APIs
l.regex.matcher; import java.util.regex.pattern; public class websocket { public static void main(string[] args) throws ioexception, nosuchalgorithmexception { serversocket server = new serversocket(80); try { system.out.println("server has started on 127.0.0.1:80.\r\nwaiting for a connection..."); socket client = server.accept(); system.out.println("a client connected."); socket methods: java.net.socket getinputstream() returns an input stream for this socket.
... outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off to this output stream.
... inputstream methods: read(byte[] b, int off, int len) reads up to len bytes of data from the input stream into an array of bytes.
Web Video Text Tracks Format (WebVTT) - Web APIs
e 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 the cue or region as the attributes for both interfaces are different.
... we can categorize them for better understanding relating to each interface in webvtt: vttcue the methods which are available in this interface are: getcueashtml to get the html of that cue.
... vttregion the methods used for region are listed below along with description of their functionality: scrollsetting: for adjusting the scrolling setting of all nodes present in given region.
Movement, orientation, and motion: A WebXR example - Web APIs
if we already have an ongoing session, on the other hand, we call its end() method to stop the session.
... sessionstarted() finishes up by calling the session's requestreferencespace() method to get a reference space object describing the space in which the object is being created.
...the displaymatrix() method is used for this; this function uses mathml to render the matrix, falling back to a more array-like format if mathml isn't supported by the user's browser.
Web Locks API - Web APIs
the request() method itself returns a promise which resolves once the lock has been released; within an async function, a script can await the call to make the asynchronous code flow linear.
... monitoring the navigator.locks.query() method can be used by scripts to introspect the state of the lock manager for the origin.
... lockmanager provides methods for requesting a new lock object and querying for an existing lock object.
Using the Web Storage API - Web APIs
you can access these values like an object, or with the storage.getitem() and storage.setitem() methods.
... testing whether your storage has been populated to start with, in main.js, we test whether the storage object has already been populated (i.e., the page was previously accessed): if(!localstorage.getitem('bgcolor')) { populatestorage(); } else { setstyles(); } the storage.getitem() method is used to get a data item from storage; in this case, we are testing to see whether the bgcolor item exists; if not, we run populatestorage() to add the existing customization values to the storage.
... deleting data records web storage also provides a couple of simple methods to remove data.
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.
... data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message event's data property).
... web worker interfaces abstractworker abstracts properties and methods common to all kind of workers (i.e.
Window.back() - Web APIs
WebAPIWindowback
the obsolete and non-standard method back() on the window interface returns the window to the previous item in the history.
... this was a firefox-specific method and was removed in firefox 31.
... note: use the standard history.back method instead.
Window: beforeunload event - Web APIs
however note that not all browsers support this method, and some instead require the event handler to implement one of two legacy methods: assigning a string to the event's returnvalue property returning a string from the event handler.
... the html specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event.
... examples the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue.
Window.captureEvents() - Web APIs
the window.captureevents() method registers the window to capture all events of the specified type.
... when you call the captureevents() method on the window, events of the type you specify (for example, event.click) no longer pass through to "lower" objects in the hierarchy.
... note that you can pass a list of events to this method using the following syntax: window.captureevents(event.keypress | event.keydown | event.keyup).
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.
... please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses).
... specifications this method was specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3.
Window.crypto - Web APIs
WebAPIWindowcrypto
although the property itself is read-only, all of its methods (and the methods of its child object, subtlecrypto) are not read-only, and therefore vulnerable to attack by polyfill.
... although window.crypto is available on all windows, the returned crypto object only has one usable feature in insecure contexts: the getrandomvalues() method.
... example this example uses the window.crypto property to access the getrandomvalues() method.
window.postMessage() - Web APIs
the window.postmessage() method safely enables cross-origin communication between window objects; e.g., between a page and a pop-up that it spawned, or between a page and an iframe embedded within it.
...methods for obtaining such a reference include: window.open (to spawn a new window and then reference it), window.opener (to reference the window that spawned this one), htmliframeelement.contentwindow (to reference an embedded <iframe> from its parent window), window.parent (to reference the parent window from within an embedded <iframe>), or window.frames + an index value (named or numeric...
... the secret response " + "is: rheeeeet!", event.origin); } window.addeventlistener("message", receivemessage, false); notes any window may access this method on any other window, at any time, regardless of the location of the document in the window, to send it a message.
Window.requestFileSystem() - Web APIs
the non-standard window method requestfilesystem() method is a google chrome-specific method which lets a web site or app gain access to a sandboxed file system for its own use.
...do not use this method!
... syntax this method is prefixed with webkit in all browsers that implement it (that is, google chrome).
WindowOrWorkerGlobalScope.btoa() - Web APIs
the windoworworkerglobalscope.btoa() method creates a base64-encoded ascii string from a binary string (i.e., a string object in which each character in the string is treated as a byte of binary data).
... you can use this method to encode data which may otherwise cause communication problems, transmit it, then use the atob() method to decode the data again.
... living standard method moved to the windoworworkerglobalscope mixin in the latest spec.
WritableStream - Web APIs
methods writablestream.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
...inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
... the promise returned by the sink's write() method (line 40) tells the writablestream and its writer when to resolve defaultwriter.ready.
XDomainRequest.open() - Web APIs
opens an xdomainrequest which is configured to use a given method (get/post) and url.
... syntax xdr.open(method, url); parameters method the http method to use for the request.
... example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); specification not part of any specification.
HTML in XMLHttpRequest - Web APIs
var xhr = new xmlhttprequest(); xhr.onload = function() { console.log(this.responsexml.title); } xhr.open("get", "file.html"); xhr.responsetype = "document"; xhr.send(); feature detection method 1 this method relies on the "force async" nature of the feature.
... function htmlinxhr() { if (!window.xmlhttprequest) return false; var req = new window.xmlhttprequest(); req.open('get', window.location.href, false); try { req.responsetype = 'document'; } catch(e) { return true; } return false; } view on jsfiddle this method is synchronous, does not rely on external assets though it may not be as reliable as method 2 described below since it does not check the actual feature but an indication of that feature.
... method 2 there are two challenges to detecting exactly if a browser supports html parsing in xmlhttprequest.
XMLHttpRequest.getResponseHeader() - Web APIs
the xmlhttprequest method getresponseheader() returns the string containing the text of a particular header's value.
...the getresponseheader() method returns the value as a utf byte sequence.
... if you need to get the raw string of all of the headers, use the getallresponseheaders() method, which returns the entire raw header string.
XMLHttpRequest.readyState - Web APIs
unsent the xmlhttprequest client has been created, but the open() method hasn't been called yet.
... opened open() method has been invoked.
... during this state, the request headers can be set using the setrequestheader() method and the send() method can be called which will initiate the fetch.
XPathEvaluator.evaluate() - Web APIs
the evaluate() method of the xpathevaluator interface executes an xpath expression on the given node or document and returns an xpathresult.
... result optional allows to specify a result object which may be reused and returned by this method.
... example the following example shows the use of the evaluate() method.
XPathExpression.evaluate() - Web APIs
the evaluate() method of the xpathexpression interface executes an xpath expression on the given node or document and returns an xpathresult.
... result optional allows to specify a result object which may be reused and returned by this method.
... example the following example shows the use of the evaluate() method.
XRFrame - Web APIs
WebAPIXRFrame
in addition to providing a reference to the xrsession for which this frame is to be rendered, the getviewerpose() method is provided to obtain the xrviewerpose describing the viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another.
...the information about a specific object can be obtained by calling one of the methods on the object.
... methods getpose() returns an xrpose object representing the spatial relationship between the two specified xrspace objects.
XRInputSource - Web APIs
targetraymoderead only a domstring indicating the methodology used to produce the target ray: gaze, tracked-pointer, or screen.
...this space is established using the method defined by targetraymode.
... methods the xrinputsource interface defines no methods.
XRInputSourceArray.entries() - Web APIs
the xrinputsourcearray interface's entries() method returns a javascript iterator which can then be used to iterate over the key/value pairs in the input source array.
...in hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } } for each input in the llist, gamepad inputs are dispatched to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method.
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourceArray.forEach() - Web APIs
the xrinputsourcearray method foreach() executes the specified callback once for each input source in the array, starting at index 0 and progressing until the end of the list.
...troller */ handlemainhandinput(input); } else { /* handle other inputs */ } } }); for each input in the llist, the callback dispatches gamepad inputs to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method.
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourceArray - Web APIs
in addition to being able to access the input sources in the list using standard array notation (that is, with index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available.
... methods the following methods are available on xrinputsourcearray objects.
... in addition to these methods, you may use array notation to access items in the list by index for example, the snippet of code below calls a function handleinput(), passing into it the first item in the input source list, if the list isn't empty.
XRInputSourceEventInit.frame - Web APIs
the xrinputsourceeventinit dictionary's property frame specifies an xrframe providing information about the timestamp at which the new input source event took place, as well as access to the xrframe method getpose() which can be used to map the coordinates of any xrreferencespace to the space in which the event took place.
... syntax xrinputsourceeventinit.frame = xrframe; let xrinputsourceeventinit = { frame: xrframe }; let xrinputsourceevent = new xrinputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and providing a getpose() method which can be used to map reference spaces to the world reference space.
...instead, the xrframe specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred.
XRSession.updateRenderState() - Web APIs
the updaterenderstate() method of the xrsession interface of webxr api schedules changes to be applied to the active render state prior to rendering of the next frame.
... exceptions this method may throw any of the following exceptions.
... these are true exceptions, since this method does not return a promise.
XSLTProcessor - Web APIs
it has methods to load the xslt stylesheet, to manipulate <xsl:param> parameter values, and to apply the transformation to documents.
... new xsltprocessor() methods [throws] void xsltprocessor.importstylesheet(node stylesheet) imports the xslt stylesheet.
... the resultant object depends on the output method of the stylesheet: output method result type html htmldocument xml xmldocument text xmldocument with a single root element <transformiix:result> with the text as a child [throws] void xsltprocessor.setparameter(string namespaceuri, string localname, any value) sets a parameter in the xslt stylesheet that was impo...
msPutPropertyEnabled - Web APIs
the msputpropertyenabled method sets whether a given property in the style object is enabled or disabled.
... this proprietary method is specific to internet explorer and microsoft edge.
... return value type = hresult: if this method succeeds, it returns s_ok.
ARIA Test Cases - Accessibility
optional but desired: at should provide simple method to navigate only among the current drop targets.
... markup used: aria-label="my something-or-other" notes: if the screen reader simply uses the accessible name property it should get the correct text to speak, even if several methods (aria-label, aria-labelledby, alt, label for, descendant text, title, etc.) are used.
... markup used: aria-labelledby notes: if the screen reader simply uses the accessible name property it should get the correct text to speak, even if several methods (aria-label, aria-labelledby, alt, label for, descendant text, title, etc.) are used.
Alerts - Accessibility
here is a simple form: <form method="post" action="post.php"> <fieldset> <legend>please enter your contact details</legend> <label for="name">your name (required):</label> <input name="name" id="name" aria-required="true"/> <br /> <label for="email">e-mail address (required):</label> <input name="email" id="email" aria-required="true"/> <br /> <label for="website">website (optional):</labe...
...d(newalert); } function checkvalidity(aid, asearchterm, amsg) { var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); addalert(amsg); } else { elem.setattribute("aria-invalid", "false"); removeoldalert(); } } </script> the checkvalidity function the primary method in javascript used for form validation is the checkvalidity function.
... this method takes three parameters: the id of the input that is to be validated, the term to search for to ensure validity, and the error message to be inserted into the alert.
Color picker tool - CSS: Cascading Style Sheets
this.r = obj.r; this.g = obj.g; this.b = obj.b; this.a = obj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; color.prototype.setformat = function setformat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format = 'hsl'; }; /*========== methods to set color properties ==========*/ color.prototype.isvalidrgbvalue = function isvalidrgbvalue(value) { return (typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.prototype.setrgba = function setrgba(red, green, blue, alpha) { if (this.isvalidrgbvalue(red) === false || this.isvalidrgbvalue(green) === false || this.isvalidrgbvalue(blue...
...valid !== true) return; if (value[0] === '#') value = value.slice(1, value.length); if (value.length === 3) value = value.replace(/([0-9a-f])([0-9a-f])([0-9a-f])/i,'$1$1$2$2$3$3'); this.r = parseint(value.substr(0, 2), 16); this.g = parseint(value.substr(2, 2), 16); this.b = parseint(value.substr(4, 2), 16); this.alpha = 1; this.rgbtohsv(); }; /*========== conversion methods ==========*/ color.prototype.converttohsl = function converttohsl() { if (this.format === 'hsl') return; this.setformat('hsl'); this.rgbtohsl(); }; color.prototype.converttohsv = function converttohsv() { if (this.format === 'hsv') return; this.setformat('hsv'); this.rgbtohsv(); }; /*========== update methods ==========*/ color.prototype.updatergb = function updater...
...lta) { if (cmax === red ) { hue = ((green - blue) / delta); } if (cmax === green ) { hue = 2 + (blue - red) / delta; } if (cmax === blue ) { hue = 4 + (red - green) / delta; } if (cmax) saturation = delta / x; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.lightness = (lightness * 100) | 0; }; /*========== get methods ==========*/ color.prototype.gethexa = function gethexa() { var r = this.r.tostring(16); var g = this.g.tostring(16); var b = this.b.tostring(16); if (this.r < 16) r = '0' + r; if (this.g < 16) g = '0' + g; if (this.b < 16) b = '0' + b; var value = '#' + r + g + b; return value.touppercase(); }; color.prototype.getrgba = function getrgba() { var rgb = '(' + this.r + ', ' ...
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
this specification details how alignment should work in all the different layout methods.
... layout methods will conform to the specification where possible and implement individual behavior based on their differences (features and constraints).
... while the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the css grid layout method has been widely adopted.
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.
...to do this, use the window.matchmedia method.
...to do this, call the addlistener() method on the mediaquerylist object, with a callback function to invoke when the media query status changes (e.g., the media query test goes from true to false): // create the query list.
Creating and triggering events - Developer guides
elem.dispatchevent(event); the above code example uses the eventtarget.dispatchevent() method.
...ueryselector('form'); const textarea = document.queryselector('textarea'); // create a new event, allow bubbling, and provide any data you want to pass to the "detail" property const eventawesome = new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } }); // the form element listens for the custom "awesome" event and then consoles the output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the form dispatches/triggers the event to fire, and uses itself as the starting point textarea.addeventlistener('input', e => e.target.dispatchevent(eventawesome)); creating and dispatching events dynamically elements can listen for events that haven't been created yet: <form> <te...
...onally, 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.
Media events - Developer guides
emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
... play sent when the playback state is no longer paused, as a result of the play method, or the autoplay attribute.
... the listener simply calls the element's play() method, which starts playback.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
formmethod html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), this attribute specifies the http method used to submit the form.
...use this method when the form has no side effects, like search forms.
... if specified, this attribute overrides the method attribute of the button's form owner.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
usage notes <form> elements can close a dialog if they have the attribute method="dialog".
... html <!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button value="cancel">cancel</button> <button id="confirmbtn" value="default">confirm</button> </menu> </form> </dialog> <menu> <button id=...
...open() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() { outputbox.value = favdialog.returnvalue + " button clicked - " + (new date()).tostring(); }); result specifications specification status comment html living standardthe definition of '<dialog>' in that specification.
<input type="datetime-local"> - HTML: Hypertext Markup Language
methods select(), stepdown(), stepup() value a domstring representing the value of the date entered into the input.
... you can also get and set the date value in javascript using the htmlinputelement.value property, for example: var datecontrol = document.queryselector('input[type="datetime-local"]'); datecontrol.value = '2017-06-01t08:30'; there are several methods provided by javascript's date that can be used to convert numeric date information into a properly-formatted string, or you can do it manually.
... for example, the date.toisostring() method can be used for this purpose.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
events change and input supported common attributes autocomplete, list, max, min, and step idl attributes list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; however, the following forms of automatic validation are performed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input.
... note: the following input attributes do not apply to the input range: accept, alt, checked, dirname, formaction, formenctype, formmethod, formnovalidate, formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, required, size, src, and width.
... in the meantime, we can make the range vertical by rotating it using using css transforms, or, by targeting each browser engine with their own method, which includes setting the appearance to slider-vertical, by using a non-standard orient attribute in firefox, or by changing the text direction for internet explorer and edge.
Evolution of HTTP - HTTP
http/0.9 is extremely simple: requests consist of a single line and start with the only possible method get followed by the path to the resource (not the url as both the protocol, server, and port are unnecessary once connected to the server).
... more than 15 years of extensions thanks to its extensibility – creating new headers or methods is easy – and even if the http/1.1 protocol was refined over two revisions, rfc 2616 published in june 1999 and the series of rfc 7230-rfc 7235 published in june 2014 in prevision of the release of http/2, this protocol has been extremely stable over more than 15 years.
...the actions induced by the api were no more conveyed by new http methods, but only by accessing specific uris with basic http/1.1 methods.
MIME types (IANA media types) - HTTP
with the exception of multipart/form-data, used in the post method of html forms, and multipart/byteranges, used with 206 partial content to send part of a document, http doesn't handle multipart documents in a special way: the message is transmitted to the browser (which will likely show a "save as" window if it doesn't know how to display the document).
...boundary=aboundarystring (other headers associated with the multipart document as a whole) --aboundarystring content-disposition: form-data; name="myfile"; filename="img.jpg" content-type: image/jpeg (data) --aboundarystring content-disposition: form-data; name="myfield" (data) --aboundarystring (more subparts) --aboundarystring-- the following <form>: <form action="http://localhost:8000/" method="post" enctype="multipart/form-data"> <label>name: <input name="mytextfield" value="test"></label> <label><input type="checkbox" name="mycheckbox"> check</label> <label>upload file: <input type="file" name="myfile" value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os...
... other methods of conveying document type mime types are not the only way to convey document type information: filename suffixes are sometimes used, especially on microsoft windows.
Browser detection using the user agent - HTTP
the boxes can be separated into multiple columns via two equally fair method.
...the first method uses horizontal flexboxes to group the content such that when the page is displayed to the end user, all the dogs boxes are at the top of the page and all the cat boxes are lower on the page.
... the second method uses a column layout and resents all the dogs to the left and all the cats to the right.
HTTP caching - HTTP
WebHTTPCaching
however, common http caches are typically limited to caching responses to get and may decline other methods.
... the primary cache key consists of the request method and target uri (oftentimes only the uri is used as only get requests are caching targets).
...in order to have the new versions, all the links to them must be changed, that is the drawback of this method: additional complexity that is usually taken care of by the tool chain used by web developers.
CSP: form-action - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... <meta http-equiv="content-security-policy" content="form-action 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> // error: refused to send form data because it violates the following // content security policy directive: "form-action 'none'".
CSP: navigate-to - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
... <meta http-equiv="content-security-policy" content="navigate-to 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> specifications specification status comment content security policy level 3the definition of 'navigate-to' in that specification.
Large-Allocation - HTTP
this error is displayed when loading a document with a large-allocation header with a non-get http method.
... the document with the large-allocation header was loaded in a window which was opened by window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set.
... the document with the large-allocation header has opened another window with window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set.
HTTP Messages - HTTP
WebHTTPMessages
their start-line contain three elements: an http method, a verb (like get, put or post) or a noun (like head or options), that describes the action to be performed.
...the format of this request target varies between different http methods.
...this is the most common form, known as the origin form, and is used with get, post, head, and options methods.
CONNECT - HTTP
WebHTTPMethodsCONNECT
the http connect method starts two-way communications with the requested resource.
... for example, the connect method can be used to access websites that use ssl (https).
... connect is a hop-by-hop method.
PATCH - HTTP
WebHTTPMethodsPATCH
the http patch request method applies partial modifications to a resource.
... to find out whether a server supports patch, a server can advertise its support by adding it to the list in the allow or access-control-allow-methods (for cors) response headers.
... http/1.1 204 no content content-location: /file.txt etag: "e0023aa4f" specifications specification title rfc 5789: patch patch method for http ...
POST - HTTP
WebHTTPMethodsPOST
the http post method sends data to the server.
... text/plain when the post request is sent via a method other than an html form — like via an xmlhttprequest — the body can take any type.
... as described in the http 1.1 specification, post is designed to allow a uniform method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; adding a new user through a signup modal; providing a block of data, such as the result of submitting a form, to a data-handling process; extending a database through an append operation.
An overview of HTTP - HTTP
WebHTTPOverview
cache or authentication methods were functions handled early in http history.
... requests an example http request: requests consists of the following elements: an http method, usually a verb like get, post or a noun like options or head that defines the operation the client wants to perform.
... or a body, for some methods like post, similar to those in responses, which contain the resource sent.
501 Not Implemented - HTTP
WebHTTPStatus501
501 is the appropriate response when the server does not recognize the request method and is incapable of supporting it for any resource.
... the only methods that servers are required to support (and therefore that must not return 501) are get and head.
... if the server does recognize the method, but intentionally does not support it, the appropriate response is 405 method not allowed.
Expressions and operators - JavaScript
to actually manipulate the array, use the various array methods such as splice.
...ber or string, the typeof operator returns the following results: typeof 62; // returns "number" typeof 'hello world'; // returns "string" for property values, the typeof operator returns the type of value the property contains: typeof document.lastmodified; // returns "string" typeof window.length; // returns "number" typeof math.ln2; // returns "number" for methods and functions, the typeof operator returns results as follows: typeof blur; // returns "function" typeof eval; // returns "function" typeof parseint; // returns "function" typeof shape.split; // returns "function" for predefined objects, the typeof operator returns results as follows: typeof date; // returns "function" typeof function; // returns "function" typeof math; ...
...in general, this refers to the calling object in a method.
Keyed collections - JavaScript
one difference to map objects is that weakmap keys are not enumerable (i.e., there is no method giving you a list of the keys).
...the private data and methods belong inside the object and are stored in the privates weakmap object.
... const privates = new weakmap(); function public() { const me = { // private data goes here }; privates.set(this, me); } public.prototype.method = function () { const me = privates.get(this); // do stuff with private data in `me`...
TypeError: 'x' is not iterable - JavaScript
function* generate(a, b) { yield a; yield b; } for (let x of generate(1,2)) console.log(x); iterating over a custom iterable custom iterables can be created by implementing the symbol.iterator method.
... you must be certain that your iterator method returns an object which is an iterator, which is to say it must have a next method.
... const myemptyiterable = { [symbol.iterator]() { return [] // [] is iterable, but it is not an iterator -- it has no next method.
The arguments object - JavaScript
note: “array-like” means that arguments has a length property and properties indexed from zero, but it doesn't have array's built-in methods like foreach() or map().
...for example, it does not have the pop() method.
... however, it can be converted to a real array: var args = array.prototype.slice.call(arguments); // using an array literal is shorter than above but allocates an empty array var args = [].slice.call(arguments); as you can do with any array-like object, you can use es2015's array.from() method or spread syntax to convert arguments to a real array: let args = array.from(arguments); // or let args = [...arguments]; the arguments object is useful for functions called with more arguments than they are formally declared to accept.
Rest parameters - JavaScript
formally defined in function expression), while the arguments object contains all arguments passed to the function; the arguments object is not a real array, while rest parameters are array instances, meaning methods like sort, map, foreach or pop can be applied on it directly; the arguments object has additional functionality specific to itself (like the callee property).
...each one of them is then multiplied by the first parameter, and the array is returned: function multiply(multiplier, ...theargs) { return theargs.map(element => { return multiplier * element }) } let arr = multiply(2, 1, 2, 3) console.log(arr) // [2, 4, 6] use with the arguments object array methods can be used on rest parameters, but not on the arguments object: function sortrestargs(...theargs) { let sortedargs = theargs.sort() return sortedargs } console.log(sortrestargs(5, 3, 7, 1)) // 1, 3, 5, 7 function sortarguments() { let sortedargs = arguments.sort() return sortedargs // this will never happen } console.log(sortarguments(5, 3, 7, 1)) // throws a typeerror (arguments.
...sort is not a function) to use array methods on the arguments object, it must be converted to a real array first.
Array.prototype[@@unscopables] - JavaScript
however, in ecmascript 2015 and later, the array.prototype.keys() method was introduced.
... that means that inside with environments, "keys" would now be the method and not the variable.
... this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being scoped into the with statement.
Array.prototype.reduce() - JavaScript
the reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value.
... description the reduce() method executes the callback once for each assigned value present in the array, taking four arguments: accumulator currentvalue currentindex array the first time the callback is called, accumulator and currentvalue can be one of two values.
... return value; } }); } caution: if you need to support truly obsolete javascript engines that do not support object.defineproperty(), it is best not to polyfill array.prototype methods at all, as you cannot make them non-enumerable.
Array.prototype.fill() - JavaScript
the fill() method changes all elements in an array to a static value, from a start index (default 0) to an end index (default array.length).
... fill is a mutator method: it will change the array itself and return it, not a copy of it.
... return o; } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
Array.prototype.flatMap() - JavaScript
the flatmap() method first maps each element using a mapping function, then flattens the result into a new array.
... it is identical to a map() followed by a flat() of depth 1, but flatmap() is often quite useful, as merging both into one method is slightly more efficient.
...the flatmap method is identical to a map followed by a call to flat of depth 1.
Array.prototype.includes() - JavaScript
the includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate.
... // array length is 3 // fromindex is -100 // computed index is 3 + (-100) = -97 let arr = ['a', 'b', 'c'] arr.includes('a', -100) // true arr.includes('b', -100) // true arr.includes('c', -100) // true arr.includes('a', -2) // false includes() used as a generic method includes() method is intentionally generic.
... the example below illustrates includes() method called on the function's arguments object.
Array.prototype.lastIndexOf() - JavaScript
the lastindexof() method returns the last index at which a given element can be found in the array, or -1 if it is not present.
... description lastindexof compares searchelement to elements of the array using strict equality (the same method used by the ===, or triple-equals, operator).
...this is different from the indexof method.
Array.prototype.reverse() - JavaScript
the reverse() method reverses an array in place.
... description the reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array.
... reverse is intentionally generic; this method can be called or applied to objects resembling arrays.
Array.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the array.
... description the tosource method returns the following values: for the built-in array object, tosource returns the following string indicating that the source code is not available: function array() { [native code] } for instances of array, tosource returns a string representing the source code.
... this method is usually called internally by javascript and not explicitly in code.
BigInt64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... static methods bigint64array.from() creates a new bigint64array from an array-like or iterable object.
... instance methods bigint64array.prototype.copywithin() copies a sequence of array elements within the array.
BigUint64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... static methods biguint64array.from() creates a new biguint64array from an array-like or iterable object.
... instance methods biguint64array.prototype.copywithin() copies a sequence of array elements within the array.
Boolean.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a boolean object.
... syntax bool.valueof() return value the primitive value of the given boolean object description the valueof() method of boolean returns the primitive value of a boolean object or literal boolean as a boolean data type.
... this method is usually called internally by javascript and not explicitly in code.
Boolean - JavaScript
instance methods boolean.prototype.tostring() returns a string of either true or false depending upon the value of the object.
... overrides the object.prototype.tostring() method.
...overrides the object.prototype.valueof() method.
Date.prototype.getTime() - JavaScript
the gettime() method returns the number of milliseconds* since the unix epoch.
... you can use this method to help assign a date and time to another date object.
... this method is functionally equivalent to the valueof() method.
Date.prototype.getUTCMilliseconds() - JavaScript
the getutcmilliseconds() method returns the milliseconds portion of the time object's value.
... this method is a companion to the other utc based methods that give hour portion, minute portion, etc.; this method gives milliseconds portion.
... to get total milliseconds since 1970/01/01, use the method ".gettime()".
Date.prototype.getYear() - JavaScript
the getyear() method returns the year in the specified date according to local time.
... because getyear() does not return full years ("year 2000 problem"), it is no longer used and has been replaced by the getfullyear() method.
... backward compatibility behavior in javascript 1.2 and earlier the getyear() method returns either a 2-digit or 4-digit year: for years between and including 1900 and 1999, the value returned by getyear() is the year minus 1900.
Date.now() - JavaScript
the static date.now() method returns the number of milliseconds elapsed since january 1, 1970 00:00:00 utc.
... polyfill this method was standardized in ecma-262 5th edition.
... engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings.
Date.prototype.setMonth() - JavaScript
the setmonth() method sets the month for a specified date according to the currently set year.
... description if you do not specify the dayvalue parameter, the value returned from the getdate() method is used.
... the current day of month will have an impact on the behaviour of this method.
Date.prototype.toDateString() - JavaScript
the todatestring() method returns the date portion of a date object in english in the following format separated by spaces: first three letters of the week day name first three letters of the month name two digit day of the month, padded on the left a zero if necessary four digit year (at least), padded on the left with zeros if necessary e.g.
...sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimestring() method.
... the todatestring() method is especially useful because compliant engines implementing ecma-262 may differ in the string obtained from tostring() for date objects, as the format is implementation-dependent and simple string slicing approaches may not produce consistent results across multiple engines.
Date.prototype.toISOString() - JavaScript
the toisostring() method returns a string in simplified extended iso format (iso 8601), which is always 24 or 27 characters long (yyyy-mm-ddthh:mm:ss.sssz or ±yyyyyy-mm-ddthh:mm:ss.sssz, respectively).
... polyfill this method was standardized in ecma-262 5th edition.
... engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.prototype.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.prototype.toisostring = function() { return this.getutcfullyear() + '-' + pad(this.getutcmonth() + 1) + '-' + pad(this.getutcdate()) + 't' + pad(this.getutchours()) + ':' + pad(this.getutcminutes()) + ':' + pad(this.getutcseconds()) + '.' + (this.getutcmilliseconds() / 1000).tofixed(3).slice(2, 5) + 'z'; }; })(); } examples using toisostring() let today = new date('05 october 2011 14:48 utc') console.log(today.toisostri...
Date.prototype.toTimeString() - JavaScript
the totimestring() method returns the time portion of a date object in human readable form in american english.
...sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimestring() method.
... the totimestring() method is especially useful because compliant engines implementing ecma-262 may differ in the string obtained from tostring() for date objects, as the format is implementation-dependent; simple string slicing approaches may not produce consistent results across multiple engines.
Error.prototype.toSource() - JavaScript
the tosource() method returns code that could eval to the same error.
... examples using tosource calling the tosource method of an error instance (including nativeerrors) will return a string containing the source code of the error.
... note: be aware that the properties used by the tosource method in the creation of this string are mutable and may not accurately reflect the function used to create an error instance or the filename or line number where the actual error occurred.
FinalizationRegistry.prototype.unregister() - JavaScript
syntax registry.unregister(unregistertoken); parameters unregistertoken the token used with the register method when registering the target object.
... examples using unregister this example shows registering a target object using that same object as the unregister token, then later unregistering it via unregister: class thingy { #cleanup = label => { // ^^^^^−−−−− held value console.error( `the \`release\` method was never called for the object with the label "${label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance.
... */ release() { this.#registry.unregister(this); // ^^^^−−−−− unregister token } } this example shows registering a target object using a different object as its unregister token: { // ^^^^−−−−− held value console.error( `the \`release\` method was never called for the \`thingy\` for the file "${file.name}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance for the given file.
FinalizationRegistry - JavaScript
}); then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *held value* for it: registry.register(theobject, "some value"); the registry does not keep a strong reference to the object, as that would defeat the purpose (if the registry held it strongly, the object would never be reclaimed).
... instance methods finalizationregistry.prototype.register() registers an object with the registry in order to get a cleanup callback when/if the object is garbage-collected.
...}); registering objects for cleanup then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *held value* for it: registry.register(theobject, "some value"); specifications specification weakrefsthe definition of 'finalizationregistry' in that specification.
Float32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods float32array.from() creates a new float32array from an array-like or iterable object.
... instance methods float32array.prototype.copywithin() copies a sequence of array elements within the array.
Float64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods float64array.from() creates a new float64array from an array-like or iterable object.
... instance methods float64array.prototype.copywithin() copies a sequence of array elements within the array.
Generator.prototype.next() - JavaScript
the next() method returns an object with two properties done and value.
... you can also provide a parameter to the next method to send a value to the generator.
... examples using next() the following example shows a simple generator and the object that the next method returns: function* gen() { yield 1; yield 2; yield 3; } const g = gen(); // "generator { }" g.next(); // "object { value: 1, done: false }" g.next(); // "object { value: 2, done: false }" g.next(); // "object { value: 3, done: false }" g.next(); // "object { value: undefined, done: true }" using next() with a list function* getpage(pagesize = 1, list) { let output...
Int16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods int16array.from() creates a new int16array from an array-like or iterable object.
... instance methods int16array.prototype.copywithin() copies a sequence of array elements within the array.
Int32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods int32array.from() creates a new int32array from an array-like or iterable object.
... instance methods int32array.prototype.copywithin() copies a sequence of array elements within the array.
Int8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods int8array.from() creates a new int8array from an array-like or iterable object.
... instance methods int8array.prototype.copywithin() copies a sequence of array elements within the array.
Intl.Locale.prototype.maximize() - JavaScript
the intl.locale.prototype.maximize() method gets the most likely values for the language, script, and region of the locale based on existing values.
...this functionality is provided to javascript programmers via the maximize() method.
...other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the maximize() method.
Intl.Locale.prototype.minimize() - JavaScript
the intl.locale.prototype.minimize() method attempts to remove information about the locale that would be added by calling locale.maximize().
... description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename).
...other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the minimize() method.
JSON.parse() - JavaScript
the json.parse() method parses a json string, constructing the javascript value or object described by the string.
...= /^[\],:{}\s]*$/; var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fa-f]{4})/g; var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[ee][+\-]?\d+)?/g; var rx_four = /(?:^|:|,)(?:\s*\[)+/g; var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; json.parse = function(text, reviver) { // the parse method takes a text and an optional reviver function, and returns // a javascript value if the text is a valid json text.
... var j; function walk(holder, key) { // the walk method is used to recursively walk the resulting structure so // that modifications can be made.
JSON.stringify() - JavaScript
the json.stringify() method converts a javascript object or value to a json string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
... description json.stringify() converts a value to json notation representing it: if the value has a tojson() method, it's responsible to define what data will be serialized.
... json.stringify({ a: 2 }, null, ' '); // '{ // "a": 2 // }' using a tab character mimics standard pretty-print appearance: json.stringify({ uno: 1, dos: 2 }, null, '\t'); // returns the string: // '{ // "uno": 1, // "dos": 2 // }' tojson() behavior if an object being stringified has a property named tojson whose value is a function, then the tojson() method customizes json stringification behavior: instead of the object being serialized, the value returned by the tojson() method when called will be serialized.
JSON - JavaScript
the json object contains methods for parsing javascript object notation (json) and converting values to json.
... it can't be called or constructed, and aside from its two method properties, it has no interesting functionality of its own.
... static methods json.parse(text[, reviver]) parse the string text as json, optionally transform the produced value and its properties, and return the value.
Math.trunc() - JavaScript
description unlike the other three math methods: math.floor(), math.ceil() and math.round(), the way math.trunc() works is very simple.
... the argument passed to this method will be converted to number type implicitly.
... because trunc() is a static method of math, you always use it as math.trunc(), rather than as a method of a math object you created (math is not a constructor).
Number.prototype.toFixed() - JavaScript
the tofixed() method formats a number using fixed-point notation.
... typeerror if this method is invoked on an object that is not a number.
...if the absolute value of numobj is greater or equal to 1e+21, this method simply calls number.prototype.tostring() and returns a string in exponential notation.
Object.assign() - JavaScript
the object.assign() method copies all enumerable own properties from one or more source objects to a target object.
... the object.assign() method only copies enumerable and own properties from a source object to a target object.
...console.log(target.foo3); // undefined, assign method has finished, foo3 will not be copied.
Object.getOwnPropertyDescriptor() - JavaScript
the object.getownpropertydescriptor() method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain).
... description this method permits examination of the precise description of a property.
...figurable: true, // enumerable: true, // value: 73, // writable: true // } o = {}; object.defineproperty(o, 'qux', { value: 8675309, writable: false, enumerable: false }); d = object.getownpropertydescriptor(o, 'qux'); // d is { // value: 8675309, // writable: false, // enumerable: false, // configurable: false // } non-object coercion in es5, if the first argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.prototype.isPrototypeOf() - JavaScript
the isprototypeof() method checks if an object exists in another object's prototype chain.
... description the isprototypeof() method allows you to check whether or not an object exists within another object's prototype chain.
...o() {} function bar() {} function baz() {} bar.prototype = object.create(foo.prototype); baz.prototype = object.create(bar.prototype); var baz = new baz(); console.log(baz.prototype.isprototypeof(baz)); // true console.log(bar.prototype.isprototypeof(baz)); // true console.log(foo.prototype.isprototypeof(baz)); // true console.log(object.prototype.isprototypeof(baz)); // true isprototypeof() method, along with the instanceof operator particularly comes in handy if you have code that can only function when dealing with objects descended from a specific prototype chain, e.g., to guarantee that certain methods or properties will be present on that object.
Object.preventExtensions() - JavaScript
the object.preventextensions() method prevents new properties from ever being added to an object (i.e.
... this method makes the [[prototype]] of the target immutable; any [[prototype]] re-assignment will throw a typeerror.
...fixed.__proto__ = { oh: 'hai' }; non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the object.
... this method is meant to be overridden by derived objects for locale-specific purposes.
... this function is provided to give objects a generic tolocalestring method, even though not all may use it.
Promise.all() - JavaScript
the promise.all() method takes an iterable of promises as an input, and returns a single promise that resolves to an array of the results of the input promises.
... description this method can be useful for aggregating the results of multiple promises.
... if an empty iterable is passed, then this method returns (synchronously) an already resolved promise.
Promise.prototype.finally() - JavaScript
the finally() method returns a promise.
... description the finally() method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome.
... the finally() method is very similar to calling .then(onfinally, onfinally) however there are a couple of differences: when creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it a finally callback will not receive any argument, since there's no reliable means of determining if the promise was fulfilled or rejected.
Promise.resolve() - JavaScript
the promise.resolve() method returns a promise object that is resolved with a given value.
...has a "then" method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the value.
... examples using the static promise.resolve method promise.resolve('success').then(function(value) { console.log(value); // "success" }, function(value) { // not called }); resolving an array var p = promise.resolve([1,2,3]); p.then(function(v) { console.log(v[0]); // 1 }); resolving another promise var original = promise.resolve(33); var cast = promise.resolve(original); cast.then(function(value) { console.log('value: ' + value); ...
Reflect.getOwnPropertyDescriptor() - JavaScript
the static reflect.getownpropertydescriptor() method is similar to object.getownpropertydescriptor().
... description the reflect.getownpropertydescriptor method returns a property descriptor of the given property if it exists in the target object, undefined otherwise.
...ptor() reflect.getownpropertydescriptor({x: 'hello'}, 'x') // {value: "hello", writable: true, enumerable: true, configurable: true} reflect.getownpropertydescriptor({x: 'hello'}, 'y') // undefined reflect.getownpropertydescriptor([], 'length') // {value: 0, writable: true, enumerable: false, configurable: false} difference to object.getownpropertydescriptor() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
Reflect.has() - JavaScript
the static reflect.has() method works like the in operator as a function.
... description the reflect.has method allows you to check if a property is in an object.
... examples using reflect.has() reflect.has({x: 0}, 'x') // true reflect.has({x: 0}, 'y') // false // returns true for properties in the prototype chain reflect.has({x: 0}, 'tostring') // proxy with .has() handler method obj = new proxy({}, { has(t, k) { return k.startswith('door') } }); reflect.has(obj, 'doorbell') // true reflect.has(obj, 'dormitory') // false reflect.has returns true for any inherited properties, like the in operator: const a = {foo: 123} const b = {__proto__: a} const c = {__proto__: b} // the prototype chain is: c -> b -> a reflect.has(c, 'foo') // true specifications specification ecmascript (ecma-262)the definition of 'reflect.has' in that specification.
Reflect.preventExtensions() - JavaScript
the static reflect.preventextensions() method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object).
... description the reflect.preventextensions() method allows you to prevent new properties from ever being added to an object (i.e., prevents future extensions to the object).
...reflect.preventextensions(empty) reflect.isextensible(empty) // === false difference from object.preventextensions() if the target argument to this method is not an object (a primitive), then it will cause a typeerror.
RegExp.$1-$9 - JavaScript
these properties can be used in the replacement text for the string.replace method.
... examples using $n with string.replace the following script uses the replace() method of the string instance to match a name in the format first last and output it in the format last, first.
... var re = /(\w+)\s(\w+)/; var str = 'john smith'; str.replace(re, '$2, $1'); // "smith, john" regexp.$1; // "john" regexp.$2; // "smith" using $n with regexp.test the following script uses the test() method of the regexp instance to grab a number in a generic string.
RegExp.prototype.toString() - JavaScript
the tostring() method returns a string representing the regular expression.
... description the regexp object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
... for regexp objects, the tostring() method returns a string representation of the regular expression.
RegExp - JavaScript
instance methods regexp.prototype.compile() (re-)compiles a regular expression during execution of a script.
...overrides the object.prototype.tostring() method.
... examples using a regular expression to change data format the following script uses the replace() method of the string instance to match a name in the format first last and output it in the format last, first.
Set.prototype.forEach() - JavaScript
the foreach() method executes a provided function once for each value in the set object, in insertion order.
... description the foreach() method executes the provided callback once for each value which actually exists in the set object.
...this is to make it consistent with other foreach() methods for map and array.
String.prototype.big() - JavaScript
the big() method creates a <big> html element that causes a string to be displayed in a big font.
... description the big() method embeds a string in a <big> tag: "<big>str</big>".
... examples using big() the following example uses string methods to change the size of a string: var worldstring = 'hello, world'; console.log(worldstring.small()); // <small>hello, world</small> console.log(worldstring.big()); // <big>hello, world</big> console.log(worldstring.fontsize(7)); // <fontsize=7>hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.fontsize = '2em'; specifications specification ecmascript (ecma-262)the definition of 'string.prototype.big' in that specification.
String.prototype.blink() - JavaScript
the blink() method creates a <blink> html element that causes a string to blink.
... description the blink() method embeds a string in a <blink> tag: "<blink>str</blink>".
... examples using blink() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.blink' in that specification.
String.prototype.bold() - JavaScript
the bold() method creates a <b> html element that causes a string to be displayed as bold.
... description the bold() method embeds a string in a <b> tag: "<b>str</b>".
... examples using bold() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.bold' in that specification.
String.prototype.fixed() - JavaScript
the fixed() method creates a <tt> html element that causes a string to be displayed in fixed-pitch font.
... description the fixed() method embeds a string in a <tt> tag: "<tt>str</tt>".
... examples using fixed() the following example uses the fixed method to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.fixed()); // "<tt>hello, world</tt>" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.fixed' in that specification.
String.fromCharCode() - JavaScript
the static string.fromcharcode() method returns a string created from the specified sequence of utf-16 code units.
... description this method returns a string and not a string object.
... because fromcharcode() is a static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created.
String.prototype.italics() - JavaScript
the italics() method creates an <i> html element that causes a string to be italic.
... description the italics() method embeds a string in an <i> tag: "<i>str</i>".
... examples using italics() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.italics' in that specification.
String.prototype.link() - JavaScript
the link() method creates a string representing the code for an <a> html element to be used as a hypertext link to another url.
... description use the link() method to create an html snippet for a hypertext link.
... links created with the link() method become elements in the links array of the document object.
String.prototype.match() - JavaScript
the match() method retrieves the result of matching a string against a regular expression.
... if you don't give any parameter and use the match() method directly, you will get an array with an empty string: [""].
... other methods if you need to know if a string matches a regular expression regexp, use regexp.test().
String.prototype.repeat() - JavaScript
the repeat() method constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together.
... polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet.
...unt - str.length); return str; } } examples using repeat 'abc'.repeat(-1) // rangeerror 'abc'.repeat(0) // '' 'abc'.repeat(1) // 'abc' 'abc'.repeat(2) // 'abcabc' 'abc'.repeat(3.5) // 'abcabcabc' (count will be converted to integer) 'abc'.repeat(1/0) // rangeerror ({ tostring: () => 'abc', repeat: string.prototype.repeat }).repeat(2) // 'abcabc' (repeat() is a generic method) specifications specification ecmascript (ecma-262)the definition of 'string.prototype.repeat' in that specification.
String.prototype.replace() - JavaScript
the replace() method returns a new string with some or all matches of a pattern replaced by a replacement.
... description this method does not change the calling string object.
...this forces the evaluation of the match prior to the tolowercase() method.
String.prototype.replaceAll() - JavaScript
as of august 2020 the replaceall() method is supported by firefox but not by chrome.
... the replaceall() method returns a new string with all matches of a pattern replaced by a replacement.
... description this method does not change the calling string object.
String.prototype.small() - JavaScript
the small() method creates a <small> html element that causes a string to be displayed in a small font.
... description the small() method embeds a string in a <small> tag: "<small>str</small>".
... examples using small() the following example uses string methods to change the size of a string: var worldstring = 'hello, world'; console.log(worldstring.small()); // <small>hello, world</small> console.log(worldstring.big()); // <big>hello, world</big> console.log(worldstring.fontsize(7)); // <font size="7">hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for example: document.getelementbyid('yourelemid').style.fontsize = '0.7em'; specifications specification ecmascript (ecma-262)the definition of 'string.prototype.small' in that specification.
String.prototype.strike() - JavaScript
the strike() method creates a <strike> html element that causes a string to be displayed as struck-out text.
... description the strike() method embeds a string in a <strike> tag: "<strike>str</strike>".
... examples using strike() the following example uses string methods to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.strike' in that specification.
String.prototype.sub() - JavaScript
the sub() method creates a <sub> html element that causes a string to be displayed as subscript.
... description the sub() method embeds a string in a <sub> tag: "<sub>str</sub>".
... examples using sub() and sup() methods the following example uses the sub() and sup() methods to format a string: var supertext = 'superscript'; var subtext = 'subscript'; console.log('this is what a ' + supertext.sup() + ' looks like.'); // this is what a <sup>superscript</sup> looks like console.log('this is what a ' + subtext.sub() + ' looks like.'); // this is what a <sub>subscript</sub> looks like.
String.prototype.sup() - JavaScript
the sup() method creates a <sup> html element that causes a string to be displayed as superscript.
... description the sup() method embeds a string in a <sup> tag: "<sup>str</sup>".
... examples using sub() and sup() methods the following example uses the sub() and sup() methods to format a string: var supertext = 'superscript'; var subtext = 'subscript'; console.log('this is what a ' + supertext.sup() + ' looks like.'); // "this is what a <sup>superscript</sup> looks like." console.log('this is what a ' + subtext.sub() + ' looks like.'); // "this is what a <sub>subscript</sub> looks like." specifications specification ecmascript (ecma-262)the definition of 'string.prototype.sup' in that specification.
String.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified object.
... description the string object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
... for string objects, the tostring() method returns a string representation of the object and is the same as the string.prototype.valueof() method.
String.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a string object.
... description the valueof() method of string returns the primitive value of a string object as a string data type.
... this method is usually called internally by javascript and not explicitly in code.
Symbol.iterator - JavaScript
description whenever an object needs to be iterated (such as at the beginning of a for..of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated.
...the built-in types with a @@iterator method are: array.prototype[@@iterator]() typedarray.prototype[@@iterator]() string.prototype[@@iterator]() map.prototype[@@iterator]() set.prototype[@@iterator]() see also iteration protocols for more information.
...[...myiterable] // [1, 2, 3] or iterables can be defined directly inside a class or object using a computed property: class foo { *[symbol.iterator] () { yield 1; yield 2; yield 3; } } const someobj = { *[symbol.iterator] () { yield 'a'; yield 'b'; } } [...new foo] // [ 1, 2, 3 ] [...someobj] // [ 'a', 'b' ] non-well-formed iterables if an iterable's @@iterator method does not return an iterator object, then it is a non-well-formed iterable.
Symbol.match - JavaScript
this function is called by the string.prototype.match() method.
...for example, the methods string.prototype.startswith(), string.prototype.endswith() and string.prototype.includes(), check if their first argument is a regular expression and will throw a typeerror if they are.
...the methods startswith and endswith won't throw a typeerror as a consequence.
Symbol.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified symbol object.
... description the symbol object overrides the tostring method of the object object; it does not inherit object.prototype.tostring().
... for symbol objects, the tostring method returns a string representation of the object.
Symbol.unscopables - JavaScript
however, in ecmascript 2015 and later, the array.prototype.keys() method was introduced.
... that means that inside with environment "keys" would now be the method and not the variable.
...a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being scoped into the with statement.
TypedArray.prototype.fill() - JavaScript
the fill() method fills all the elements of a typed array from a start index to an end index with a static value.
... this method has the same algorithm as array.prototype.fill().
... the fill method takes up to three arguments value, start and end.
TypedArray.prototype.filter() - JavaScript
the filter() method creates a new typed array with all elements that pass the test implemented by the provided function.
... this method has the same algorithm as array.prototype.filter().
... description the filter() method calls a provided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true value.
TypedArray.prototype.find() - JavaScript
the find() method returns a value in the typed array, if an element satisfies the provided testing function.
... see also the findindex() method, which returns the index of a found element in the typed array instead of its value.
... description the find method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value.
TypedArray.prototype.findIndex() - JavaScript
the findindex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function.
... see also the find() method, which returns the value of a found element in the typed array instead of its index.
... description the findindex method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value.
TypedArray.prototype.forEach() - JavaScript
the foreach() method executes a provided function once per array element.
... this method has the same algorithm as array.prototype.foreach().
... description the foreach() method executes the provided callback once for each element present in the typed array in ascending order.
TypedArray.from() - JavaScript
the typedarray.from() method creates a new typed array from an array-like or iterable object.
... this method is nearly the same as array.from().
... the length property of the from() method is 1.
TypedArray.prototype.indexOf() - JavaScript
the indexof() method returns the first index at which a given element can be found in the typed array, or -1 if it is not present.
... this method has the same algorithm as array.prototype.indexof().
... description indexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator).
TypedArray.prototype.join() - JavaScript
the join() method joins all elements of an array into a string.
... this method has the same algorithm as array.prototype.join().
... // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join if (!uint8array.prototype.join) { object.defineproperty(uint8array.prototype, 'join', { value: array.prototype.join }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
TypedArray.prototype.lastIndexOf() - JavaScript
the lastindexof() method returns the last index at which a given element can be found in the typed array, or -1 if it is not present.
...this method has the same algorithm as array.prototype.lastindexof().
... description lastindexof compares searchelement to elements of the typed array using strict equality (the same method used by the ===, or triple-equals, operator).
TypedArray.prototype.map() - JavaScript
the map() method creates a new typed array with the results of calling a provided function on every element in this typed array.
... this method has the same algorithm as array.prototype.map().
... description the map() method calls a provided callback function (mapfn) once for each element in a typed array, in order, and constructs a new typed array from the results.
TypedArray.prototype.reduceRight() - JavaScript
the reduceright() method applies a function against an accumulator and each value of the typed array (from right-to-left) has to reduce it to a single value.
... this method has the same algorithm as array.prototype.reduceright().
... description the reduceright method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring.
TypedArray.prototype.sort() - JavaScript
the sort() method sorts the elements of a typed array numerically in place and returns the typed array.
... this method has the same algorithm as array.prototype.sort(), except that sorts the values numerically instead of as strings.
... examples using sort for more examples, see also the array.prototype.sort() method.
Uint16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods uint16array.from() creates a new uint16array from an array-like or iterable object.
... instance methods uint16array.prototype.copywithin() copies a sequence of array elements within the array.
Uint32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods uint32array.from() creates a new uint32array from an array-like or iterable object.
... instance methods uint32array.prototype.copywithin() copies a sequence of array elements within the array.
Uint8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods uint8array.from() creates a new uint8array from an array-like or iterable object.
... instance methods uint8array.prototype.copywithin() copies a sequence of array elements within the array.
Uint8ClampedArray - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... static methods uint8clampedarray.from() creates a new uint8clampedarray from an array-like or iterable object.
... instance methods uint8clampedarray.prototype.copywithin() copies a sequence of array elements within the array.
parseFloat() - JavaScript
description parsefloat is a top-level function and not a method of any object.
... parsefloat will parse non-string objects if they have a tostring or valueof method.
... the returned value is the same as if parsefloat had been called on the result of those methods.
Image file type and format guide - Web media technologies
compression several compression methods are supported, including lossy or lossless algorithms licensing covered by the microsoft open specification promise; while microsoft holds patents against bmp, they have published a promise not to assert its patent rights as long as specific conditions are met.
... compression bmp-format icons nearly always use lossless compression, but lossy methods are available.
... tiff supports a variety of compression methods, but the most commonly used are the ccitt group 4 (and, for older fax systems, group 3) compression systems used for by fax software, as well as lzw and lossy jpeg compression.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
there are two options passed to the pushmanager.subscribe() method — the first is uservisibleonly: true, which means all the notifications sent to the user will be visible to them, and the second one is the applicationserverkey, which contains our successfully acquired and converted vapid key.
... fetch('./register', { method: 'post', headers: { 'content-type': 'application/json' }, body: json.stringify({ subscription: subscription }), }); then the globaleventhandlers.onclick function on the subscribe button is defined: document.getelementbyid('doit').onclick = function() { const payload = document.getelementbyid('notification-payload').value; const delay = document.getelementbyid('notification-delay').value; const ttl = document.getelementbyid('notification-ttl').value; fetch('./sendnotifica...
...tion', { method: 'post', headers: { 'content-type': 'application/json' }, body: json.stringify({ subscription: subscription, payload: payload, delay: delay, ttl: ttl, }), }); }; when the button is clicked, fetch asks the server to send the notification with the given parameters: payload is the text that to be shown in the notification, delay defines a delay in seconds until the notification will be shown, and ttl is the time-to-live setting that keeps the notification available on the server for a specified amount of time, also defined in seconds.
rendering-intent - SVG: Scalable Vector Graphics
the different options cause different methods to be used for translating colors to the color gamut of the target rendering device.
... note: this method should be used for images.
...this method usually converts out of gamut colors to colors that have the same lightness but fall just inside the gamut.
Same-origin policy - Web security
window the following cross-origin access to these window properties is allowed: methods window.blur window.close window.focus window.postmessage attributes window.closed read only.
... location the following cross-origin access to location properties is allowed: methods location.replace attributes urlutils.href write-only.
...internet explorer uses its own internal method to determine if a domain is a public suffix.
Types of attacks - Web security
for endpoints that require a post request, it's possible to programmatically trigger a <form> submit (perhaps in an invisible <iframe>) when the page is loaded: <form action="https://bank.example.com/withdraw" method="post"> <input type="hidden" name="account" value="bob"> <input type="hidden" name="amount" value="1000000"> <input type="hidden" name="for" value="mallory"> </form> <script>window.addeventlistener('domcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from happening: get endpoints should be idemp...
...otent—actions that enact a change and do not simply retrieve data should require sending a post (or other http method) request.
... this method of protection relies on an attacker being unable to predict the user's assigned csrf token.
Tutorials
we have covered the necessary prerequisites so can now dive deep into css layout, looking at different display settings, traditional layout methods involving float and positioning, and new fangled layout tools like flexbox.
... starting to write css an introduction to tools and methodologies to write more succinct, maintainable, and scalable css.
... eloquent javascript a comprehensive guide to intermediate and advanced javascript methodologies.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
using the xsltprocessor.getparameter() method, the code can figure whether to sort in ascending or descending order.
... the xslt file has a parameter called myorder that javascript sets to change the sorting method.
...mentbyid("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 name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number" order="{$myorder}" /> </xsl:apply-templates> </xsl:template> <xsl:template match="div"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet> ...
Understanding WebAssembly text format - WebAssembly
the key is that javascript can create webassembly linear memory instances via the webassembly.memory() interface, and access an existing memory instance (currently you can only have one per module instance) using the associated instance methods.
... memory instances can also grow, for example via the memory.grow() method in javascript.
... mutating tables and dynamic linking because javascript has full access to function references, the table object can be mutated from javascript using the grow(), get() and set() methods.
Communicating using "port" - Archive of obsolete content
the port object offers a shortcut to do this: the once() method.
...this means you can't send functions, and if the object contains methods they won't be encoded.
Content Scripts - Archive of obsolete content
lick', event.target.tostring()); event.stoppropagation(); event.preventdefault(); }, false); self.port.on('warning', function(message) { window.alert(message); }); in the add-on above there are two messages: click is sent from the page-mod to the add-on, when the user clicks an element in the page warning sends a silly string back to the page-mod from tab.attach() the tab.attach() method returns the worker you can use to communicate with the content script(s) you attached.
...but if you call tab.attach() twice, attaching a content script each time, then these content scripts are not loaded into the same context and must communicate with each other using the normal methods of communicating from one context to another.
Modules - Archive of obsolete content
the problem with breaking encapsulation like this is that malicious scripts can use it to get the loading script to execute arbitrary code, by overriding one of the methods on the built-in constructors.
... if the loading script has chrome privileges, then so will any methods called by the loading script, even if that method was installed by a malicious script.
Private Properties - Archive of obsolete content
when an object is used as a key, it's converted to a string using its tostring method.
... to make the above code work, a unique identifier must be associated with each image and override its tostring method.
hotkeys - Archive of obsolete content
globals constructors hotkey(options) creates a hotkey whose onpress listener method is invoked when key combination defined by hotkey is pressed.
... hotkey methods destroy() stops this instance of hotkey from reacting to the key combinations.
self - Archive of obsolete content
methods data.load(name) the data.load() method returns the contents of an embedded data file, as a string.
... data.url(name) the data.url() method returns a resource:// url that points at an embedded data file.
url - Archive of obsolete content
url methods tostring() returns a string representation of the url.
...for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.search); // ?example=true&visible=yes dataurl methods tostring() returns a string representation of the data url.
content/worker - Archive of obsolete content
methods postmessage(data) asynchronously emits "message" events in the enclosed worker, where content script was loaded.
... detach this event is emitted when the document associated with this worker is unloaded or the worker's destroy() method is called.
core/heritage - Archive of obsolete content
if (!(this instanceof dog)) return new dog(name); this.name = name; }; // to define methods you need to make a dance with a special 'prototype' // property of the constructor function.
...also you could specify which class you want to inherit from by passing special extends property: var pet = class({ extends: dog, // should inherit from dog initialize: function initialize(breed, name) { // to call ancestor methods you will have to access them // explicitly dog.prototype.initialize.call(this, name); this.breed = breed; }, call: function call(name) { return this.name === name ?
io/byte-streams - Archive of obsolete content
bytereader methods close() closes both the stream and its backing stream.
... bytewriter methods close() closes both the stream and its backing stream.
io/text-streams - Archive of obsolete content
textreader methods close() closes both the stream and its backing stream.
... textwriter methods close() flushes the backing stream's buffer and closes both the stream and the backing stream.
remote/child - Archive of obsolete content
methods forevery calls the callback for every existing frame and any new frames created in the future.
... methods addeventlistener(event, listener, iscapturing) adds an event listener for dom events dispatched by this content frame.
remote/parent - Archive of obsolete content
listen to attach and detach events to hear as processes are started and stopped: const { processes } = require("sdk/remote/parent"); processes.on("attach", function(process) { console.log("new process is remote: " + process.isremote); }); methods forevery(callback) calls the callback for every existing process and any new processes created in the future.
... const { frames } = require("sdk/remote/parent"); frames.on("attach", function(frame) { console.log("frame is attached: " + frame.frameelement); }); methods forevery(callback) calls the callback for every existing frame and any new frames created in the future.
system/child_process - Archive of obsolete content
child.stdin has no write() method (see example below for writing to child process stdin) examples adaption of node's documentation for spawn(): var child_process = require("sdk/system/child_process"); var ls = child_process.spawn('/bin/ls', ['-lh', '/usr']); ls.stdout.on('data', function (data) { console.log('stdout: ' + data); }); ls.stderr.on('data', function (data) { console.log('stderr: ' + data); }); ls.on('close...
...', function (code) { console.log('child process exited with code ' + code); }); writing to child process' stdin because the sdk implementation does not include a write() method for child processes, you must use the "raw" emit event.
system/events - Archive of obsolete content
determines if we should keep a strong or weak reference to the listener method.
...determines if we should keep a strong or weak reference to the listener method.
test/assert - Archive of obsolete content
methods ok(guard, message) tests whether an expression evaluates to true.
... this method takes an optional error argument: to check that the exception thrown is of the expected type, pass a constructor function: the exception thrown must be an instance of the object returned by that function.
ui/frame - Archive of obsolete content
frame methods postmessage(message, targetorigin) send a message to scripts loaded into the frame.
...after calling this function, the frame will no longer appear in the ui, and accessing any of its properties or methods will throw an error.
ui/toolbar - Archive of obsolete content
onbutton({ id: "next", label: "next", icon: "./icons/next.png" }); var play = actionbutton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = new frame({ url: "./frame-player.html" }); var toolbar = toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just above the content window: to destroy a toolbar call its destroy() method.
... toolbar methods on(event, listener) assign a listener to an event: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.on("show", showing); toolbar.on("hide", hiding); function showing(e) { console.log("showing: " + e.title); } function hiding(...
Low-Level APIs - Archive of obsolete content
lang/functional functional helper methods.
... test/utils helper methods used in the commonjs unit testing suite.
console - Archive of obsolete content
console methods all console methods except exception() and trace() accept one or more javascript objects as arguments and log them to the console.
... the complete set of logging levels is given in the table below, along with the set of functions that will result in output at each level: level will log calls to: all any console method debug debug(), error(), exception(), info(), log(), time(), timeend(), trace(), warn() info error(), exception(), info(), log(), time(), timeend(), trace(), warn() warn error(), exception(), warn() error error(), exception() off nothing setting the logging level the logging level defaults to "error".
Logging - Archive of obsolete content
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.
... the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm init, accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world!
Finding window handles - Archive of obsolete content
like this hwnd gethwnd(nsibasewindow *window) { nscomptr< nsiwidget > widget; window->getmainwidget(getter_addrefs(widget)); if (widget) return (hwnd) widget->getnativedata(ns_native_window); } yet another way to find a window handle (parent window handle) this method is for people who want to get the top level window hwnd from the window object in javascript.
... comparing to the method above, by using this method, you don't have to compile your component with nsiwidget.h and other bunchs of h files that should not be exposed to outside, and could change every time firefox updates, all you need is nsibasewindow.idl(it's not in gecko_sdk, get this from the latest firefox source, or http://mxr.mozilla.org/mozilla/sourc...basewindow.idl), and use xpidl to compile it to .h file, although that's stll a unfrozen interface, but it should be a lot better.
LookupNamespaceURI - Archive of obsolete content
however, due to bug 312019, this method does not work with dynamically assigned namespaces (e.g., those set with node.prefix).
...document : htmldocument; // support htmldocument if document not present // if document is present, is this method also present?
Miscellaneous - Archive of obsolete content
n that might not be called immediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox 2 see around here: http://mxr.mozilla.org/mozilla1.8/so...pdates.js#1631 bug 338039 tracks improving this situation by providing a simple method to restart the application.
...to see what the postdata looks like before the request is even sent, use the 'http-on-modify-request' observer topic: observerservice.addobserver(observer, 'http-on-modify-request', false); where "observer" is an object that has a method "observe": function observe(subject, topic, data) { subject.queryinterface(components.interfaces.nsiuploadchannel); postdata = subject.uploadstream; } here again, postdata is not a string, but an nsiinputstream, so you can use the last code snippet of the previous section to get the data as a string.
Progress Listeners - Archive of obsolete content
note that if you just want to execute your code each time a page loads, you can use an an easier method, onpageload().
...echange: 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.
JavaScript timers - Archive of obsolete content
the setimmediate() function can be used instead of the settimeout(fn, 0) method to execute heavy operations in ie.
...the method takes as an argument a callback to be invoked before the repaint.
Deploying a Plugin as an Extension - Archive of obsolete content
when this method is used, you can choose to either place the plugin into the plugins directory, or, on windows, place it into your own directory and modify the windows registry to let firefox know where to find the plugin.
... the downside to this method is that once the plugin is installed, it might be difficult for users to upgrade, uninstall, or disable the plugin.
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.
...instead, nsiscriptableunescapehtml.parsefragment() method should be used that is meant for just that scenario: var target = entry.getelementsbyclassname("description")[0]; var fragment = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(description, false, null, target); target.appendchild(fragment); this will add the html ...
Downloading JSON and JavaScript in extensions - Archive of obsolete content
downloading json if the extension is downloading json, then the developer should be using one of the json decoding methods discussed here and not using eval() at all.
...the json decoding methods available to extension developers protect the extension from malicious json and javascript.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
extension and web authors are encouraged to use the method described below to install xpis, as it provides the best experience to users.
... available parameters for the install object the installtrigger.install method accepts a javascript object as a parameter, with several properties on that object used to affect the install.
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.
Local Storage - Archive of obsolete content
in the initialization method of your one of your "common" or startup objects, add the following code: let formatter = new log4moz.basicformatter(); let root = log4moz.repository.rootlogger; let logfile = this.getlocaldirectory(); // remember this?
... and then logging is done with any of the following methods, depending on the kind of message being logged: this._logger.fatal("this is a fatal message."); this._logger.error("this is an error message."); this._logger.warn("this is a warning message."); this._logger.info("this is an info message."); this._logger.config("this is a config message."); this._logger.debug("this is a debug message."); this._logger.trace("this is a trace message."); you can ...
Setting Up a Development Environment - Archive of obsolete content
these are text files that define the attributes and methods in one or more interfaces.
...you can set breakpoints, step in and out of methods, and even get profiling information from javascript execution.
Performance best practices in extensions - Archive of obsolete content
if there is anything that can be done even a fraction of a second later, you can use an nsitimer or the window.settimeout() method to schedule that work for later.
... lazily load services the xpcomutils javascript module provides two methods for lazily loading things: definelazygetter() defines a function on a specified object that acts as a getter which will be created the first time it's used.
Using Dependent Libraries In Extension Components - Archive of obsolete content
}; // component.dll on windows, libcomponent.so on linux, libcomponent.dylib on mac static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; // forward declaration of a convienience method to look up a function symbol.
... nsgetmoduleproc getmoduleproc = (nsgetmoduleproc)lookupsymbol(componentlib, "_nsgetmodule"); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } // convienience method grabbed from // http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/standalone/nsgluelinkingosx.cpp .
CSS3 - Archive of obsolete content
the next iteration of this specification is in the work, allowing to tailor a web site regarding the input methods available on the user agent, with new media features like hover or pointer.
...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().
Localizing an extension - Archive of obsolete content
then it fetches all the strings we need from the bundle, one by one, by calling the string bundle's getstring() method, passing the appropriate key for each string.
... « previousnext » see also how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: bootstrapped extensions :: localization (l10n) xul school localization tutorial: dtd/entities method and properties method ...
Source Navigator - Archive of obsolete content
(i think.) you can specify whether it's the declaration/definition of a method/function to look up...
...source navigator then loads the database and then display the following symbols window: searching a method by typing in the method name viewing the definition/declaration by highlighting the method in the code ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
many frames' reflow() method verifies that the bit is set with an assertion.
... ns_frame_first_reflow this flag is set on a newly created frame, and later cleared by the frame's reflow() method when the frame has had its initial reflow.
Style System Overview - Archive of obsolete content
the nsistyleruleprocessor interface implemented by cssruleprocessor, htmlstylesheetimpl, and htmlcssstylesheetimpl has a rulesmatching method, which is required to call nsrulewalker::forward on any rules that match the element.
... has a separate rulesmatching method for pseudo-elements.
Helper Apps (and a bit of Save As) - Archive of obsolete content
launching a helper application this is delegated to the nspiexternalapplauncher (also implemented by the nsexternalhelperapphandler): windows: launch either directly via nsiprocess or via the ::shellexecute() method depending on where the mimeinfo came from.
... mac: use the launchwithdoc() method on nsilocalfilemac.
Selection - Archive of obsolete content
jetpack's selection api provides a method for detecting the selections made by the user.
...jetpack.import.future("selection");jetpack.selection.text = 'hello';jetpack.selection.html = '<b>hello</b>'; methods onselection(func function)this method allows you to execute an event function when a selection is made.
Selection - Archive of obsolete content
jetpack's selection api provides a method for detecting the selections made by the user.
...jetpack.import.future("selection"); jetpack.selection.text = 'hello'; jetpack.selection.html = '<b>hello</b>'; methods onselection(func function)this method allows you to execute an event function when a selection is made.
Selection - Archive of obsolete content
ArchiveMozillaJetpackdocsUISelection
jetpack's selection api provides a method for detecting the selections made by the user.
...jetpack.import.future("selection"); jetpack.selection.text = 'hello'; jetpack.selection.html = '<b>hello</b>'; methods onselection(func function)this method allows you to execute an event function when a selection is made.
Metro browser chrome tests - Archive of obsolete content
setup(), teardown(), and run() each have individual exception handlers to prevent one method from interfering with the execution of another.
... an exception in any of these methods will cause a test failure.
Microsummary topics - Archive of obsolete content
firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) programmatically installing a microsummary generator to programmatically install a microsummary generator -- for example, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosummaryservice interface implemented by the nsimicrosummaryservice component, then call its installgenerator() method, passing it an xml document containing the generator.
...or from the creating a microsummary tutorial: var generatortext = ' \ <?xml version="1.0" encoding="utf-8"?> \ <generator xmlns="http://www.mozilla.org/microsummaries/0.1" \ name="firefox download count" \ uri="urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16}"> \ <template> \ <transform xmlns="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"].
The life of an HTML HTTP request - Archive of obsolete content
if there are several frames created from a content node, then the first of these are called the "primary" node, and the following frames can be found by using the getnextinflow() method of nsiframe.
...when the presshell [note: not true, who really does the call?] has layouted (reflowed) the frames it calls nsiframe::paint() method of all frames.
Venkman Internals - Archive of obsolete content
scriptmanager in initdebugger() the previous loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager.
...this method is set into jsdiscripthook.onscriptcreated venkman-views.js views are the panels shown within the venkman window.
Example Sticky Notes - Archive of obsolete content
// here we simply echoing it back: return val; ]]></setter> </property> <method name="setborder"> <!-- new method for the bound element.
... unlike virtual property it is called in function context: this.setborder(arg) you also may define any amount of named arguments using <parameter name="argumentname"/> --> <parameter name="arg"/> <body><![cdata[ this.style.border = arg; ]]></body> </method> </implementation> <handlers> <!-- event handlers.
XBL - Archive of obsolete content
bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted underneath the bound element.
...also sxbl lacks some features of xbl, such as bindings inheritance and defining methods/properties on bound elements.
XML in Mozilla - Archive of obsolete content
add this line: pref("layout.selectanchor", true); dom load and save methods document.load() is a part of an old version of the w3c dom level 3 load & save module.
... mozilla currently implements only the load() method and the document.async property.
Trigger Scripts and Install Scripts - Archive of obsolete content
triggers use the installtrigger object methods to compare software versions, install chrome, and perform simple software installations.
... install scripts use the install, file, installversion and platform-specific installation object methods to initialize, queue, manage, and perform the installation of one or more software packages.
execute - Archive of obsolete content
method of file object syntax int execute ( filespecobject executablefile, [string aparameters] ); parameters the execute method has the following parameters: executablefile a filespecobject representing the local file already on disk to be executed.
...description the specified file is not actually executed until the performinstall method is called.
InstallVersion Object - Archive of obsolete content
overview this object and its methods are used both when triggering a download, to see whether a particular version needs to be installed, and when installing the software.
... the init() method associates a particular version with an installversion object, the tostring() method converts versions in various formats to a string, and the compareto() method compares these string and indicates the relationship between the two versions.
getFolder - Archive of obsolete content
method of install object syntax filespecobject getfolder ( string foldername); filespecobject getfolder ( string foldername, string subdirectory); filespecobject getfolder ( object localdirspec, string subdirectory); parameters the getfolder method has the following parameters: foldername a string representing one of netscape's standard directories.
... description the getfolder method obtains an object representing one of netscape's standard directories, for use with the addfile and getwinprofile methods.
loadResources - Archive of obsolete content
method of install object syntax object loadresources( string xpipath ); parameters the sole input parameter for loadresources is a string representing the path to the properties file in the xpi in which the key/value pairs are defined.
...this method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file.
logComment - Archive of obsolete content
method of install object syntax int logcomment( string acomment ); parameters the sole input parameter is a string whose value will be written to the log during the installation process.
...respectively, these directories correspond to the "program" and "current user" keywords for the getfolder method.
performInstall - Archive of obsolete content
method of install syntax int performinstall(); parameters none.
...in some situations the method may return other errors.
resetError - Archive of obsolete content
method of install object syntax void reseterror (); parameters none.
...description the reseterror method resets any saved error code to zero.
Install Object - Archive of obsolete content
in all cases, the install object is implicit--like the window object in regular web page scripts--and needn't be prefixed to the object methods.
... perform installation check that the files have been added successfully (e.g., by checking the error return codes from many of the main installation methods, and go ahead with the install if everything is in order: performorcancel(); function performorcancel() { if (0 == getlasterror()) performinstall(); else cancelinstall(); } for complete script examples, see script examples.
WinProfile Object - Archive of obsolete content
instead, you construct an instance of this object by calling the getwinprofile method of the install object.
... the two methods of the winprofile object, getstring and writestring, allow you to read and write the data in the key/value pairs of a windows .ini file.
createKey - Archive of obsolete content
method of winreg object syntax int createkey ( string subkey, string classname); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...description the createkey method adds a key to the registry.
enumValueNames - Archive of obsolete content
method of winreg object syntax string enumvaluenames ( string key, int subkeyindex ); parameters the enumvaluenames method has the following parameters: key the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...the following brief example retrieves a key value using this method.
Uploading and Downloading Files - Archive of obsolete content
the exact method depends on the type of upload that you wish to perform.
... function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method.
onFindAgainCommand - Archive of obsolete content
« xul reference home onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands.
... you should specify true as the input parameter to perform a "find previous" operation, or false to perform a "find next." example typically, you'll simply bind this method to your "find next" and "find previous" commands, like this: <command name="cmd_find_previous" oncommand="gfindbar.onfindagaincommand(true);"/> <command name="cmd_find_next" oncommand="gfindbar.onfindagaincommand(false);"/> ...
startFind - Archive of obsolete content
« xul reference home startfind( mode ) return type: no return value call this method to handle your application's "find" command.
... example typically, you'll simply bind this method to your "find" command, like this: <command name="cmd_find" oncommand="gfindbar.startfind(gfindbar.find_normal);"/> ...
loadOneTab - Archive of obsolete content
this method works the same as addtab except for the loadinbackground parameter which allows you to choose whether to open the new tab in foreground or background.
... firefox 3.6 note the second form of this method was added in firefox 3.6; it adds the relatedtocurrent parameter, and allows the parameters to be specified by name, in any order.
openSubDialog - Archive of obsolete content
usually this method would be used to allow the user to configure advanced options.
... the arguments are similar to the window's opendialog method except that the window name does not need to be supplied.
replaceGroup - Archive of obsolete content
you can use the removetab method to remove the existing tabs first if that is desired.
...this method returns an array of the session history objects for the tabs that were removed.
Floating Panels - Archive of obsolete content
<panel id="info-panel" noautohide="true" titlebar="normal" label="image properties" close="true"> the hidepopup method may be used to manually close a popup.
...the hidepopup method would be used if you wish to place your own close button on the panel, or wish to close the panel in response to a user action.
Result Generation - Archive of obsolete content
the template builder uses a method based on the rete algorithm to match data.
...a similar method can be used when removing rdf statements.
Rule Compilation - Archive of obsolete content
however, rebuilding the template (using the builder.rebuild method) will recompile the query and rules and reapply the template again.
... this means that you can change the rules using dom methods, rebuild the template, and get different results.
Adding Event Handlers - Archive of obsolete content
second, by calling an element's addeventlistener method.
... dom event listeners the second way to add an event handler is to call an element's addeventlistener method.
Adding more elements - Archive of obsolete content
this first method would require that we set the style on the box itself.
... we will use the latter method, however.
Adding Style Sheets - Archive of obsolete content
this method has the disadvantage because it means your application will not be themeable.
... the second method involves placing your files as part of a theme.
Features of a Window - Archive of obsolete content
as in html, you can use the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name.
... see also window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name.
Manifest Files - Archive of obsolete content
the method used depends on what kind of application you are creating.
...however, applications installed with a script will not be listed in the extension manager and there is no automated method to uninstall them.
Property Files - Archive of obsolete content
text formatting the next method is getformattedstring().
... this method also gets a string with the given key name from the bundle.
XUL Structure - Archive of obsolete content
for this reason, mozilla provides a method of installing content locally and registering the installed files as part of its chrome system.
...this newer method is the manifest file mentioned earlier, and you will find these as files with the .manifest extension in the chrome directory.
XUL Accesskey FAQ and Policies - Archive of obsolete content
an accesskey is an underlined letter in a web page, menu or dialog that indicates to a user a quick, keyboard method of simulating a click on that element.
...if methods like confirm(), confirmex() or prompt() are being used to create a dialog, use an & before the button or checkbox text to make the next character an accesskey.
XUL Changes for Firefox 1.5 - Archive of obsolete content
the menulist modification methods appenditem and insertitemat take an extra description argument when creating items this way.
... <listbox> the removeitemat method was sometime non zero-based due to a bug (bug 236068).
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.
action - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to specify the content that should be generated for each matching result from a query.
...es inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
assign - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] for xml templates, specifies an additional variable to assign a value to.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
bbox - Archive of obsolete content
ArchiveMozillaXULbbox
« xul reference home [ examples | attributes | properties | methods | related ] a horizontal box that is baseline aligned.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
binding - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] should be contained within a bindings element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
bindings - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to specify a set of variable bindings for a rule.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
box - Archive of obsolete content
ArchiveMozillaXULbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
broadcaster - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a broadcaster is used when you want multiple elements to share one or more attribute values, or when you want elements to respond to a state change.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
broadcasterset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element for broadcaster elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
caption - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a groupbox.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
checkbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be turned on and off.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
colorpicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a palette of colors from which a user may select by clicking on one of the grid cells.
... value property gets and sets color attribute methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
column - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single column in a columns element.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
columns - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] defines the columns of a grid.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
command - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a command element can be used to invoke an operation that can come from multiple sources.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
conditions - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element should appear directly inside a rule element and is used to define conditions for the rule.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
content - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] Éste elemento debería pertenecer a query ("consulta").
... métodos inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattr...
datepicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a datepicker allows the user to enter a date.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
deck - Archive of obsolete content
ArchiveMozillaXULdeck
« xul reference home [ examples | attributes | properties | methods | related ] an element that displays only one of its children at a time.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
description - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a block of text.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
dialogheader - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a heading row for a dialog box.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
dropmarker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a dropmarker is a button with an arrow which will reveal more details when pressed.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
grid - Archive of obsolete content
ArchiveMozillaXULgrid
« xul reference home [ examples | attributes | properties | methods | related ] a grid is a layout type that arranges elements in rows and columns.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
grippy - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that may be used inside a splitter which can be used to collapse a sibling element of the splitter.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
groupbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the groupbox is used to group related elements together.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
hbox - Archive of obsolete content
ArchiveMozillaXULhbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
image - Archive of obsolete content
ArchiveMozillaXULimage
« xul reference home [ examples | attributes | properties | methods | related ] summary an element that displays an image, much like the html img element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
key - Archive of obsolete content
ArchiveMozillaXULkey
« xul reference home [ examples | attributes | properties | methods | related ] the key element defines a window-global keyboard shortcut and must be placed inside a keyset element.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
keyset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element for key elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
label - Archive of obsolete content
ArchiveMozillaXULlabel
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to provide a label for a control element.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatu...
listcell - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single cell of a listbox.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
listcol - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a column in a listbox.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
listcols - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for the columns of a listbox, each of which are created with the listcol element.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
listhead - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header row of a listbox.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
listheader - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a single column in a listbox.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
listitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a listbox.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
member - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used within a rule's conditions element to match elements that are containers or are contained within another element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
menubar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container that usually contains menu elements.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
menuitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
menuseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to create a separator between menu items.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
observes - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the observes element can be used to listen to a broadcaster and receive events and attributes from it.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
page - Archive of obsolete content
ArchiveMozillaXULpage
« xul reference home [ examples | attributes | properties | methods | related ] similar to a window, except it should be used for xul files that are to be loaded into an iframe.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
param - Archive of obsolete content
ArchiveMozillaXULparam
« xul reference home [ examples | attributes | properties | methods | related ] for sql templates, used to bind values to parameters specified within an sql statement.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
popupset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for menupopup, panel and tooltip elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
progressmeter - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a meter which can be used to display the progress of a lengthy operation.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
query - Archive of obsolete content
ArchiveMozillaXULquery
« xul reference home [ examples | attributes | properties | methods | related ] used to specify the query for a template.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
queryset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for query elements when more than one query is used.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
radio - Archive of obsolete content
ArchiveMozillaXULradio
« xul reference home [ examples | attributes | properties | methods | related ] an element that can be turned on and off.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
resizer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element used for window resizing.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
richlistitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an individual item in a richlistbox.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
row - Archive of obsolete content
ArchiveMozillaXULrow
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a rows element.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
rows - Archive of obsolete content
ArchiveMozillaXULrows
« xul reference home [ examples | attributes | properties | methods | related ] defines the rows of a grid.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
rule - Archive of obsolete content
ArchiveMozillaXULrule
« xul reference home [ examples | attributes | properties | methods | related ] a rule is used in a template.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
script - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] much like the html script element, this is used to declare a script to be used by the xul window.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
scrollbar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] when a container's contents which are larger that the size of the container, scroll bars may be placed at the side of the container to allow the user to scroll around in the container.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
scrollcorner - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for the small box where the horizontal and vertical scrollbars meet.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
separator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] creates a small separating gap between elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
spacer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that takes up space but does not display anything.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
spinbuttons - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] spin buttons are two arrows, one to increase a value and one to decrease a value.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
splitter - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element which should appear before or after an element inside a container.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
stack - Archive of obsolete content
ArchiveMozillaXULstack
« xul reference home [ examples | attributes | properties | methods | related ] an element that renders its children on top of each other.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
statusbar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element used to create a status bar, usually placed along the bottom of a window.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
<statusbarpanel> - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox 4 note the status bar has been removed.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
stringbundleset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for stringbundle elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
tabbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container used to display a set of tabbed pages of elements.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
tabpanel - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a individual panel in a tabpanels element.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
tabpanels - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container to hold the set of pages in a tabbox.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
template - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to declare a template for rule-based construction of elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
textnode - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] normally when substituting rdf resources in template rules, you place the rdf property name inside an attribute value preceded with rdf:.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
timepicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the timepicker is used to allow the user to enter a time.
... methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
titlebar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] boxes created with the titlebar element behave just like a normal window titlebar: when the element is clicked and dragged, the window moves with it.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
toolbargrippy - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] not in firefox the notch on the side of a toolbar which can be used to collapse and expand it.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
toolbaritem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only an item that appears on a toolbar.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
toolbarpalette - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only the item is a palette of available toolbar items.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
toolbarseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] creates a separator between groups of toolbar items.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
toolbarset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only this element is used as a container for custom toolbars, which are added in the custom toolbar dialog.
...ies inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
toolbarspacer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only a space between toolbar items.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
toolbarspring - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] firefox only a flexible space between toolbar items.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature...
treecell - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single cell in a tree.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
treechildren - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is the body of the tree.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
treecol - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a column of a tree.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
treecols - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a group of treecol elements.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
treeitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a treeitem should be placed inside a treechildren element and should contain treerow elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
treerow - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a tree.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
treeseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to place a separator row in a tree.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
triple - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a triple can be included inside a rule's conditions element.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
vbox - Archive of obsolete content
ArchiveMozillaXULvbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
where - Archive of obsolete content
ArchiveMozillaXULwhere
« xul reference home [ examples | attributes | properties | methods | related ] indicate a condition that must match for a template result to be used.
...s inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeatur...
wizardpage - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element defines a page in a wizard.
...ited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagna...
XULRunner tips - Archive of obsolete content
sions theme manager chrome://mozapps/content/extensions/extensions.xul?type=themes extension:manager-themes javascript console chrome://global/content/console.xul global:console about:config chrome://global/content/config.xul developer extensions venkman need a custom build or a compatible extension need to edit compatibility in needs a method to start venkman (usually by overlaying the main xul file, similar to existing code for firefox, suite, etc.) the function toopenwindowbytype() needs to be defined.
... note: i use this method of installing extensions into all of my mozilla applications.
Archived Mozilla and build documentation - Archive of obsolete content
because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implementations are particularly well suited to xbl.
... microsummary topics to programmatically install a microsummary generator -- for example, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosummaryservice interface implemented by the nsimicrosummaryservice component, then call its installgenerator() method, passing it an xml document containing the generator.
2006-12-01 - Archive of obsolete content
http://www.juicescript.org/ discussions deleting objects in spidermonkey a user asks if there's a method of manually deleting an object in spidermonkey before garbage collector deletes it.
... peter wilson's reply was to add a method that does the deleting with a native implementation that releases the resources held by the object as seen in this database interface: var mydbase = new pgsqlconnection; mydbase.connect("database"); mydbase.exec("select * from mytable where ..."); // use the result data - (native implementation function) mydbase.close() spidermonkey for server side inquiry about why javascript hasn't caught on for general server-side scripting.
2006-12-01 - Archive of obsolete content
discussions cancellable async requests discussions about a bug of calicalendar's async methods.
... override a method (xbl) discussions about how to override a js function in a js file.
Browser-side plug-in API - Archive of obsolete content
this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to request information, tell the browser to repaint part of the window, and so forth.
... the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in.
NPN_GetURL - Archive of obsolete content
for http urls, the browser resolves this method as the http server method get, which requests url objects.
...the following recommendations about target choice apply to other methods that handle urls as well.
NPN_GetValue - Archive of obsolete content
microsoft windows you can use this method to help create a menu or dialog box for a windowless plug-in.
...the method returns a value of type hwnd.
NPWindow - Archive of obsolete content
for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable (a pointer to an npwindow allocated by the browser).
...for windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable.
NPAPI plug-in side API - Archive of obsolete content
this chapter describes methods in the plug-in api that are available from the plug-in object; these allow plug-ins to interact with the browser.
... the names of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser.
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
when this method is used, you can choose to either place the plugin into the plugins directory, or place it into your own directory and modify the windows registry to let firefox know where to find the plugin.
... the downside to this method is that once the plugin is installed, it might be difficult for users to upgrade, uninstall, or disable the plugin.
Plugins - Archive of obsolete content
scripting plugins: macromedia flash this article explains how javascript can be used to access methods from within the flash plugin, as well as how a feature called fscommands can be used to access javascript functions from within the flash animation.
... categories interwiki language links join the plugin development community choose your preferred method for joining the discussion: mailing list newsgroup rss feed ...
Encryption and Decryption - Archive of obsolete content
one method of breaking a symmetric algorithm is to simply try every key within the full algorithm until the right key is found.
... the key strength of an algorithm is determined by finding the fastest method to break the algorithm and comparing it to a brute force attack.
Displaying notifications (deprecated) - Archive of obsolete content
creating a notification the first thing you need to do is create the notification object by using the navigator.moznotification object's createnotification() method, as follows: var notification = navigator.moznotification.createnotification( "hey, check this out!", "this is a notification posted by " + "firefox 4.
...eelement("p"); e.innerhtml = "<strong>the notification was clicked.</strong>"; document.body.appendchild(e); }; notification.onclose = function() { var e = document.createelement("p"); e.innerhtml = "<strong>the notification was closed.</strong>"; document.body.appendchild(e); }; displaying the notification once the notification is configured the way you want it to be, call its show() method to display the notification: notification.show(); on android, for example, the resulting notification panel looks like this: when the user taps on the "hey, check this out!" notification here, the resulting changes to the document look like this: if you're using firefox mobile, you can see this example live by tapping the button below.
Array.observe() - Archive of obsolete content
the array.observe() method was used for asynchronously observing changes to arrays, similar to object.observe() for objects.
... changes done via array methods, such as array.prototype.pop() will be reported as "splice" changes.
ArrayBuffer.transfer() - Archive of obsolete content
the static arraybuffer.transfer() method returns a new arraybuffer whose contents have been taken from the oldbuffer's data and then is either truncated or zero-extended by newbytelength.
... description the arraybuffer.transfer() method allows you to grow and detach arraybuffer objects.
Function.prototype.isGenerator() - Archive of obsolete content
the non-standard isgenerator() method used to determine whether or not a function is a generator.
... description the isgenerator() method determines whether or not the function fun is a generator.
ActiveXObject - Archive of obsolete content
in the following example, you access properties and methods of the new object using the object variable excelsheet and other excel objects, including the application object and the activesheet.cells collection.
...excelsheet.saveas("c:\\test.xls"); // close excel with the quit method on the application object.
Debug - Archive of obsolete content
its properties and methods are called off the debug class.
... if the script is not being debugged, the debug methods and properties have no effect.
Enumerator.item - Archive of obsolete content
the enumerator.item method returns the current item in the collection.
... the item method returns the current item.
Enumerator.moveFirst - Archive of obsolete content
the enumerator.movefirst method resets the current item in the collection to the first item.
... example in following example, the movefirst method is used to evaluate members of the drivescollection from the beginning of the list: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3) + " gb f...
Enumerator.moveNext - Archive of obsolete content
the enumerator.movenext method moves the current item to the next item in the collection.
... example in following example, the movenext method is used to move to the next drive in the drives collection: function showdrives() { var s = ""; var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); var e = new enumerator(fso.drives); e.movefirst(); while (e.atend() == false) { var drv = e.item(); s += drv.path + " - "; if (drv.isready) { var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; s += freegb.tofixed(3...
VBArray.dimensions - Archive of obsolete content
the vbarray.dimensions method returns the number of dimensions in a vbarray.
... example the dimensions method provides a way to retrieve the number of dimensions in a specified vbarray.
VBArray - Archive of obsolete content
the dimensions method retrieves the number of dimensions in the array; the lbound and ubound methods retrieve the range of indices used by each dimension.
... methods vbarray.dimensions returns the number of dimensions in a vbarray.
New in JavaScript 1.1 - Archive of obsolete content
--> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_infinity number.positive_infinity new methods array.prototype.join() array.prototype.reverse() array.prototype.sort() array.prototype.split() new operators typeof void other new features <noscript> liveconnect.
... eval() is now a method of every object (was previously a built-in function); it evaluates a string of javascript code in the context of the specified object.
New in JavaScript 1.8.5 - Archive of obsolete content
strict mode support array.tostring() now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its tostring() method.
... changed functionality in javascript 1.8.5 iso 8601 support in date: the date object's parse() method now supports simple iso 8601 format date strings.
Object.prototype.eval() - Archive of obsolete content
the object.eval() method used to evaluate a string of javascript code in the context of an object, however, this method has been removed.
... description the eval method can no longer be used as a method of an object.
Reflect.enumerate() - Archive of obsolete content
the static reflect.enumerate() method used to return an iterator with the enumerable own and inherited properties of the target object, but has been removed in ecmascript 2016 and is deprecated in browsers.
... description the reflect.enumerate method returns an iterator with the enumerable own and inherited properties of the target object.
String.prototype.quote() - Archive of obsolete content
the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes (").
... examples using quote in the table below the quote() method replaces any special characters and wraps the strings in double-quotes.
for each...in - Archive of obsolete content
these include all built-in methods of objects, e.g.
... string's indexof method.
Troubleshooting XForms Forms - Archive of obsolete content
on most webservers you cannot use <submission method="post" action="file.xml"> to a static xml file.
... you need to use method="get", or <instance src="file.xml"> if the instance is always needed.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
here is an example using this invocation method: <object classid="java:nervoustext.class" width="534" height="50"> <param name="text" value="java 2 sdk, standard edition v1.4" /> <p>you need the java plugin.
...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.
XUL Parser in Python - Archive of obsolete content
at the middle of it is a subclass of the xmllib parser that overrides that parser's unknown_starttag method and asks it to do all the work.
...if you want to look for certain widgets within the xul files, you can get the filename from the calling method p.feed(data) and create a condition that only gets the elements specified in sys.argv[1].
Building up a basic demo with PlayCanvas editor - Game development
add this code to the initialize() function: this.timer = 0; and those two lines to the update() function: this.timer += dt; this.entity.setlocalscale(1, math.abs(math.sin(this.timer)), 1); the setlocalscale() method applies the given values to the x, y and z axes of the object.
... next, add the following line to the initialize() function: this.timer = 0; to move the cone up and down we will use the setposition() method — add the code below to the update() function: this.timer += dt; this.entity.setposition(2, math.sin(this.timer*2), 0); the position of the cone will be animated on each frame by being passed the math.sin() value of the timer at each point in time — we have doubled the this.timer value to make it move higher.
Audio for Web games - Game development
although the situation is soon going to get better with the adoption of the web audio api, the current most widely-supported method — using the vanilla <audio> element — leads to patchy results on mobile devices.
...using the playbackrate() method you can even adjust the speed of your music without affecting the pitch, to sync it up better with the action.
Desktop mouse and keyboard controls - Game development
the built in this.game.input.keyboard object manages the input from the keyboard and has a few helpful methods like addkey() and isdown().
...the ondown() function is executed whenever the enter key is pressed — it will launch the clickstart() method, which starts a new game.
Implementing game control mechanisms - Game development
every state has its own default methods: preload(), create(), and update().
...we'll be playing mostly with the mainmenu.js and game.js files, and we'll explain the code inside the create() and update() methods in much more detail in later articles.
Tiles and tilemaps overview - Game development
here are examples showing how to translate from world coordinates to screen coordinates and back again: // these functions assume that the camera points to the top left corner function worldtoscreen(x, y) { return {x: x - camera.x, y: y - camera.y}; } function screentoworld(x,y) { return {x: x + camera.x, y: y + camera.y}; } rendering a trivial method for rendering would just be to iterate over all the tiles (like in static tilemaps) and draw them, substracting the camera coordinates (like in the worldtoscreen() example shown above) and letting the parts that fall outside the view window sit there, hidden.
... an alternative method would be to split the tilemap into big sections (like a full map split into 10 x 10 chunks of tiles), pre-render each one off-canvas and then treat each rendered section as a "big tile" in combination with one of the algorithms discussed above.
Buttons - Game development
adding the button to the game adding the new button to the game is done by using the add.button method.
... add the following lines to the bottom of your create() function: startbutton = game.add.button(game.world.width*0.5, game.world.height*0.5, 'button', startgame, this, 1, 0, 2); startbutton.anchor.set(0.5); the button() method's parameters are as follows: the button's x and y coordinates the name of the graphic asset to be displayed for the button a callback function that will be executed when the button is pressed a reference to this to specify the execution context the frames that will be used for the over, out and down events.
Collision detection - Game development
thanks to phaser there are two parameters passed to the function — the first one is the ball, which we explicitly defined in the collide method, and the second one is the single brick from the bricks group that the ball is colliding with.
... inside the function we remove the brick in question from the screen simply by running the kill() method on it.
Extra lives - Game development
events you have probably noticed the add() and addonce() method calls in the above two code blocks and wondered how they differ.
... the difference is that the add() method binds the given function and causes it to be executed every time the event occurs, while addonce() is useful when you want to have the bound function executed only once and then unbound so it is not executed again.
Load the assets and print them on screen - Game development
to load the asset, we will use the game object created by phaser, executing its load.image() method.
... now, to show it on the screen we will use another phaser method called add.sprite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } this will add the ball to the game and render it on the screen.
Physics - Game development
add the physics.startsystem() method at the beginning of the create function (make it the first line inside the function), as shown below: game.physics.startsystem(phaser.physics.arcade); next, we need to enable our ball for the physics system — phaser object physics is not enabled by default.
...add the following line, again at the bottom of create(): ball.body.velocity.set(150, 150); removing our previous update instructions remember to remove our old method of adding values to x and y from the update() function: function update() { ball.x += 1; ball.y += 1; } we are now handling this properly, with a physics engine.
Visual-js game engine - Game development
see video explanation : if you use editor.js to visual create game object method , you must start ***node build_from_editor_to_visual_js_file.js*** on the end of work.
... features : tile's background draw for images (alias sprite - but for now there's no sprite and frame by frame animation methods).
Visual typescript game engine - Game development
networking is based on websocket full-duplex communication only.you must be conform with classic socket connection methodology.
...ticonnection2.js | | | | | ├── rtcmulticonnection3.js | | | | | ├── linkify.js | | | | | ├── gethtmlmediaelement.js | | | | | ├── socket.io.js | | | | ├── broadcaster-media.ts | | | | ├── broadcaster.ts | | | | ├── connector.ts | | | | ├── network.ts | | | ├── visual-methods/ | | | | ├── sprite-animation.ts | | | | ├── text.ts | | | | ├── texture.ts | | | ├── browser.ts | | | ├── math.ts | | | ├── position.ts | | | ├── resources.ts | | | ├── sound.ts | | | ├── system.ts | | | ├── view-port.ts | | | ├── visual-render.ts | | ├...
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
networking and communications asynchronous communication is a method of exchanging messages between two or more parties in which each party receives and processes messages whenever it's convenient or possible to do so, rather than doing so immediately upon receipt.
... for humans, e-mail is an asynchronous communication method; the sender sends an email and the recipient will read and reply to the message when it's convenient to do so, rather than doing so at once.
CORS - MDN Web Docs Glossary: Definitions of Web-related terms
access-control-allow-methods specifies the method or methods allowed when accessing the resource in response to a preflight request.
... access-control-request-method used when issuing a preflight request to let the server know which http method will be used when the actual request is made.
Cryptanalysis - MDN Web Docs Glossary: Definitions of Web-related terms
cryptanalysis creates techniques to break ciphers, in particular by methods more efficient than a brute-force search.
... in addition to traditional methods like frequency analysis and index of coincidence, cryptanalysis includes more recent methods, like linear cryptanalysis or differential cryptanalysis, that can break more advanced ciphers.
Lossless compression - MDN Web Docs Glossary: Definitions of Web-related terms
lossless compression methods are reversible.
... examples of lossless compression include gzip, brotli, webp, and png, lossy compression, on the other hand, uses inexact approximations by discarding some data from the original file, making it an irreversible compression method.
HTML: A good basis for accessibility - Learn web development
let's have another quick look at the fourth method: <img src="dinosaur.png" aria-labelledby="dino-label"> <p id="dino-label">the mozilla red tyrannosaurus ...
... color should not be used as the sole method of distinguishing links from non-linking content.
HTML: A good basis for accessibility - Learn web development
let's have another quick look at the fourth method: <img src="dinosaur.png" aria-labelledby="dino-label"> <p id="dino-label">the mozilla red tyrannosaurus ...
... color should not be used as the sole method of distinguishing links from non-linking content.
Overflowing content - Learn web development
in addition, some of the methods discussed in sizing items in css may help you create boxes that scale better with varying amounts of content.
... unwanted overflow in web design modern layout methods (described in css layout) manage overflow.
CSS values and units - Learn web development
note: in this tutorial we will look at the common methods of specifying color that have good browser support; there are others but they don't have as good support and are less common.
...it is likely that for most projects you will decide on a color palette and then use those colors — and your chosen method of specifying color — throughout the whole project.
Grids - Learn web development
-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); } <div class="container"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> <div>six</div> <div>seven</div> </div> note: the *gap properties used to be prefixed by grid-, but this has been changed in the spec, as the intention is to make them usable in multiple layout methods.
... see also css grid guides css grid inspector: examine grid layouts previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Multiple-column layout - Learn web development
previous overview: css layout next the multiple-column layout specification gives you a method of laying content out in columns, as you might see in a newspaper.
... summary you now know how to use the basic features of multiple-column layout, another tool at your disposal when choosing a layout method for the designs you are building.
Normal Flow - Learn web development
before digging deeper into different layout methods, it is worth revisiting some of the things you will have studied in previous modules with regard to normal document flow.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
How CSS is structured - Learn web development
applying css to html first, let's examine three methods of applying css to a document: with an external stylesheet, with an internal stylesheet, and with inline styles.
...this is the most common and useful method of bringing css to a document.
Publishing your website - Learn web development
this article doesn't attempt to document all the possible methods.
...then it steps through one method that can work right away for many readers.
Tips for authoring fast-loading HTML pages - Learn web development
use modern ajax methods to manipulate page content for modern browsers, rather than the older approaches based on document.write().
... chunk your content tables for layouts are a legacy method that should not be used anymore.
Looping code - Learn web development
note that we also run the tolowercase() method on the string, so that searches will be case-insensitive.
...have a look at the useful string methods article for help.
Test your skills: Strings - Learn web development
this aim of this skill test is to assess whether you've understood our handling text — strings in javascript and useful string methods articles.
... use a combination of the variables you have and available string properties/methods to trim down the original quote to "i do not like green eggs and ham.", and store it in a variable called revisedquote.
Client-Server Overview - Learn web development
a method that defines the required action (for example, to get a file or to save or update some data).
... the different methods/verbs and their associated actions are listed below: get: get a specific resource (e.g.
Server-side web frameworks - Learn web development
for example, the httprequest object that django passes to every view function contains methods and properties for accessing the target url, the type of request (e.g.
...it provides a robust set of features for web and mobile applications and delivers useful http utility methods and middleware.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
just below the previous ones, which will allow us to toggle a completion state for each todo: @action togglecompletion(todo) { todo.iscompleted = !todo.iscompleted; } updating the template to show completed state finally, we will edit the todo.hbs template such that the checkbox's value is now bound to the iscompleted property on the todo, and so that on change, the togglecompletion() method on the todo service is invoked.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Introduction to client-side frameworks - Learn web development
at could look something like this: function buildtodoitemel(id, name) { const item = document.createelement('li'); const span = document.createelement('span'); const textcontent = document.createtextnode(name); span.appendchild(textcontent) item.id = id; item.appendchild(span); item.appendchild(builddeletebuttonel(id)); return item; } here, we use the document.createelement() method to make our <li>, and several more lines of code to create the properties and children it needs.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Framework main features - Learn web development
angular calls this process dependency injection; vue has provide() and inject() component methods; react has a context api; ember shares state through services.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Componentizing our React app - Learn web development
javascript gives us an array method for transforming data into something else: array.prototype.map().
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
React interactivity: Editing, filtering, conditional rendering - Learn web development
beneath our previous addition, add the following — here we are using the object.keys() method to collect an array of filter_names: const filter_names = object.keys(filter_map); note: we are defining these constants outside our app() function because if they were defined inside it, they would be recalculated every time the <app /> component re-renders, and we don’t want that.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
React resources - Learn web development
most of the time, props are an appropriate method for sharing data; for complex, deeply nested applications, however, they're not always best.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Rendering a list of Vue components - Learn web development
what we really need next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data.
...tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Implementing feature detection - Learn web development
generally, such tests are done via one of the following common patterns: summary of javascript feature detection techniques feature detection type explanation example if member in object check whether a certain method or property (typically an entry point into using the api or other feature you are detecting for) exists in its parent object.
...} method on element return value create an element in memory using document.createelement() and then check if a method exists on it.
Handling common JavaScript problems - Learn web development
it is not so important now we have modern features like document.queryselector()/document.queryselectorall()/node methods available across browsers, but it can still be useful when older browsers need supporting.
... ui libraries: provide methods for implementing complex ui features that would otherwise be challenging to implement and get working cross browser, for example foundation, bootstrap, and material-ui (the latter is a set of components for use with the react framework).
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.
... one way of doing this is to build up the nsiwebbrowseraccessible interface, so that there is a method to force loading each type of content just for the current page in the current session.
Adding a new CSS property
and for shorthands you also need to include a subproperty table in nscssprops, whose name must match the "method" argument in the css_prop_shorthand macro.
... 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.
A bird's-eye view of the Mozilla framework
since all xpcom interfaces inherit the base interface nsisupports, the client can ask whether nsirdfnode supports nsirdfliteral by calling nsirdfnode.queryinterface(), a method in the nsisupports interface.
... var resource = rdf.getresource(rdfid); nsirdfcompositedatasource inherits from nsirdfdatasource, which supports a gettarget() method for obtaining the nsirdfnode for a given resource and property.
Browser chrome tests
notice that any function call in head.js main scope will run before the main test() method.
... asynchronous tests when writing async tests, you can use the add_task method with promises.
Debugging on Windows
avoiding stepping into certain functions you can avoid stepping into certain functions, such as nscomptr methods, using an undocumented feature of vc.
...omptr.*\:\:.*=nostepinto (nsg|g)etter_*addrefs.*=nostepinto ns_convertutf.* ; might be too broad: (ns|promise)[^\:]*[ss]tring.* ...add common functions to this list should probably make a .reg file for easy importing obtaining stdout and other file handles running the following command in the command window in visual studio returns the value of stdout, which can be used with various debugging methods (such as nsgenericelement::list) that take a file* param: debug.evaluatestatement {,,msvcr80d}(&__iob_func()[1]) (alternatively you can evaluate {,,msvcr80d}(&__iob_func()[1]) in the quickwatch window) similarly, you can open a file on the disk using fopen: >debug.evaluatestatement {,,msvcr80d}fopen("c:\\123", "w") 0x10311dc0 { ..snip..
How Mozilla's build system works
the child class implements methods for processing individual class instances as well as common hook points, such as processing has finished.
...the terminating $(null) is a method for consistency; it allows you to add and remove lines without worrying about whether the last line has an ending backslash or not.
Callgraph
this can be used for performing static analysis based on the relationship between functions and methods.
...the callgraph project uses gcc and treehydra to generate information about function and method calls at compile time, and aggregates it into a sqlite database.
Eclipse CDT Manual Setup
note the requirements that this method of build option discovery imposes on us.
...if you're interested in future improvements to eclipse that would allow parallel builds to be run from inside eclipse while still allowing it to obtain the compiler options, see the faq isn't there a better method of build option discovery?
Reviewer Checklist
[fennec: all view methods should be touched only on ui thread.] [fennec: activity lifecycle awareness (works with "never keep activities").
... use javadocs extensively, especially on any new non-private methods.
Communicating with frame scripts
removemessagelistener() to stop listening for messages from content, use the message manager's removemessagelistener() method: // chrome script messagemanager.removemessagelistener("my-addon@me.org:my-e10s-extension-message", listener); chrome to content to send a message from chrome to content, you need to know what kind of message manager you're using.
... if it's a browser message manager, you can use the message manager's sendasyncmessage method: // chrome script browser.messagemanager.sendasyncmessage("my-addon@me.org:message-from-chrome"); if you have a window or a global message manager, you need to use the broadcastasyncmessage method: // chrome script window.messagemanager.broadcastasyncmessage("my-addon@me.org:message-from-chrome"); these methods takes one mandatory parameter, which is the message name.
Performance best practices for Firefox front-end engineers
other useful methods below you'll find some suggestions for other methods which may come in handy when you need to do things without incurring synchronous reflow.
... these methods generally return the most-recently-calculated value for the requested value, which means the value may no longer be current, but may still be "close enough" for your needs.
HTMLIFrameElement.clearMatch()
the clearmatch() method of the htmliframeelement clears any content highlighted by findall() or findnext().
... invoking this method results in a mozbrowserfindchange event firing, which carries details about the search results.
HTMLIFrameElement.findAll()
the findall() method of the htmliframeelement searches for a string in a browser <iframe>'s text content; if found, the first instance of the string relative to the caret position will be highlighted.
... invoking this method results in a mozbrowserfindchange event firing, which carries details about the search results.
HTMLIFrameElement.findNext()
the findnext() method of the htmliframeelement highlights the next or previous instance of a search result after a findall() search has been carried out.
... invoking this method results in a mozbrowserfindchange event firing, which carries details about the search results.
HTMLIFrameElement.getMuted()
the getmuted() method of the htmliframeelement indicates whether the browser <iframe> is currently muted.
... syntax there are two versions of this method, a callback version: var request = instanceofhtmliframeelement.getmuted(); and a promise version: instanceofhtmliframeelement.getmuted().then(function(muted) { ...
HTMLIFrameElement.getVolume()
the getvolume() method of the htmliframeelement gets the current volume of the browser <iframe>.
... syntax there are two versions of this method, a callback version: var request = instanceofhtmliframeelement.getvolume(); and a promise version: instanceofhtmliframeelement.getvolume().then(function(volume) { ...
HTMLIFrameElement.goBack()
the goback() method of the htmliframeelement interface is used to navigate backwards in the browser <iframe>'s history.
... by calling this method, the browser <iframe> changes its location for the previous location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart, and so on.
HTMLIFrameElement.goForward()
the goforward() method of the htmliframeelement is used to navigate forward in the browser <iframe>'s history.
... by calling this method, the browser <iframe> changes its location to the next location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart and so on.
HTMLIFrameElement.sendTouchEvent()
the sendtouchevent() method of the htmliframeelement allows you to fake a touch event and send it to the browser <iframe>'s content.
... note: this method is available for touch-enabled devices only.
HTMLIFrameElement.setVisible()
the setvisible() method of the htmliframeelement is used to change the visibility state of the browser <iframe>.
... as an example, if the content of a browser <iframe> uses the window.requestanimationframe method and if the visible state is set to true, window.requestanimationframe will be called as often as necessary.
IME handling guide
introduction ime is an abbreviation of input method editor.
...these methods automatically manage composition state and dispatch widgetcompositionevent properly.
Creating a New Protocol
it must implement abstract methods for receiving the appropriate messages on each side.
... the method signatures can be read from the generated pnewprotocolparent.h and pnewprotocolchild.h headers.
Implementing QueryInterface
a reference implementation of queryinterface ns_imethodimp nsmyimplementation::queryinterface( refnsiid aiid, void** ainstanceptr ) { ns_assertion(ainstanceptr, "queryinterface requires a non-null destination!"); // it's a logic error, not a runtime error, to call me without any place to put my answer!
...}; ns_imethodimp nsmyimplementation::queryinterface( refnsiid aiid, void** ainstanceptr ) /* i just add the interfaces |nsix| and |nsiy|.
AddonUpdateChecker
to import the addonupdatechecker, use: components.utils.import("resource://gre/modules/addonupdatechecker.jsm"); method overview updateinfo getcompatibilityupdate(in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string platformversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constan...
... methods getcompatibilityupdate() retrieves the best matching compatibility update for the application from a list of available update objects.
InstallListener
method overview void onnewinstall(in addoninstall install) void ondownloadstarted(in addoninstall install) void ondownloadprogress(in addoninstall install) void ondownloadended(in addoninstall install) void ondownloadcancelled(in addoninstall install) void ondownloadfailed(in addoninstall install) void oninstallstarted(in addoninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstallcancelled(in addoninstall install) void oninstallfailed(in addoninstall install) void...
... onexternalinstall(in addon install, in addon existingaddon, in boolean needsrestart) methods onnewinstall() called when a new instance of addoninstall is created, primarily so ui can display some kind of progress for all installs.
UpdateListener
for each individual update check, the following methods will be called on the listener: either oncompatibilityupdateavailable() or onnocompatibilityupdateavailable(), depending on whether compatibility information for the requested application version was seen.
... method overview void oncompatibilityupdateavailable(in addon addon) void onnocompatibilityupdateavailable(in addon addon) void onupdateavailable(in addon addon, in addoninstall install) void onnoupdateavailable(in addon addon) void onupdatefinished(in addon addon, in integer error) methods oncompatibilityupdateavailable() called when the update check found compatibility information for the application and platform version that the update check was being performed for.
Add-on Repository
to import the add-on repository code module, use: components.utils.import("resource://gre/modules/addonrepository.jsm"); method overview string getrecommendedurl() string getsearchurl(in string searchterms) void cancelsearch() void retrieverecommendedaddons(in integer maxresults, in searchcallback callback) void searchaddons(in string searchterms, in integer maxresults, in searchcallback callback) properties property type description homepageurl...
... methods getrecommendedurl() returns the url that can be visited to see recommended add-ons.
FileUtils.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/fileutils.jsm"); the file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method overview nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifi...
... perms_directory 0755 default permissions when creating directories methods getfile() gets a file at the specified hierarchy under a nsidirectoryservice key.
Http.jsm
method get, post or put (this is automatically set if postdata exists).
... logger an object that implements the debug and log methods (e.g.
ISO8601DateUtils.jsm
the iso8601dateutils.jsm javascript code module provides methods that make it easy to convert javascript date objects into iso 8601 format date strings and back.
...using the iso 8601 date utilities to convert a date string into a date object, simply use: dateobj = iso8601dateutils.parse(datestring); to convert a date object into a date string: datestring = iso8601dateutils.create(dateobj); method overview string create(adate); date parse(adatestring); methods create creates an iso 8601 format date string, e.g.
OS.File.Error
} catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods overview the following functions are utility functions that may be used to construct instances of os.file.error, setting the platform-specific error number.
... error closed() error exists() methods os.file.error.closed() return an error representing the fact that a file is closed.
Localizing extension descriptions
because a new method for doing so was implemented in gecko 1.9 (firefox 3), there are two sets of instructions below.
... localizing in gecko 1.9 gecko 1.9 includes a new, more robust method for localizing add-on descriptions and other metadata.
Mozilla Style System
the barrier between these two halves consists of three abstract interfaces, plus some smaller structures associated with some methods on each: nsistylesheet nsistylesheet represents what one would think of as a style sheet: the in-memory representation of a css file or other source of style data.
...the methods on nsistyleruleprocessor allow the front end to ask the back ends for the style data that applies to a given element or pseudo-element, in the form of style rules.
BloatView
this could indicate a hand-written release method (that doesn't use the ns_log_release macro from nstracerefcnt.h), or perhaps you're just not freeing any of the instances you've allocated.
...y configs you'll want to modify are listed below: linux: unittests/linux_unittest.py mac: unittests/mac_unittest.py windows: unittests/win_unittest.py android: android/androidarm_4_3.py how to instrument your objects for bloatview first, if your object is an xpcom object and you use the ns_impl_addref and ns_impl_release (or a variation thereof) macro to implement your addref and release methods, then there is nothing you need do.
Investigating leaks using DMD heap scan mode
fortunately, this method mostly just contains two calls to new, one for scriptloadrequest and one for moduleloadrequest.
...i then added the missing field to the traverse and unlink methods of scriptloadrequest, and confirmed that i couldn’t reproduce the leak.
DMD
(if you are familiar with the recommended "--es env0" method for setting environment variables when launching fennec, note that you cannot use this method here because those are processed too late in the startup process.
... if you are not familiar with that method, you can ignore this parenthetical note.) first make the executable wrapper on your host machine using the editor of your choice.
Measuring performance using the PerfMeasurement.jsm code module
now we want to benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start recording, and stop() when we want to stop recording.
... when you're done benchmarking, you can read out each of the counters you asked for as properties: let report = "cpu cycles: " + monitor.cpu_cycles + "\n" + "cache refs: " + monitor.cache_references + "\n" + "cache misses: " + monitor.cache_misses + "\n"; monitor.reset(); alert(report); the reset() method clears all of the enabled counters, as you might expect.
AsyncTestUtils extended framework
asynctestutils is currently implemented by the first method (yielding control to the top-level event loop).
...if you need to get fancy about having flags set on the folder, we support that, but please check the method documentation.
Leak And Bloat Tests
method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc).
... the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data.
Midas
once midas is invoked, a few more methods of the document object become available.
... examples this example shows the basic structure described in the notes section : <html> <head> <title>simple edit box</title> </head> <body> <iframe id="midasform" src="about:blank" onload="this.contentdocument.designmode='on';" ></iframe> </body> </html> methods document.execcommand executes the given command.
I/O Functions
the file descriptor of the top layer can be passed to nspr i/o functions, which invoke the appropriate version of the i/o methods polymorphically.
...for example, the following lines of code are equivalent: rv = pr_pushiolayer(stack, pr_top_io_layer, my_layer); rv = pr_pushiolayer(stack, pr_getlayersidentity(stack), my_layer); pr_getuniqueidentity pr_getnameforidentity pr_getlayersidentity pr_getidentitieslayer pr_getdefaultiomethods pr_createiolayerstub pr_pushiolayer pr_popiolayer ...
PRFileDesc
syntax #include <prio.h> struct prfiledesc { priomethods *methods; prfileprivate *secret; prfiledesc *lower, *higher; void (*dtor)(prfiledesc *fd); prdescidentity identity; }; typedef struct prfiledesc prfiledesc; parameters methods the i/o methods table.
... see priomethods.
NSS 3.15.4 release notes
bug 919877 - (cve-2013-1740) when false start is enabled, libssl will sometimes return unencrypted, unauthenticated data from pr_recv new in nss 3.15.4 new functionality implemented ocsp querying using the http get method, which is the new default, and will fall back to the http post method.
... new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post.
NSPR functions
pr_getuniqueidentity pr_createiolayerstub pr_getdefaultiomethods pr_getidentitieslayer pr_getlayersidentity pr_pushiolayer pr_popiolayer wrapping a native file descriptor if your current tcp socket code uses the standard bsd socket api, a lighter-weight method than creating your own nspr i/o layer is to simply import a native file descriptor into nspr.
... this method is convenient and works for most applications.
NSS tools : vfychain
-m method type sets method type for the test type it follows.
...-s method flags sets revocation flags for the method it follows.
NSS tools : vfychain
-m method type sets method type for the test type it follows.
... -s method flags sets revocation flags for the method it follows.
Proxies in Necko
note that the proxy method is only used when the protocol handler supports http proxies, as indicated by its protocol flags.
...socks and nsisockettransportservice the aforementioned methods work very well for application-level proxies.
Rhino requirements and limitations
limitations liveconnect if a javaobject's field's name collides with that of a method, the value of that field is retrieved lazily, and can be counter-intuitively affected by later assignments: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod; javaobj.fieldandmethod = 7; // now, field == 7 you can work around this by forcing the field value to be converted to a javascript type when you take its value: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod + 0; // for...
...ce conversion now javaobj.fieldandmethod = 7; // now, field == 5 jsobject rhino does not support the netscape.javascript.jsobject class.
Hacking Tips
ed char *) ($pc - 1) = 0x90 (gdb) x /1i $pc - 1 0x7ffff7fb1659: nop (gdb) # set a breakpoint at the previous location (gdb) b *0x7ffff7fb1659 breakpoint 2 at 0x7ffff7fb1659 printing ion generated assembly code (from gdb) if you want to look at the assembly code generated by ionmonkey, you can follow this procedure: place a breakpoint at codegenerator.cpp on the codegenerator::link method.
...this method of profiling has the advantage of mixing the javascript stack with the c++ stack, which is useful to analyze library function issues.
Garbage collection
typically, a weak pointer value has a get() method that returns a null pointer if the object has been gc'd.
...thus, there is no get() method and no protection against the pointed-to value getting gc'd--the programmer must ensure that the lifetime of the pointed-to object contains the lifetime of the weak pointer.
JS::GetFirstArgumentAsTypeHint
convert first argument of @@toprimitive method to jstype.
... description js::getfirstargumentastypehint converts first argument of @@toprimitive method to jstype.
JSClass.call
var x = { specialmethod: custom }; x.specialmethod(); // the jsclass.call hook receives x as the obj parameter.
... new x.specialmethod(); // the jsclass.construct hook receives x as the obj parameter.
JSNewEnumerateOp
this callback overrides a portion of spidermonkey's default [[enumerate]] internal method.
...this callback overrides a portion of spidermonkey's default [[enumerate]] internal method.
JSPrincipals
obsolete since jsapi 13 methods name description void dump() this is not defined by the js engine but should be provided by the embedding.
... see also mxr id search for jsprincipals js_newglobalobject js_holdprincipals js_dropprincipals bug 715417 - removed getprincipalarray and globalprivilegesenabled bug 728250 - added dump method, removed codebase, destroy, and subsume properties bug 884676 - changed refcount type to mozilla::atomic ...
JS_CompileFunction
if both obj and name are non-null, the new function becomes a method of obj.
... see also mxr id search for js_compilefunction mxr id search for js_compileucfunction jsfun_bound_method jsfun_global_parent js_callfunction js_callfunctionname js_callfunctionvalue js_decompilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction bug 1089026 ...
JS_DefineFunctions
add native methods to an object.
... description js_definefunctions creates zero or more functions and makes them properties (methods) of a specified object, obj, as if by calling js_definefunction repeatedly.
JS_DefinePropertyWithTinyId
getter jspropertyop getproperty method for retrieving the current property value.
... setter jspropertyop setproperty method for specifying a new property value.
JS_FS
for example, use js_sym_fn(iterator, ...) to define an @@iterator method.
... (in builds without es6 symbols, it defines a method with the string id "@@iterator".) see an example in the jsapi user guide.
JS_FreezeObject
see es5's object.freeze method.
... see also mxr id search for js_freezeobject javascript reference: the object.freeze method of object js_deepfreezeobject bug 492849 ...
JS_HasInstance
jsapi method equivalent to the instanceof operator in javascript.
...when providing a prototype as obj, the prototype's jsclass must have its hasinstance method set.
JS_SetFunctionCallback
this lets you trace the execution of code, and is particularly useful for javascript tracers and profilers since it works across all run modes (interpreter, method jit, trace jit).
... note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls.
JS_SetProperty
if obj is a proxy, the js_setproperty [[set]] internal method defined in es2015 (rev 29 9.5.9) is performed.
... otherwise, [[set]] internal method defined in es2015 (rev 29 9.1.9) is performed.
JS_ThrowStopIteration
in for…in and for each…in loops, the javascript engine can create an iterator object and call its .next method repeatedly, as described in new in javascript 1.7: iterators.
... the .next method may throw stopiteration when there are no more values left to iterate.
JS_ValueToString
(this behavior is implemented by v's jsobjectops.defaultvalue method, so host objects can override it all.) if v.tostring() is a function, it is called.
... if that method returns a primitive value, the value is converted to a string as described above and conversion succeeds.
SpiderMonkey 38
(see bug 1063962.) js_preventextensions now indicates its success or failure in two ways: via return value (as with most jsapi methods), and via outparam (indicating whether the attempt took effect or not, independent of jsapi failure).
... javascript shell changes detail added/removed methods here...
Using the Places livemark service
initiating the livemark service before using the livemark service, you need to obtain an instance: var livemarkservice = components.classes["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); creating a new livemark the nsilivemarkservice.createlivemark() method creates a new livemark.
... determine whether a folder is a livemark you can use the nsilivemarkservice.islivemark() method to determine whether or not a given folder is a livemark container: if (livemarkservice.islivemark(folderid)) { // it's a livemark } else { // it's not a livemark } accessing the container's site uri the nsilivemarkservice.getsiteuri() method lets you obtain the nsiuri of the website associated with a livemark container.
extIApplication
method overview boolean quit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type description id readonly attribute astring the id of the application.
... methods quit() attempts to shutdown the application.
extIExtension
method overview fixme: attributes attribute type description id readonly attribute astring the id of the extension.
...supports: "uninstall" methods fixme: see also see extapplication.js line:395 for the implementation of firstrun.
extIPreferenceBranch
method overview boolean has(in astring aname) extipreference get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute astring the name of the branch root.
... events readonly attribute extievents the events object for the preferences supports: "change" methods has() check to see if a preference exists.
extISessionStorage
method overview these methods are usually accessed via application.storage.
... return type method boolean has(in astring aname) void set(in astring aname, in nsivariant avalue) nsivariant get(in astring aname, in nsivariant adefaultvalue) attributes attribute type description events readonly attribute extievents the events object for the storage supports: "change" methods has() determines if a storage item exists with the given name.
XML Extras
qa and testing there are some online tests for mainly exercising the http get method via xmlhttprequest.
...the "workaround" is to use domparser object's parsefromstring() method to create a document from string, and pass the temporary document into send().
Creating a Python XPCOM component
def __del__(self): if verbose: print "pysimple: __del__ method called - object is destructing" def write(self): print self.yourname def change(self, newname): self.yourname = newname then register your component; the procedure is the same for any component, but will not work if python components weren't enabled.
... # _reg_clsid_ = "{a new clsid generated for this object}" # _reg_contractid_ = "the.object.name" def get_value( self ): # result: string pass def set_value( self, param0 ): # result: void - none # in: param0: string pass as you can see, the output is valid python code, with basic signatures and useful comments for each of the methods.
Avoiding leaks in JavaScript XPCOM components
the workaround is simple: we have a destroy method on browser that tabbrowser can call when it's done with a browser.
... this destroy method assigns null to the problematic properties so that the large objects are no longer reachable from the wrapper of the browser element (which will still leak until the window containing the tabbrowser is closed, but it's a much smaller leak).
Making cross-thread calls using runnables
#include "nsthreadutils.h" class piresulttask : public nsrunnable { public: piresulttask(picallback callback, const nsacstring& result) : mcallback(callback) , mresult(result) , mworkerthread(do_getcurrentthread()) { moz_assert(!ns_ismainthread()); // this should be running on the worker thread } ns_imethod run() { moz_assert(ns_ismainthread()); // this method is supposed to run on the main thread!
... mworkerthread->shutdown(); } private: picallback mcallback; nscstring mresult; nscomptr<nsithread> mworkerthread; }; class picalculatetask : public nsrunnable { public: picalculatetask(picallback callback, int digits) : mcallback(callback) , mdigits(digits) { } ns_imethod run() { nscstring result; calculatepi(mdigits, result); nscomptr<nsirunnable> resultrunnable = new piresulttask(mcallback, result); ns_dispatchtomainthread(resultrunnable); } private: picallback mcallback; int mdigits; }; putting it all together to start a new thread, create it using the thread manager: #include "nsxpcomcidinternal.h" void calculatepiasynchronously(int di...
Receiving startup notifications
registering with the category manager to register with the category manager, simply call its nsicategorymanager.addcategoryentry() method: categorymanager->addcategoryentry(appstartup_category, "mycomponentname", "contract-id", pr_true, pr_true, getter_copies(previous)); this causes your component to be instantiated using nsicomponentmanager.createinstance().
...what happens next once you've registered with the category manager, at mozilla startup time (or when the embedding application's ns_initembedding() function is called), the appstartupnotifier component is instantiated, and its observe() method is called; this in turn enumerates all components in the app-startup category and sends them the appropriate notifications.
How To Pass an XPCOM Object to a New Window
a more useful example is available in the source code: toolkit/components/help/content/contexthelp.js#61 if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.
... getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/debug.xul", "debug history", "chrome,centerscreen,resizable", myobject); note in this example that myobject is passed to the openwindow() method; you can pass any xpcom object (or any other value, for that matter) in this way.
Components.interfaces
properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid.
...xpidl) may not only contain method declarations, but also constants.
Components.returnCode
usage components.returncode is a property that can be used to indicate to an xpcom caller of the javascript method that the method is returning a specific nsresult code.
...by default the successful completion of the javascript method will cause xpconnect to return a result code of ns_ok to the caller.
Components.utils.getWeakReference
this method was introduced in firefox 3 and is used for obtaining a weak reference for an object.
... note: in gecko 11.0, this method was changed to throw an exception if obj is null.
Components.utils.importGlobalProperties
example components.utils.import("resource://gre/modules/devtools/console.jsm"); components.utils.importglobalproperties(["atob", "btoa"]); var encoded = btoa("hello"); console.log(encoded); // "sgvsbg8=" console.log(atob(encoded)); // "hello" alternative methods if importglobalproperties does not support the targeted firefox version, here are some alternative methods to import these objects.
... import from jsm this method worked until blob and file were no longer apart of jsm modules.
Components.utils.makeObjectPropsNormal
ensures that the specified object's methods are all in the object's scope, and aren't cross-component wrappers.
... syntax void components.utils.makeobjectpropsnormal(obj); parameters obj the object for which to ensure all methods are in its scope.
Components.utils.unload
once this method has been called, references to the module will continue to work but any subsequent import of the module will reload it and give a new reference.
... if the javascript code module has not yet been imported then this method will do nothing.
NS_ShutdownXPCOM
remarks you must call this method once you are finished using xpcom.
... calling this method triggers the "xpcom-shutdown" notification to be dispatched to observers.
NS ConvertASCIItoUTF16 external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find ...
...methods constructors void ns_convertasciitoutf16_external(const nsacstring&) - source parameters nsacstring& astr void ns_convertasciitoutf16_external(const char*, pruint32) - source parameters char* adata pruint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring ...
NS ConvertUTF16toUTF8 external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...methods constructors void ns_convertutf16toutf8_external(const nsastring&) - source parameters nsastring& astr void ns_convertutf16toutf8_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=...
NS ConvertUTF8toUTF16 external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find ...
...methods constructors void ns_convertutf8toutf16_external(const nsacstring&) - source parameters nsacstring& astr void ns_convertutf8toutf16_external(const char*, pruint32) - source parameters char* adata pruint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring ...
NS LossyConvertUTF16toASCII external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...methods constructors void ns_lossyconvertutf16toascii_external(const nsastring&) - source parameters nsastring& astr void ns_lossyconvertutf16toascii_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstrin...
PromiseFlatCString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
...methods get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pruint32) - source parameters char* adata pruint32 alength beginreading ...
PromiseFlatString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind fin...
...methods get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pruint32) - source parameters prunichar* ad...
nsACString (External)
f8_external" shape="rect" title="ns_convertutf16toutf8_external"> <area alt="" coords="499,294,779,342" href="http://developer.mozilla.org/en/ns_lossyconvertutf16toascii_external" shape="rect" title="ns_lossyconvertutf16toascii_external"> <area alt="" coords="803,294,925,342" href="http://developer.mozilla.org/en/nsliteralcstring_(external)" shape="rect" title="nsliteralcstring_(external)"></map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut ...
...methods beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
nsAString (External)
rtasciitoutf16_external" shape="rect" title="ns_convertasciitoutf16_external"> <area alt="" coords="491,294,733,342" href="http://developer.mozilla.org/en/ns_convertutf8toutf16_external" shape="rect" title="ns_convertutf8toutf16_external"> <area alt="" coords="757,294,869,342" href="http://developer.mozilla.org/en/nsliteralstring_(external)" shape="rect" title="nsliteralstring_(external)"> </map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> ...
...methods beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
nsAutoString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind fin...
...methods get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar adopt void adopt(const prunichar*, pruint32) - source parameters prunichar* ad...
nsCAutoString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
...methods get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar adopt void adopt(const char*, pruint32) - source parameters char* adata pruint32 alength beginreading ...
nsCStringContainer (External)
class declaration method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= operator>...
...methods beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
nsCString external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...methods constructors void nscstring_external() - source void nscstring_external(const nscstring_external&) - source parameters nscstring_external& astring void nscstring_external(const nsacstring&) - source parameters nsacstring& areadable void nscstring_external(const char*, pruint32) - source parameters char* adata pruint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& as...
nsDependentCString external
class declaration method overview constructors rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind ...
...methods constructors void nsdependentcstring_external() - source void nsdependentcstring_external(const char*, pruint32) - source parameters char* adata pruint32 alength rebind void rebind(const char*, pruint32) - source parameters char* adata pruint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source ...
nsDependentCSubstring external
class declaration method overview constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindch...
...methods constructors void nsdependentcsubstring_external() - source void nsdependentcsubstring_external(const char*, pruint32) - source parameters char* astart pruint32 alength void nsdependentcsubstring_external(const nsacstring&, pruint32) - source parameters nsacstring& astr pruint32 astartpos void nsdependentcsubstring_external(const nsacstring&, pruint32, pruint32) - source parameters nsacstring& astr pruint32 astartpos pruint32 alength rebind void rebind(const char*, pruint32) - source parameters ...
nsDependentString external
class declaration dependent strings method overview constructors rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercas...
...methods constructors void nsdependentstring_external() - source void nsdependentstring_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength rebind void rebind(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring ...
nsDependentSubstring external
class declaration substrings method overview constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator<= ...
...methods constructors void nsdependentsubstring_external() - source void nsdependentsubstring_external(const prunichar*, pruint32) - source parameters prunichar astart pruint32 alength void nsdependentsubstring_external(const nsastring&, pruint32) - source parameters nsastring astr pruint32 astartpos ...
nsEmbedCString
methods nsembedcstring constructors for nsembedcstring.
... remarks the methods defined on nsembedcstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_cstring.
nsEmbedString
methods nsembedstring constructors for nsembedstring.
... remarks the methods defined on nsembedstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_string.
nsLiteralCString (External)
class declaration method overview rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar r...
...methods rebind void rebind(const char*, pruint32) - source parameters char* adata pruint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar ...
nsLiteralString (External)
class declaration method overview rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar r...
...methods rebind void rebind(const char*, pruint32) - source parameters char* adata pruint32 alength get char* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar ...
nsStringContainer (External)
class declaration method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar ...
...methods beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
nsString external
class declaration basic strings method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral ...
...methods constructors void nsstring_external() - source void nsstring_external(const nsstring_external&) - source parameters nsstring_external& astring void nsstring_external(const nsastring&) - source parameters nsastring& areadable void nsstring_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get prunichar* get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source ...
XPCOM glue classes
clarationns convertutf16toutf8 externalclass declarationns convertutf8toutf16 externalclass declarationns lossyconvertutf16toascii externalclass declarationns_convertasciitoutf16class declarationns_convertutf16toutf8class declarationns_convertutf8toutf16class declarationns_lossyconvertutf16toasciiclass declarationns_overridens_override is a macro which allows c++ code in mozilla to specify that a method is intended to override a base class method.
... if there is no base class method with the same signature, a compiler with static-checking enabled will fail to compile.ns_postconditionmacrons_preconditionmacronsacstringthe nsacstring abstract class represents a character string composed of single-byte storage units.
IAccessible2
1.0 66 introduced gecko 1.9 inherits from: iaccessible last changed in gecko 1.9 (firefox 3) method overview [propget] hresult attributes([out] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult indexinparent([out] long indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole([ou...
...n relations, [out] long nrelations ); hresult role([out] long role ); hresult scrollto([in] enum ia2scrolltype scrolltype ); hresult scrolltopoint([in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult states([out] accessiblestates states ); [propget] hresult uniqueid([out] long uniqueid ); [propget] hresult windowhandle([out] hwnd windowhandle ); methods attributes() returns the attributes specific to this iaccessible2 object, such as a cell's formula.
IAccessibleTable
method overview [propget] hresult accessibleat([in] long row, [in] long column, [out] iunknown accessible ); [propget] hresult caption([out] iunknown accessible ); [propget] hresult childindex([in] long rowindex, [in] long columnindex, [out] long cellindex ); [propget] hresult columndescription([in] long column, [out] bstr description ); [propget] hresult columnextentat([in] long row, [in] lo...
...s, [out, size_is(,maxcolumns), length_is(, ncolumns)] long columns, [out] long ncolumns ); [propget] hresult selectedrows([in] long maxrows, [out, size_is(,maxrows), length_is(, nrows)] long rows, [out] long nrows ); hresult selectrow([in] long row ); [propget] hresult summary([out] iunknown accessible ); hresult unselectcolumn([in] long column ); hresult unselectrow([in] long row ); methods accessibleat() returns the accessible object at the specified row and column in the table.
IAccessibleTable2
method overview [propget] hresult caption([out] iunknown accessible ); [propget] hresult cellat([in] long row, [in] long column, [out] iunknown cell ); [propget] hresult columndescription([in] long column, [out] bstr description ); [propget] hresult iscolumnselected([in] long column, [out] boolean isselected ); [propget] hresult isrowselected([in] long row, [out] boolean isselected ); [prop...
...lectedcells ); [propget] hresult selectedcolumns([out, size_is(, ncolumns)] long selectedcolumns, [out] long ncolumns ); [propget] hresult selectedrows([out, size_is(, nrows)] long selectedrows, [out] long nrows ); hresult selectrow([in] long row ); [propget] hresult summary([out] iunknown accessible ); hresult unselectcolumn([in] long column ); hresult unselectrow([in] long row ); methods caption() returns the caption for the table.
IAccessibleTableCell
1.0 66 introduced gecko 1.9.2 inherits from: iunknown last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview [propget] hresult columnextent([out] long ncolumnsspanned ); [propget] hresult columnheadercells([out, size_is(, ncolumnheadercells,)] iunknown cellaccessibles, [out] long ncolumnheadercells ); [propget] hresult columnindex([out] long columnindex ); [propget] hresult isselected([out] boolean isselected ); [propget] hresult rowcolumnextents([out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); [propget] hresult rowextent([out] lo...
...ng nrowsspanned ); [propget] hresult rowheadercells([out, size_is(, nrowheadercells,)] iunknown cellaccessibles, [out] long nrowheadercells ); [propget] hresult rowindex([out] long rowindex ); [propget] hresult table([out] iunknown table ); methods columnextent() returns the number of columns occupied by this cell accessible.
amIWebInstallInfo
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void install(); attributes attribute type description installs nsivariant an array of addoninstall objects.
... methods install() starts all installs.
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 nsiur...
... methods onwebinstallblocked() called when the website is not allowed to directly prompt the user to install add-ons.
amIWebInstallPrompt
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void confirm(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
... methods confirm() gets a confirmation that the user wants to start the installs.
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: prior ...
... methods installaddonsfromwebpage() installs an array of add-ons at the request of a webpage.
imgIDecoderObserver
method overview void ondataavailable(in imgirequest arequest, in boolean acurrentframe, [const] in nsintrect arect); native code only!
...; void onstartrequest(in imgirequest arequest); void onstopcontainer(in imgirequest arequest, in imgicontainer acontainer); void onstopdecode(in imgirequest arequest, in nsresult status, in wstring statusarg); void onstopframe(in imgirequest arequest, in unsigned long aframe); void onstoprequest(in imgirequest arequest, in boolean aislastpart); methods native code only!ondataavailable decode notification.
imgIEncoder
1.0 66 introduced gecko 1.8 inherits from: nsiasyncinputstream last changed in gecko 1.9 (firefox 3) method overview void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions); void...
... methods addimageframe() void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions ); parameters data list of bytes in the format specified by inputformat.
inIDOMUtils
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); ...
... value state 1 :active 2 :focus 4 :hover 8 :-moz-drag-over 16 :target 1<<29 :-moz-focusring methods getbindingurls() returns an array of nsiuri objects representing the current xml binding for the specified element.
mozIAsyncFavicons
method overview void getfaviconurlforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void getfavicondataforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void setandfetchfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback ac...
...allback); void replacefavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, [optional] in prtime aexpiration); void replacefavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, [optional] in prtime aexpiration); methods getfaviconurlforpage() retrieve the url of the favicon for the given page.
mozIColorAnalyzer
toolkit/components/places/mozicoloranalyzer.idlscriptable provides methods to analyze colors in an image 1.0 66 introduced gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) method overview void findrepresentativecolor(in nsiuri imageuri, in mozirepresentativecolorcallback callback); methods findrepresentativecolor() given an image uri, find the most representative color for that image based on the frequency of each color.
...if imageuri points to an image that has more than 128^2 pixels, this method will fail for performance reasons before analyzing it.
mozISpellCheckingEngine
method overview void adddirectory(in nsifile dir); boolean check(in wstring word); void getdictionarylist([array, size_is(count)] out wstring dictionaries, out pruint32 count); void removedirectory(in nsifile dir); void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out pruint32 count); at...
... methods adddirectory() adds all the dictionaries in the specified directory to the spell checker.
mozIStorageAggregateFunction
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onstep(in mozistoragevaluearray afunctionarguments); nsivariant onfinal(); methods onstep() this is called for each row of results returned by the query.
...class standarddeviationfunc : public mozistorageaggregatefunction { public: ns_imethod onstep(mozistoragevaluearray *aarguments) { print32 value; nsresult rv = aarguments->getint32(&value); ns_ensure_success(rv, rv); mnumbers.appendelement(value); } ns_imethod onfinal(nsivariant **_result) { print64 total = 0; for (pruint32 i = 0; i < mnumbers.length(); i++) total += mnumbers[i]; print32 mean = total / mnumbers.length(); nstarray<pri...
mozIStorageBindingParams
method overview void bindbyindex(in unsigned long aindex, in nsivariant avalue); void bindblobbyindex(in unsigned long aindex, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyindex(in unsigned long aindex, in double avalue); native code only!
... methods bindbyindex() binds a to the specified index.
mozIStorageBindingParamsArray
method overview void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array.
... methods addparams() adds the specified set of parameters to the end of the array.
mozIStorageVacuumParticipant
method overview boolean onbeginvacuum(); void onendvacuum(in boolean asucceeded); attributes attribute type description databaseconnection mozistorageconnection a connection to the database file to be vacuumed.
... methods onbeginvacuum() called when a vacuum operation begins.
mozIVisitStatusCallback
toolkit/components/places/moziasynchistory.idlscriptable this interface provides callback handling functionality for moziasynchistory.isurivisited 1.0 66 introduced gecko 11.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) method overview void isvisited(in nsiuri auri, in boolean avisitedstatus); methods isvisited() called when the moziasynchistory.isurivisited() method's check to determine whether a given uri has been visited has completed.
... implement this method to determine the results of the request.
nsIAbCard
inherits from: nsisupports method overview astring getcardvalue(in string name) void setcardvalue(in string attrname, in astring value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[optional] in n...
... allowremotecontent boolean allow remote content to be displayed in html mail received from this contact methods getcardvalue() astring getcardvalue(in string name) parameters name the attribute you want the value for.
nsIAboutModule
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long geturiflags(in nsiuri auri); nsichannel newchannel(in nsiuri auri); constants constant value description uri_safe_for_untrusted_content (1 << 0) a flag that indicates whether a uri is safe for untrusted content.
... methods geturiflags() a method to get the flags that apply to a given about: uri.
nsIAccelerometerUpdate
xpcom/system/nsiaccelerometer.idlnot scriptable replaced by nsidevicemotionupdate 1.0 66 introduced gecko 2.0 obsolete gecko 6.0 inherits from: nsiaccelerometer last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) this method is only used in content tabs to receive nsiacceleration data from the chrome process.
... method overview void accelerationchanged(in double x, in double y, in double z); methods accelerationchanged() void accelerationchanged( in double x, in double y, in double z ); parameters x y z the coordinates of the nsiacceleration data.
nsIAccessNode
method overview nsiaccessnode getchildnodeat(in long childnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputedstylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long aco...
... methods getchildnodeat() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) get the nth child of this node.
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 cre...
...ible getaccessible(in nsidomnode anode, in nsipresshell apresshell, in nsiweakreference aweakshell, inout nsiframe framehint, out boolean aishidden); nsiaccessible addnativerootaccessible(in voidptr aatkaccessible); void removenativerootaccessible(in nsiaccessible arootaccessible); void invalidatesubtreefor(in nsipresshell apresshell, in nsicontent achangedcontent, in pruint32 aevent); methods removenativerootaccessible() void removenativerootaccessible( in nsiaccessible arootaccessible ); invalidatesubtreefor() invalidate the accessibility cache associated with apresshell, for accessibles that were generated for acontainercontent and it's subtree.
ExtendSelection
« nsiaccessible page summary this method extends the current selection from its current accessible anchor node to this accessible.
...this method isn't implemented.
nsIAccessibleHyperText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessiblehyperlink getlink(in long linkindex); long getlinkindex(in long charindex); long getselectedlinkindex(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object.
...note: renamed from links in gecko 1.9 methods getlink() retrieves the nsiaccessiblehyperlink object at the given link index.
nsIAccessibleSelectable
inherits from: nsisupports last changed in gecko 1.7 method overview void addchildtoselection(in long index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long index); nsiaccessible refselection(in long index); void removechildfromselection(in long index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected.
... constants constant value description eselection_add 0 eselection_remove 1 eselection_getstate 2 methods addchildtoselection() adds the specified accessible child of the object to the object's selection.
nsIAccessibleStateChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean isenabled(); boolean isextrastate(); attributes attribute type description state unsigned long returns the state of accessible (see constants declared in nsiaccessiblestates).
... methods isenabled() boolean isenabled(); parameters none.
nsIAccessibleTable
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiaccessible getcellat(in long rowindex, in long columnindex); note: renamed from cellrefat in gecko 1.9.2 long getcellindexat(in long rowindex, in long columnindex); note: renamed from getindexat in gecko 1.9.2 astring getcolumndescription(in long columnindex); long getcolumnextentat(in long row, in long column); long getcolumnindexat(in long cellindex); note: renamed from getcolumnatindex in gecko 1.9.2 void getrowandcolumnindicesat(in long cellindex, out long rowindex, out long columnindex); astring getrowdescri...
... methods return the accessible object at the specified row and column in the table.
nsIAccessibleTableCell
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview boolean isselected(); attributes attribute type description columnextent long return the number of columns occupied by this cell.
... methods isselected() boolean isselected(); parameters none.
nsIAccessibleTextChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean isinserted(); attributes attribute type description length unsigned long returns length of changed text.
... methods isinserted() boolean isinserted(); parameters none.
nsIAccessibleValue
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean setcurrentvalue(in double value); obsolete since gecko 1.9 attributes attribute type description currentvalue double maximumvalue double read only.
... methods setcurrentvalue() obsolete since gecko 1.9 (firefox 3) return a success condition of the value getting set.
nsIApplicationCacheChannel
1.0 66 introduced gecko 1.9.1 inherits from: nsiapplicationcachecontainer last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void markofflinecacheentryasforeign(); attributes attribute type description chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly provided and none is available from the notification callbacks.
... methods markofflinecacheentryasforeign() a shortcut method to mark the cache item of this channel as 'foreign'.
nsIApplicationCacheNamespace
method overview void init(in unsigned long itemtype, in acstring namespacespec, in acstring data); attributes attribute type description data acstring data associated with the namespace, such as a fallback.
... methods init() initializes the namespace.
nsIApplicationUpdateService
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void adddownloadlistener(in nsirequestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker ns...
... methods adddownloadlistener() adds a listener that receives progress and state information about the update that is currently being downloaded.
nsIAsyncVerifyRedirectCallback
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface implements the callbacks passed to the nsichanneleventsink.asynconchannelredirect() method.
... method overview void onredirectverifycallback(in nsresult result); methods onredirectverifycallback() implements the asynchronous callback passed to nsichanneleventsink.asynconchannelredirect().
nsIAuthPromptProvider
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getauthprompt(in pruint32 apromptreason, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); constants constant value description prompt_normal 0 normal (non-proxy) prompt request.
... methods getauthprompt() this method requests a prompt interface for the given prompt reason.
nsIAuthPromptWrapper
the nsiauthpromptwrapper interface is an override of nsiauthprompt which performs some action on the data going through nsiauthprompt methods.
... last changed in gecko 1.7 inherits from: nsiauthprompt method overview void setpromptdialogs(in nsiprompt dialogs); methods setpromptdialogs() this method sets a prompt dialog using the given dialog implementation which will be used to display the prompts.
nsIAutoCompleteInput
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring getsearchat(in unsigned long index); void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long startindex, in long endindex); attributes attribute type description completedefaultindex boolean if a search result has its defaultindex set, this will optionally try to complete the text in t...
... methods getsearchat() returns the name of one of the autocomplete search session objects.
nsIBinaryOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method overview void setoutputstream(in nsioutputstream aoutputstream); void write8(in pruint8 abyte); void write16(in pruint16 a16); void write32(in pruint32 a32); void write64(in pruint64 a64); void writeboolean(in prbool aboolean); void writebytearray([array, size_is(alength)] in pruint8 abytes, in pruint32 alength); void writebytes(alength)] in string astring, in pruint32 alength); ...
... void writedouble(in double adouble); void writefloat(in float afloat); void writestringz(in string astring); void writeutf8z(in wstring astring); void writewstringz(in wstring astring); methods setoutputstream() sets the stream to which output is directed.
nsIBlocklistService
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 29 (firefox 29 / thunderbird 29 / seamonkey 2.26) method overview unsigned long getaddonblockliststate(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); unsigned long getpluginblockliststate(in nsiplugintag plugin, [optional] in astring appversion, [optional] in astring toolkitversion); boolean isaddonblocklisted(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); constants constant value description state_not_blocked 0 state_softblocked 1 ...
... state_blocked 2 state_outdated 3 methods getaddonblockliststate() determine the blocklist state of an add-on.
nsIBoxObject
method overview wstring getlookandfeelmetric(in wstring propertyname); 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.
... methods getlookandfeelmetric() obsolete since gecko 1.9 (firefox 3) wstring getlookandfeelmetric( in wstring propertyname ); parameters propertyname return value getproperty() wstring getproperty( in wstring propertyname ); parameters propertyname return value getpropertyassupports() nsisupports getpropertyassupports( in wstring propertyname ); parameters prop...
nsICache
this constant specify that cache session is not a stream based entry when calling nsicacheservice.createsession() method.
...this constant specify that cache session is a stream based entry when calling nsicacheservice.createsession() method.
nsICacheEntryInfo
inherits from: nsisupports last changed in gecko 1.7 method overview boolean isstreambased(); attributes attribute type description clientid string get the client id associated with this cache entry.
... methods isstreambased() this method finds out whether or not the cache entry is stream based.
nsICacheListener
inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void oncacheentryavailable(in nsicacheentrydescriptor descriptor, in nscacheaccessmode accessgranted, in nsresult status); void oncacheentrydoomed(in nsresult status); methods oncacheentryavailable() this method is called when the requested access (or appropriate subset) is acquired.
... oncacheentrydoomed() this method is called when the processing started by nsicachesession.doomentry() is completed.
nsICacheVisitor
inherits from: nsisupports last changed in gecko 1.7 method overview boolean visitdevice(in string deviceid, in nsicachedeviceinfo deviceinfo); boolean visitentry(in string deviceid, in nsicacheentryinfo entryinfo); methods visitdevice() this method is called to provide information about a cache device.
...visitentry() this method is called to provide information about a cache entry.
nsICachingChannel
method overview boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type description cacheasfile boolean specifies whether or not the data should be cached to a file.
... methods isfromcache() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this method finds out whether or not this channel's data is being loaded from the cache.
nsIChromeRegistry
inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: @mozilla.org/chrome/chrome-registry;1 as a service: var chromeregistry = components.classes["@mozilla.org/chrome/chrome-registry;1"] .getservice(components.interfaces.nsichromeregistry); method overview void canonify(in nsiuri achromeurl); obsolete since gecko 1.8 void checkfornewchrome(); nsiuri convertchromeurl(in nsiuri achromeurl); boolean wrappersenabled(in nsiuri auri); violates the xpcom interface guidelines constants constant value description none 0 partial 1 full 2 ...
... methods canonify() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this method is obsolete; use convertchromeurl() instead.
nsIClipboardHelper
inherits from: nsisupports last changed in gecko 1.7 method overview void copystring(in astring astring); void copystringtoclipboard(in astring astring, in long aclipboardid); methods copystring() this method copies string to (default) clipboard.
... copystringtoclipboard() this method copies string to given clipboard.
nsICommandLineHandler
@mozilla.org/venkman/clh;1 command-line-handler c-extensions @mozilla.org/extension-manager/clh;1 command-line-handler m-edit @mozilla.org/composer/clh;1 command-line-handler m-irc @mozilla.org/chatzilla/clh;1 command-line-handler y-final @mozilla.org/browser/clh-final;1 method overview void handle(in nsicommandline acommandline); attributes attribute type description helpinfo autf8string when the application is launched with the -help argument, this attribute is retrieved and displayed to the user (on stdout).
... methods handle() processes a command line.
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.
... methods init() called with the argc/argv combination passed to main.
nsICompositionStringSynthesizer
mmit string domwindowutils.sendcompositionevent("compositionend", "foo-bar-buzz", ""); starting gecko 36, you can do it simpler: domwindowutils.sendcompositionevent("compositioncommitasis", "", ""); if you need to commit composition with different commit string gecko 36 or later, you can use "compositioncommit": domwindowutils.sendcompositionevent("compositioncommit", "foo-bar-buzz", ""); method overview void appendclause(in unsigned long alength, in unsigned long aattribute); boolean dispatchevent(); void setcaret(in unsigned long aoffset, in unsigned long alength); void setstring(in astring astring); constants constant value description attr_raw_input 0x02 a clause attribute.
... methods appendclause() appends a clause to the composition string which is set by setstring().
nsIContentView
method overview void scrollby(in float dxpx, in float dypx); void scrollto(in float xpx, in float ypx); void setscale(in float xscale, in float yscale); attributes attribute type description contentheight float read only.
... methods scrollby() scrolls the content view by the specified number of chrome-document css pixels along each axis.
nsIContentViewManager
method overview void getcontentviewsin(in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, [optional] out unsigned long alength, [retval, array, size_is(alength)] out nsicontentview aresult); attributes attribute type description rootcontentview nsicontentview the root content view.
... methods getcontentviewsin() returns an array of nsicontentview objects representing all of the content views that intersect with the specified rectangle in the browser.
nsIControllers
to create an instance, use: var controllers = components.classes["@mozilla.org/xul/xul-controllers;1"] .createinstance(components.interfaces.nsicontrollers); method overview void appendcontroller(in nsicontroller controller); nsicontroller getcontrollerat(in unsigned long index); nsicontroller getcontrollerbyid(in unsigned long controllerid); unsigned long getcontrollercount(); 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.
nsIConverterInputStream
to create an instance, use: var converterinputstream = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); method overview void init(in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar); constants constant value description default_replacement_character 0xfffd default replacement character value.
... methods init() initialize this stream.
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.
... methods cookiedialog() opens a dialog that asks for permission to accept a cookie.
nsICycleCollectorListener
method overview void begin(); void begindescriptions(); void describegcedobject(in unsigned long long aaddress, in boolean amarked); void describerefcountedobject(in unsigned long long aaddress, in unsigned long aknownedges, in unsigned long atotaledges); void end(); void noteedge(in unsigned long long afromaddress, in unsigned long long atoaddress, in string aedgename); void noteobject(i...
...n unsigned long long aaddress, in string aobjectdescription); methods begin() void begin(); parameters none.
nsIDBFolderInfo
as a service: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(in long delta); boolean getbooleanproperty(in string propertyname, in boolean defaultvalue); void getcharacterset(out acstring charset, out boolean override...
... nummessages long numunreadmessages long sortorder nsmsgviewsortordervalue sorttype nsmsgviewsorttypevalue version unsigned long viewflags nsmsgviewflagstypevalue viewtype nsmsgviewtypevalue methods andflags() long andflags( in long flags ); parameters flags missing description return value missing description exceptions thrown missing exception missing description changeexpungedbytes() void changeexpungedbytes( in long delta ); parameters delta missing description exceptions thrown missing exception missing description c...
nsIDOMElement
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 ns...
... methods getattribute() get an attribute value.
nsIDOMFontFaceList
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.
nsIDOMGeoGeolocation
ess 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 nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); unsigned short watchposition(in nsidomgeopositioncallback successcallback, ...
... methods clearwatch() when the clearwatch() method is called, the watch() process stops calling for new position identifiers and cease invoking callbacks.
nsIDOMMouseScrollEvent
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 relatedt...
... methods initmousescrollevent() initializes the progress event object.
nsIDOMMozTouchEvent
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, ...
... methods initmoztouchevent() initializes the touch event.
nsIDOMNode
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.
... constants constant value description element_node 1 attribute_node 2 text_node 3 cdata_section_node 4 entity_reference_node 5 entity_node 6 processing_instruction_node 7 comment_node 8 document_node 9 document_type_node 10 document_fragment_node 11 notation_node 12 methods appendchild() nsidomnode appendchild( in nsidomnode newchild ); parameters newchild return value clonenode() nsidomnode clonenode( in boolean deep ); parameters deep return value hasattributes() boolean hasattributes(); parameters none.
nsIDOMOrientationEvent
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.
...methods initorientationevent() initializes the orientation event object.
nsIDOMParser
if you instantiate a domparser by calling createinstance(), and you don't call the domparser's init() method, attempting to initiate a parsing operation will automatically call init() on the domparser with a null principal and null pointers for documenturi and baseuri.
... parsing a string once you've created a domparser object, you can use its parsefromstring method to parse xml or html as described in the web platform documentation.
nsIDOMProgressEvent
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 i...
... methods initprogressevent() deprecated since gecko 22.0 this method has been removed from use in javascript in gecko 22.0.
nsIDOMSimpleGestureEvent
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 related...
... methods initsimplegestureevent() initializes the gesture event.
nsIDOMStorage
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.
... methods clear() clear the content of this storage bound to a domain or an origin.
nsIDOMStorage2
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports 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 local storage.
... methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin.
nsIDOMStorageEventObsolete
method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if t...
... methods initstorageevent() initializes a storage event.
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.
nsIDOMWindow
method overview nsidomcssstyledeclaration getcomputedstyle(in nsidomelement elt, [optional] in domstring pseudoelt); nsiselection getselection(); void scrollby(in long xscrolldif, in long yscrolldif); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrollto(in long xscroll, in long yscroll); void sizetocont...
... methods getcomputedstyle() see dom-window-getcomputedstyle for details.
nsIDOMXPathEvaluator
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 ...
... note: prior to gecko 1.9, you could call this method on documents other than the one you planned to run the xpath against; starting with gecko 1.9, however, you must call it on the same document.
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.
...to evaluate against a whole document, use the document.documentelement method to get the node to evaluate against.
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.
... methods iteratenext() iterates through the available nodes of an unordered_node_iterator_type or ordered_node_iterator_type result.
nsIDOMXULSelectControlElement
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 ...
nsIDirectoryEnumerator
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 close(); attributes attribute type description nextfile nsifile the next file in the sequence.
... methods close() closes the directory being enumerated, releasing the system resource.
nsIDocumentLoader
to create an instance, use: var documentloader = components.classes["@mozilla.org/docloaderservice;1"] .createinstance(components.interfaces.nsidocumentloader); method overview void clearparentdocloader(); obsolete since gecko 1.8 void createdocumentloader(out nsidocumentloader aninstance); obsolete since gecko 1.8 void destroy(); obsolete since gecko 1.8 void fireonlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri auri); obsolete since gecko 1.8 void fireonstatuschange(in nsiwebprogres...
... methods clearparentdocloader() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void clearparentdocloader(); parameters none.
nsIDownloadManagerUI
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager ui is visible; otherwise false.
... methods getattention() calls attention to the download manager's user interface if it's already open.
nsIDragDropHandler
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.
...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.
nsIDragSession
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not.
... methods getdata() gets data from a drag and drop operation.
nsIEditorDocShell
method overview void makeeditable(in boolean inwaitforuriload); attributes attribute type description editable boolean this docshell is editable.
... methods makeeditable() make this docshell editable, setting a flag that causes an editor to get created, either immediately, or after a url has been loaded.
nsIEditorIMESupport
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void begincomposition(in nstexteventreplyptr areply); native code only!
... methods native code only!begincomposition obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete.
nsIEnvironment
getservice(components.interfaces.nsienvironment); method overview void set(in astring aname, in astring avalue); astring get(in astring aname); boolean exists(in astring aname); methods set() set the value of an environment variable.
...this method checks whether an environment variable is present in the environment or not.
nsIErrorService
inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/error-service;1 method overview string geterrorstringbundle(in short errormodule); string geterrorstringbundlekey(in nsresult error); void registererrorstringbundle(in short errormodule, in string stringbundleurl); void registererrorstringbundlekey(in nsresult error, in string stringbundlekey); void unregistererrorstringbundle(in short errormodule); void unregistererrorstringbundlekey(in nsresult error);...
... methods geterrorstringbundle() retrieves a string bundle url for an error module.
nsIException
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description columnnumber pruint32 valid column numbers begin at 0.
... methods tostring() a generic formatter - make it suitable to print, etc.
nsIFeedContainer
toolkit/components/feeds/public/nsifeedcontainer.idlscriptable this interface provides standard fields used by both feeds (nsifeed) and feed entries (nsifeedentry) 1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) method overview void normalize(); attributes attribute type description authors nsiarray an array of nsifeedperson objects describing the authors of the feed or entry.
... methods normalize() synchronizes a container's fields with its convenience attributes.
nsIFileInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
... methods init() void init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to read from (must qi to nsilocalfile) ioflags the file status flags define how the file is accessed.
nsIFileOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream.
... methods init() void init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to write to (must qi to nsilocalfile) ioflags file open flags listed are listed in the pr_open() documentation.
nsIFileStreams
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
...(the file will only be reopened if it is closed for some reason.) methods init() void init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to read from (must qi to nsilocalfile).
nsIFormHistory2
method overview void addentry(in astring name, in astring value); boolean entryexists(in astring name, in astring value); boolean nameexists(in astring name); void removeallentries(); void removeentriesbytimeframe(in long long abegintime, in long long aendtime); void removeentriesforname(in astring name); void removeentry(in astring name, in astring value); attributes attribute typ...
... methods addentry() adds a name and value pair to the form history.
nsIFrameLoaderOwner
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 [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
... methods getframeloader() returns the frame loader object owned by this object.
nsIGeolocationProvider
method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void startup(); void watch(in nsigeolocationupdate callback); methods isready() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) reports whether or not the device is ready and has a position.
...this is called before any other method and may be called multiple times.
nsIGlobalHistory3
method overview void adddocumentredirect(in nsichannel aoldchannel, in nsichannel anewchannel, in print32 aflags, in boolean atoplevel); unsigned long geturigeckoflags(in nsiuri auri); void seturigeckoflags(in nsiuri auri, in unsigned long aflags); methods adddocumentredirect() notifies the history system that the page loading via aoldchannel red...
...implementors who wish to implement this interface but rely on nsiglobalhistory2.adduri() for redirect processing may throw ns_error_not_implemented from this method.
nsIHapticFeedback
var hapticfeedback = components.classes["@mozilla.org/widget/hapticfeedback;1"] .getservice(components.interfaces.nsihapticfeedback); once you have the service, you can initiate haptic feedback (that is, cause the device to vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void performsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 specify as the action type to perform a short vibration.
... methods performsimpleaction() perform haptic feedback.
nsIHttpActivityDistributor
cko 1.9.2 inherits from: nsihttpactivityobserver last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: mozilla.org/network/http-activity-distributor;1 as a service: var httpactivitydistributor = components.classes["@mozilla.org/network/http-activity-distributor;1"] .getservice(components.interfaces.nsihttpactivitydistributor); method overview void addobserver(in nsihttpactivityobserver aobserver); void removeobserver(in nsihttpactivityobserver aobserver); methods addobserver() begins delivery of notifications of http transport activity.
... void addobserver( in nsihttpactivityobserver aobserver ); parameters aobserver the nsihttpactivityobserver that should receive notifications of http transport activity; this object's nsihttpactivityobserver.observeactivity() method will be called each time activity occurs.
nsIHttpHeaderVisitor
inherits from: nsisupports last changed in gecko 1.7 method overview void visitheader(in acstring aheader, in acstring avalue); methods visitheader() called by the nsihttpchannel implementation when visiting request and response headers.
... this method can throw an exception to terminate enumeration of the channel's headers.
nsIIDNService
netwerk/dns/nsiidnservice.idlscriptable this interface provides support for internationalized domain names, including methods for manipulating idn hostnames according to ietf specification.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/idn-service;1 as a service: var idnservice = components.classes["@mozilla.org/network/idn-service;1"] .getservice(components.interfaces.nsiidnservice); method overview autf8string convertacetoutf8(in acstring input); autf8string converttodisplayidn(in autf8string input, out boolean isascii); acstring convertutf8toace(in autf8string input); boolean isace(in acstring input); autf8string normalize(in autf8string input); methods convertacetoutf8() converts an ace (ascii compatible encoding) hostname into unicode format, returning a utf-8 format string.
nsIIdleService
to create an instance, use: var idleservice = components.classes["@mozilla.org/widget/idleservice;1"] .getservice(components.interfaces.nsiidleservice); method overview void addidleobserver(in nsiobserver observer, in unsigned long time); void removeidleobserver(in nsiobserver observer, in unsigned long time); attributes attribute type description idletime unsigned long the amount of time in milliseconds that has passed since the last user activity.
... methods addidleobserver() add an observer to be notified when the user idles for some period of time, and when they get back from that.
nsIInputStreamCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void oninputstreamready(in nsiasyncinputstream astream); methods oninputstreamready() called to indicate that the stream is either readable or closed.
... void oninputstreamready( in nsiasyncinputstream astream ); parameters astream the stream whose nsiasyncinputstream.asyncwait() method was called.
nsIInstallLocation
you can get the install location of a particular add-on using nsiextensionmanager interface: var il = components.classes["@mozilla.org/extensions/manager;1"] .getservice(components.interfaces.nsiextensionmanager) .getinstalllocation("add-on id") method overview astring getidforlocation(in nsifile file); nsifile getitemfile(in astring id, in astring path); nsifile getitemlocation(in astring id); nsifile getstagefile(in astring id); boolean itemismanagedindependently(in astring id); void removefile(in nsifile file); nsifile stagefile(in nsifile file, in astring id); attributes attribute type description canaccess boolean...
... constant value description priority_app_profile 0 priority_app_system_user 10 priority_xre_system_user 100 priority_app_system_global 1000 priority_xre_system_global 10000 methods getidforlocation() retrieves the guid for an item at the specified location.
nsIJetpack
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 sendmessage(in astring amessagename /* [optional] in jsval v1, [optional] in jsval v2, ...
... */); void registerreceiver(in astring amessagename, in jsval areceiver); void unregisterreceiver(in astring amessagename, in jsval areceiver); void unregisterreceivers(in astring amessagename); void evalscript(in astring ascript); nsivariant createhandle(); void destroy(); methods sendmessage() this method asynchronously sends a message to the jetpack process.
nsIJumpListBuilder
method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type description available short indicates whether jump list taskbar features are supported by the current host.
... methods abortlistbuild() aborts and clears the current jump list build.
nsIJumpListItem
method overview boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type.
... methods equals() compare this item to another.
nsILoadGroup
inherits from: nsirequest last changed in gecko 1.7 method overview void addrequest(in nsirequest arequest, in nsisupports acontext); void removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set).
... methods addrequest() adds a new request to the group.
nsILoginManagerCrypto
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 astring decrypt(in astring ciphertext); astring encrypt(in astring plaintext); attributes attribute type description isloggedin boolean current login state of the token used for encryption.
... methods decrypt() decrypts the specified string, returning the plain text value.
nsIMacDockSupport
method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon.
... methods activateapplication() activates the application, making it the frontmost application.
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.
... methods scrolltonode() scroll the make the specified node visible.
nsIMemoryMultiReporter
this will call the specified callback's nsimemorymultireportercallback.callback() method once for each report.
... method overview void collectreports(in nsimemorymultireportercallback callback, in nsisupports closure); methods collectreports() void collectreports( in nsimemorymultireportercallback callback, in nsisupports closure ); parameters callback the nsimemorymultireportercallback to call when collection is complete.
nsIMemoryMultiReporterCallback
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 void callback(in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure); methods callback() called to provide information from a multi-reporter.
... implement this method to handle the report information.
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.
nsIMicrosummaryObserver
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides methods for observing changes to micrummaries.
... 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 void oncontentloaded(in nsimicrosummary microsummary); void onelementappended(in nsimicrosummary microsummary); void onerror(in nsimicrosummary microsummary); methods oncontentloaded() called when an observed microsummary updates its content.
nsIMimeConverter
method overview string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); mimeen...
...coderdata *b64encoderinit(in mimeconverteroutputcallback output_fn, in void *closure); mimeencoderdata *qpencoderinit(in mimeconverteroutputcallback output_fn, in void *closure); void encoderdestroy(in mimeencoderdata *data, in boolean abort_p); long encoderwrite(in mimeencoderdata *data, in string buffer, in long size); methods encodemimepartiistr() an variant of encodemimepartiistr_utf8() which treats the header as written in the given charset.
nsIMimeHeaders
as a service: var mimeheaders = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsimimeheaders); method overview string extractheader([const] in string headername, in boolean getallofthem); void initialize([const] in string allheaders, in long allheaderssize); attributes attribute type description allheaders string read only.
... methods extractheader() string extractheader( [const] in string headername, in boolean getallofthem ); parameters headername missing description getallofthem missing description return value missing description exceptions thrown missing exception missing description initialize() void initialize( [const] in string allheaders, in long allheaderssize ); parameters allheaders insert the complete message content allheaderssize length of the passed in content exceptions thrown missing exception missing description remarks see also ...
nsIMsgAccount
inherits from: nsisupports last changed in gecko 1.7 method overview void addidentity(in nsimsgidentity identity); void clearallvalues(); void init(); void removeidentity(in nsimsgidentity identity); astring tostring(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only.
... outgoing identity list (array of nsimsgidentity's) incomingserver nsimsgincomingserver incoming server stuff key acstring internal key identifying itself methods addidentity() adds a new identity to this account.
nsIMsgAccountManagerExtension
inherits from: nsisupports method overview boolean showpanel(in nsimsgincomingserver server); attributes attribute type description name acstring name of the account manager extension.
... methods showpanel() before displaying a panel in the account manager this method is triggered.
nsIMsgCompFields
references char * replyto astring securityinfo nsisupports subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbool methods utility methods prbool checkcharsetconversion ( out char * fallbackcharset ); nsimsgrecipientarray splitrecipients ( in prunichar * recipients, in prbool emailaddressonly ); void convertbodytoplaintext ( ); attachment handling methods void addattachment ( in nsimsgattachment attachment ); void removeattachment ( in nsimsgattachment ...
...attachment ); void removeattachments ( ); header methods void setheader(char* name, char* value); references this interface is the type of the following properties: nsimsgcompose.compfields, nsimsgcomposeparams.composefields this interface is passed as an argument to the following methods: nsimsgcomposesecure.begincryptoencapsulation, nsimsgcomposesecure.requirescryptoencapsulation, nsimsgsend.createandsendmessage, nsimsgsend.sendmessagefile, nsismimejshelper.getnocertaddresses, nsismimejshelper.getrecipientcertsinfo ...
nsIMsgDBHdr
method overview astring getproperty(in string propertyname); void setproperty(in string propertyname, in astring propertystr); void setstringproperty(in string propertyname, in string propertyvalue); string getstringproperty(in string propertyname); unsigned long getuint32property(in string propertyname); void setuint32property(in string propertynam...
...(new in 3.1?) methods getproperty() astring getproperty(in string propertyname); parameters propertyname the name of the property to retrieve.
nsIMsgFilterCustomAction
*/ attribute boolean allowduplicates; /* * the custom action itself * * generally for the apply method, folder-based methods give correct * results and are preferred if available.
... */ /** * apply the custom action to an array of messages * * @param msghdrs array of nsimsgdbhdr objects of messages * @param actionvalue user-set value to use in the action * @param copylistener calling method (filtertype manual only) * @param filtertype type of filter being applied * @param msgwindow message window */ void apply(in nsiarray msghdrs /* nsimsgdbhdr array */, in autf8string actionvalue, in nsimsgcopyservicelistener copylistener, in nsmsgfiltertypetype filtertype, in nsimsgwindow msgwindow); /* does this actio...
nsIMsgHeaderParser
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) to create an instance, use: var msgheaderparser = components.classes["@mozilla.org/messenger/headerparser;1"] .createinstance(components.interfaces.nsimsgheaderparser); method overview string extractheaderaddressmailboxes(in string line); void extractheaderaddressname(in string line, out string name); void extractheaderaddressnames(in string line, out string usernames); astring makefulladdress(in astring aname, in astring aaddress); string makefulladdressstring(in string aname, in string aaddress); wstring makeful...
...ing reformattedaddress); wstring reformatunquotedaddresses(in wstring line); void removeduplicateaddresses(in string addrs, in string other_addrs, in prbool removealiasestome, out string newaddress); string unquotephraseoraddr(in string line, in boolean preserveintegrity); wstring unquotephraseoraddrwstring(in wstring line, in boolean preserveintegrity); methods extractheaderaddressmailboxes() given a string which contains a list of header addresses, returns a comma-separated list of just the 'mailbox' portions.
nsIMsgIdentity
inherits from: nsisupports method overview void clearallvalues(); void copy(in nsimsgidentity identity); astring getunicharattribute(in string name); void setunicharattribute(in string name, in astring value); acstring getcharattribute(in string name); void setcharattribute(in string name, in acstring value); boolean getboolattribute(in string name); void setboolattribute(in string name, in boolean value); long getintattribute(in string name); void setintattribute(in str...
... methods clearallvalues() note: this is really dangerous!
nsIMsgProtocolInfo
method overview long getdefaultserverport(in boolean issecure); attributes attribute type description candelete boolean true if an account of this type may be deleted.
... methods getdefaultserverport() returns the default port for a connection to a server of this account type.
nsIMsgThread
inherits from: nsisupports method overview void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); nsimsgdbhdr getchildat(in long index); nsmsgkey getchildkeyat(in long index); nsimsgdbhdr getchild(in nsmsgkey msgkey); nsimsgdbhdr getchildhdrat(in long index); nsimsgdbhdr getroothdr(out long index); void removechildat(in long index); void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); ...
... methods addchild() add a message to the thread.
nsIMsgWindow
method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane.
... methods displayhtmlinmessagepane() loads the specified html in the message pane.
nsIMutableArray
any of these methods may throw ns_error_out_of_memory when the array must grow to complete the call, but the allocation fails.
... method overview void appendelement(in nsisupports element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long index, in boolean weak); void removeelementat(in unsigned long index); void replaceelementat(in nsisupports element, in unsigned long index, in boolean weak); methods appendelement() append an element at the end of the array.
nsINavHistoryQueryResultNode
method overview void getqueries([optional] out unsigned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder.
... methods getqueries() returns the queries that build the node's children; only valid for result_type_query nodes.
nsINavHistoryResultTreeViewer
method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
... methods nodefortreeindex() returns the node for a given row index.
nsIObserver
inherits from: nsisupports last changed in gecko 0.9.6 method overview void observe(in nsisupports asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for.
... you should not modify, add, remove, or enumerate notifications in the implementation of this method.
nsIOutputStreamCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void onoutputstreamready(in nsiasyncoutputstream astream); methods onoutputstreamready() called to indicate that the stream is either writable or closed.
... void onoutputstreamready( in nsiasyncoutputstream astream ); parameters astream the stream whose nsiasyncoutputstream.asyncwait() method was called.
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 ...
... methods converttoplaintext() converts html to plain text.
nsIPasswordManager
to create an instance, use: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getservice(components.interfaces.nsipasswordmanager); method overview void adduser(in autf8string ahost, in astring auser, in astring apassword); void removeuser(in autf8string ahost, in astring auser); void addreject(in autf8string ahost); void removereject(in autf8string ahost); attributes attribute type description enumerator nsisimpl...
... methods adduser() stores a password.
nsIPipe
inherits from: nsisupports last changed in gecko 1.6 method overview void init(in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream.
... methods init() initialize this pipe.
nsIPlacesView
method overview nsinavhistoryresultnode[] getdragableselection(); nsinavhistoryresultnode[][] getremovableselectionranges(); nsinavhistoryresult getresult(); nsinavhistorycontainerresultnode getresultnode(); nsinavhistoryresultnode[] getselectionnodes(); void selectall(); attributes attribute type description hasselec...
... methods getdragableselection() returns an array of selected nsinavhistoryresultnode objects that can be dragged from the view.
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.
... note: you must call removeobserver method on the same nsiprefbranch2 instance on which you called addobserver() method in order to remove aobserver; otherwise, the observer will not be removed.
nsIPrefLocalizedString
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type description data wstring provides access to string data stored in this property.
... methods setdatawithlength() used to set the contents of this object.
nsIPrincipal
method overview short canenablecapability(in string capability); native code only!
... constant value description enable_denied 1 enable_unknown 2 enable_with_user_permission 3 enable_granted 4 methods native code only!canenablecapability short canenablecapability( in string capability ); parameters capability missing description return value missing description exceptions thrown missing exception missing description checkmayload() checks whether this principal is allowed to load the network resource located at the given uri under the same-origin policy.
nsIPrinterEnumerator
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void displaypropertiesdlg(in wstring aprinter, in nsiprintsettings aprintsettings); void enumerateprinters(out pruint32 acount,[retval, array, size_is(acount)] out wstring aresult); obsolete since gecko 1.9 void initprintsettingsfromprinter(in wstring aprintername, in nsiprintsettings aprintsettings); attributes attribute type description defaultprintername wstring the name of the system default printer.
... methods displaypropertiesdlg() void displaypropertiesdlg( in wstring aprinter, in nsiprintsettings aprintsettings ); parameters aprinter aprintsettings enumerateprinters() obsolete since gecko 1.9 (firefox 3) returns an array of the names of all installed printers.
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.
nsIProcess2
1.0 66 introduced gecko 1.9.1 obsolete gecko 1.9.2 inherits from: nsiprocess last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note this interface was removed in gecko 1.9.2 and its method added to nsiprocess.
...to create an instance, use: var process2 = components.classes["@mozilla.org/process/util;1"] .createinstance(components.interfaces.nsiprocess2); method overview void runasync([array, size_is(count)] in string args, in unsigned long count, [optional] in nsiobserver observer, [optional] in boolean holdweak); methods runasync() asynchronously runs the process with which the object was initialized, optionally calling an observer when the process finishes running.
nsIProfile
method overview void cloneprofile(in wstring profilename); void createnewprofile(in wstring profilename, in wstring nativeprofiledir, in wstring langcode, in boolean useexistingdir); void deleteprofile(in wstring name, in boolean candeletefiles); void getprofilelist(out unsigned long length, [retval, array, size_is(length)] out wstring profilenames); boolean ...
...unimplemented methods cloneprofile() clones the current profile, creating a copy of it with a new name.
nsIProperties
xpcom/ds/nsiproperties.idlscriptable this interface provides methods to access a map of named xpcom object values.
...to get an instance, use: var properties = components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties); method overview void get(in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); void getkeys(out pruint32 count, [array, size_is(count), retval] out string keys); boolean has(in string prop); void set(in string prop, in nsisupports value); void undefine(in string prop); methods get() gets the xpcom object associated with a particular name.
nsIPropertyBag
inherits from: nsisupports last changed in gecko 1.0 method overview nsivariant getproperty(in astring name); attributes attribute type description enumerator nsisimpleenumerator get a nsisimpleenumerator whose elements are nsiproperty objects.
... methods getproperty() get a property value for the given name.
nsIProtocolProxyCallback
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 onproxyavailable(in nsicancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus); methods onproxyavailable() this method is called when proxy info is available or when an error in the proxy resolution occurs.
...as with the result of nsiprotocolproxyservice's resolve method, a null result implies that a direct connection should be used.
nsIProtocolProxyFilter
method overview nsiproxyinfo applyfilter(in nsiprotocolproxyservice aproxyservice, in nsiuri auri, in nsiproxyinfo aproxy); methods applyfilter() this method is called to apply proxy filter rules for the given uri and proxy object (or list of proxy objects).
...this is passed so that implementations may easily access methods such as newproxyinfo.
nsIPushMessage
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.
...please see method parameters in xpidl for more details on using out parameters in javascript.
nsIRadioInterfaceLayer
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 nsiriltelephonycallbac...
...call_state_connected 5 call_state_holding 6 call_state_held 7 call_state_resuming 8 call_state_disconnecting 9 call_state_disconnected 10 call_state_incoming 11 datacall_state_unknown 0 datacall_state_connecting 1 datacall_state_connected 2 datacall_state_disconnecting 3 datacall_state_disconnected 4 call_state_ringing 2 obsolete since gecko 14.0 methods answercall() void answercall( in unsigned long callindex ); parameters callindex missing description exceptions thrown missing exception missing description deactivatedatacall() void deactivatedatacall( in domstring cid, in domstring reason ); parameters cid missing description reason missing description exceptions thrown missing exception missing description dial() functionality...
nsIRequest
method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request.
... methods cancel() cancels the current request.
nsIResumableChannel
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri.
... methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset.
nsISHEntry
to create an instance, use: var shentry = components.classes["@mozilla.org/browser/session-history-entry;1"] .createinstance(components.interfaces.nsishentry); method overview void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in bo...
... methods addchildshell() saved child docshells corresponding to contentviewer.
nsIScreenManager
66 introduced gecko 0.9.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/gfx/screenmanager;1 as a service: var screenmanager = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreenmanager); method overview nsiscreen screenfornativewidget( in voidptr nativewidget ); native code only!
... methods native code only!screenfornativewidget returns the nsiscreen instance for the native widget pointer.
nsIScriptError2
method overview void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated.
... methods initwithwindowid() void init( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid ); parameters message the text of the message to add to the log.
nsIScriptableUnicodeConverter
to create an instance, use: var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); method overview acstring convertfromunicode(in astring asrc); acstring finish(); astring converttounicode(in acstring asrc); astring convertfrombytearray([const,array,size_is(acount)] in octet adata, in unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); ...
... methods convertfromunicode() converts the data from unicode to one charset.
nsISearchEngine
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void addparam(in astring name, in astring value, in astring responsetype); nsisearchsubmission getsubmission(in astring data, [optional] in astring responsetype, [optional] in astring purpose); boolean supportsresponsetype(in astring responsetype); attributes attribute type description alias astring an optional shortcut alias for the engine.
... methods addparam() adds a parameter to the search engine's submission data.
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!
... methods addrange() adds a nsidomrange to the current selection.
nsISessionStartup
to use this service, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getservice(components.interfaces.nsisessionstartup); method overview boolean dorestore(); attributes attribute type description sessiontype unsigned long the type of session being restored; this will be one of the session type constants.
... methods dorestore() determines whether or not there is a session to restore.
nsISmsDatabaseService
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 ...
...ssagelist(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requestid, [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.
nsISmsRequestManager
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); ...
... constant value description success_no_error 0 no_signal_error 1 not_found_error 2 unknown_error 3 internal_error 4 methods addrequest() track an already existing request object.
nsISmsService
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, [opti...
...onal] in unsigned long long processid); methods createsmsmessage() [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 ); parameters id a number representing the id of the message.
nsISocketProvider
to create an instance, use: var socketprovider = components.classes["@mozilla.org/network/socket;2?type="] .createinstance(components.interfaces.nsisocketprovider); method overview void addtosocket(in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, in prfiledescstar afiledesc, out nsisupports asecurityinfo); native code only!
... methods native code only!addtosocket this function is called to allow the socket provider to layer a prfiledesc (a file descriptor) on top of another prfiledesc.
nsISpeculativeConnect
method overview void speculativeconnect(in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that a new transaction for the specified uri is likely to happen soon.
... the code implementing this method may use this information to start a tcp and/or ssl level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted.
nsIStackFrame
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description caller nsistackframe read only.
... example to output the stack at a particular location: var s = components.stack; while(s) { console.log(s.name); s = s.caller; } methods tostring() a generic formatter - make it suitable to print, and so forth.
nsIStandardURL
to create an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method overview void init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified.
...lah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar urltype_authority 2 blah:foo/bar => blah://foo/bar blah:/foo/bar => blah://foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah://foo/bar urltype_no_authority 3 blah:foo/bar => blah:///foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar methods init() normalizes a given url to an standard url.
nsIStringBundle
it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary.
... method overview wstring formatstringfromid(in long aid, [array, size_is(length)] in wstring params, in unsigned long length); wstring formatstringfromname(in wstring aname, [array, size_is(length)] in wstring params, in unsigned long length); nsisimpleenumerator getsimpleenumeration(); wstring getstringfromid(in long aid); wstring getstringfromname(in wstring aname); methods formatstringfromid() returns a formatted string with the given id from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array.
nsIStringBundleService
to access this service, use: var stringbundleservice = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice); method overview nsistringbundle createbundle(in string aurlspec); nsistringbundle createextensiblebundle(in string aregistrykey); void flushbundles(); wstring formatstatusmessage(in nsresult astatus, in wstring astatusarg); methods createbundle() nsistringbundle createbundle( in string aurlspec ); parameters aurlspec the url of the properties file to...
...typically used to format a message received by a nsiprogresseventsink's onstatus method.
nsIStructuredCloneContainer
method overview nsivariant deserializetovariant(); astring getdataasbase64(); void initfrombase64(in astring adata,in unsigned long aformatversion); void initfromvariant(in nsivariant adata); attributes attribute type description formatversion unsigned long get the version of the structured clone algorithm which was used to generate this container's serialized buffer.
... methods deserializetovariant() deserialize the object this container holds, returning it wrapped as an nsivariant.
nsIStyleSheetService
to create an instance, use: var stylesheetservice = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); method overview void loadandregistersheet(in nsiuri sheeturi, in unsigned long type); boolean sheetregistered(in nsiuri sheeturi, in unsigned long type); void unregistersheet(in nsiuri sheeturi, in unsigned long type); constants constant value description agent_sheet 0 user_sh...
...eet 1 author_sheet 2 methods loadandregistersheet() synchronously loads a style sheet from sheeturi and adds it to the list of user or agent style sheets.
nsISupportsArray
inherits from: nsicollection last changed in gecko 1.7 method overview boolean appendelements(in nsisupportsarray aelements); violates the xpcom interface guidelines nsisupportsarray clone(); void compact(); void deleteelementat(in unsigned long aindex); void deletelastelement(in nsisupports aelement); nsisupports elementat(in unsigned long aindex); violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates ...
...veelementsat(in unsigned long aindex, in unsigned long acount); violates the xpcom interface guidelines boolean removelastelement([const] in nsisupports aelement); violates the xpcom interface guidelines boolean replaceelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface guidelines boolean sizeto(in long asize); violates the xpcom interface guidelines methods violates the xpcom interface guidelines appendelements() boolean appendelements( in nsisupportsarray aelements ); parameters aelements return value clone() nsisupportsarray clone(); parameters none.
nsISupportsCString
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data acstring provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsChar
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data char provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsDouble
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data double provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsFloat
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data float provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsID
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data nsidptr provides access to the native type represented by the object.
... methods tostring() this method returns a string valued representation of the object.
nsISupportsInterfacePointer
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data nsisupports provides access to the native type represented by the object.
... methods tostring() returns a string valued representation of the object.
nsISupportsPRBool
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data prbool provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRInt16
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data print16 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRInt32
66 introduced gecko 1.0 inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data print32 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRInt64
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data print64 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRTime
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data prtime provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRUint16
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint16 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRUint32
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint32 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRUint64
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint64 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPRUint8
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data pruint8 provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsPriority
method overview void adjustpriority(in long delta); attributes attribute type description priority long the object's priority.
... methods adjustpriority() this method adjusts the priority attribute by a given amount (delta).
nsISupportsString
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data astring provides access to the native type represented by the object.
... methods tostring() this methods returns a string valued representation of the object.
nsISupportsVoid
inherits from: nsisupportsprimitive last changed in gecko 1.0 method overview string tostring(); attributes attribute type description data voidptr this attribute provides access to the native type represented by the object.
... methods tostring() string tostring(); parameters none.
nsITXTToHTMLConv
method overview void preformathtml(in boolean value); void settitle(in wstring text); prior versions of the interface named the methods using the initialcaps style instead of the intercaps style.
... methods preformathtml() specifies whether or not to wrap the resulting html in an <pre> block.
nsITaskbarProgress
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void setprogressstate(in nstaskbarprogressstate state, in unsigned long long currentvalue optional, in unsigned long long maxvalue optional); constants constant value description state_no_progress 0 stop displaying progress on the taskbar button.
... methods setprogressstate() sets the taskbar progress state and value for this window.
nsIThreadInternal
last changed in gecko 1.9 (firefox 3) inherits from: nsithread method overview void popeventqueue(); void pusheventqueue(in nsithreadeventfilter filter); attributes attribute type description observer nsithreadobserver get/set the current thread observer; set to null to disable observing.
... methods popeventqueue() reverts a call to pusheventqueue().
nsIThreadManager
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsithread getthreadfromprthread(in prthread prthread); native code only!
... methods native code only!getthreadfromprthread given a prthread, this method returns the corresponding nsithread.
nsIToolkitProfile
method overview nsiprofilelock lock(out nsiprofileunlocker aunlocker); void remove(in boolean removefiles); attributes attribute type description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory.
... methods lock() locks the profile using platform-specific locking methods.
nsITraceableChannel
method overview nsistreamlistener setnewlistener(in nsistreamlistener alistener); methods setnewlistener() replaces the channel's current listener with a new one, returning the listener previously assigned to the channel.
... implementing nsistreamlistener the nsistreamlistener passed to setnewlistener() should implement the following methods, which are called to notify it of events that occur on the http stream: onstartrequest: an http request is beginning.
nsITransactionList
inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type description numitems long the number of transactions contained in this list.
... methods getchildlistforitem() returns the list of children associated with the item at aindex.
nsITransferable
method overview void adddataflavor( in string adataflavor ); nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecanimport( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); ...
... methods adddataflavor() adds a new data flavor, indicating that this transferable can receive the type of data represented by the specified flavor string.
nsITreeColumn
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void getidconst([shared] out wstring idconst); native code only!
... methods native code only!getidconst void getidconst( [shared] out wstring idconst ); parameters idconst getnext() get the next column in the nsitreecolumns.
nsITreeContentView
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.
...obsolete since gecko 1.8 methods getindexofitem() retrieve the index associated with the specified content item.
nsIURIFixup
inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/docshell/urifixup;1 as a service: var urifixup = components.classes["@mozilla.org/docshell/urifixup;1"] .createinstance(components.interfaces.nsiurifixup); method overview nsiuri createexposableuri(in nsiuri auri); nsiuri createfixupuri(in autf8string auritext, in unsigned long afixupflags); nsiuri keywordtouri(in autf8string akeyword); nsiurifixupinfo getfixupuriinfo(in autf8string auritext, in unsigned long afixupflags); constants constant value description fixup_flag_none 0 no f...
... methods createexposableuri() converts an internal uri (for example a wysiwyg uri) into one which we can expose to the user, for example on the url bar.
nsIURLFormatter
toolkit/components/urlformatter/public/nsiurlformatter.idlscriptable this interface exposes methods to substitute variables in url formats.
...mozilla applications linking to mozilla websites are strongly encouraged to use urls of the following format: http[s]://%service%.mozilla.[com|org]/%locale%/ method overview astring formaturl(in astring aformat); astring formaturlpref(in astring apref); methods formaturl() formats a string url.
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.
... version astring the application version of the update.obsolete since gecko 2.0 methods getpatchat() retrieves a patch.
nsIUpdateItem
method overview void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes attribute type description iconurl astring...
... type_app 0x01 type_extension 0x02 type_theme 0x04 type_locale 0x08 type_multi_xpi 0x20 type_addon type_extension + type_theme + type_locale + type_plugin type_extension + type_theme + type_locale type_any type_app + type_addon 0xff type_plugin 0x10 methods init() initializes the object.
nsIUpdateManager
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update.
... methods getupdateat() returns the update at the specified index into the history list.
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.
nsIWebBrowserChrome
inherits from: nsisupports last changed in gecko 0.9.6 method overview void destroybrowserwindow(); void exitmodaleventloop(in nsresult astatus); boolean iswindowmodal(); void setstatus(in unsigned long statustype, in wstring status); void showasmodal(); void sizebrowserto(in long acx, in long acy); attributes attribute type description chromeflags unsigned long the chrome flags for this browser chrome.
... methods destroybrowserwindow() asks the implementer to destroy the window associated with this webbrowser object.
nsIWebBrowserFind
method overview boolean findnext(); attributes attribute type description entireword boolean whether to match entire words only.
... methods findnext() finds, highlights, and scrolls into view the next occurrence of the search string, using the current search settings.
nsIWebPageDescriptor
inherits from: nsisupports last changed in gecko 1.7 method overview void loadpage(in nsisupports apagedescriptor, in unsigned long adisplaytype); attributes attribute type description currentdescriptor nsisupports retrieves the page descriptor for the current document.
... methods loadpage() tells the object to load the page specified by the page descriptor.
nsIWinAppHelper
method overview void fixreg(); obsolete since gecko 1.9 void postupdate(in nsilocalfile logfile); obsolete since gecko 1.9.2 attributes attribute type description usercanelevate boolean read only.
... methods fixreg() obsolete since gecko 1.9 (firefox 3) invokes helper.exe with the /fixreg parameter.
nsIWindowCreator
inherits from: nsisupports last changed in gecko 0.9.6 method overview nsiwebbrowserchrome createchromewindow(in nsiwebbrowserchrome parent, in pruint32 chromeflags); methods createchromewindow() create a new window.
... gecko will/may call this method, if made available to it, to create new windows.
nsIWindowsShellService
inherits from: nsishellservice last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview string getregistryentry(in long ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void restorefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen.
...obsolete since gecko 1.8 methods getregistryentry() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) retrieves a windows registry entry value.
nsIWorker
method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
... methods postmessage() used to allow the worker to send a message back to the web application that created it.
nsIWorkerMessageEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
... methods initmessageevent() initializes the message event.
nsIWorkerScope
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.
... methods close() allows the worker to terminate itself.
nsIXFormsModelElement
extensions/xforms/nsixformsmodelelement.idlscriptable defines scriptable methods for manipulating instance data and updating computed and displayed values.
... 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.
nsIXPCException
inherits from: nsiexception last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); xpcexjsval stealjsval(); native code only!
... methods initialize() void initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation adata ainner native code only!stealjsval xpcexjsval stealjsval(); parameters none.
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); n...
...sidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor.
nsIXULRuntime
to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running.
... methods invalidatecachesonrestart() signal the apprunner to invalidate caches on the next restart.
nsIXULSortService
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void insertcontainernode(in nsirdfcompositedatasource db, in nsrdfsortstate sortstateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify); native code only!
... 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.
nsIXmlRpcFault
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only.
... methods init() void getdata( in print32 faultcode, in string faultstring ); parameters faultcode tostring() string tostring(); ...
nsIZipReaderCache
to create an instance, use: var zipreadercache = components.classes["@mozilla.org/libjar/zip-reader-cache;1"] .createinstance(components.interfaces.nsizipreadercache); method overview nsizipreader getinnerzip(in nsifile zipfile, in autf8string zipentry); nsizipreader getinnerzip(in nsifile zipfile, in string zipentry); obsolete since gecko 10 nsizipreader getzip(in nsifile zipfile); void init(in unsigned long cachesize); methods getinnerzip() returns a (possibly shared) cached nsizipreader for a zip inside another zip.
...note: if nsizipreader.close has been called on the shared nsizipreader, this method will return the closed nsizipreader nsizipreader getzip( in nsifile zipfile ); parameters zipfile the zip file.
XPCOM Thread Synchronization
xpcom thread synchronization primitives have the same semantics as those in nspr, and each method of these synchronization objects (e.g.
... concurrentmethod() { nsautolock al(mlock); nsautomonitor am(mmonitor); if (needexpensivecomputation()) { nsautounlock au(mlock); } am.wait(); pr_notifycondvar(mcvar); } new usage using namespace mozilla; concurrentmethod() { mutexautolock al(mlock); monitorautoenter am(mmonitor); if (needexpensivecomputation()) { mutexautounlock...
Using IndexedDB in chrome
r principal = cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); var sandbox = components.utils.sandbox(principal, options); // the sandbox will have access to indexeddb var sandboxscript = 'var req = indexeddb.open("my-database");'; components.utils.evalinsandbox(sandboxscript, sandbox); before firefox 33, you would access indexeddb from chrome code using the initwindowless method of the nsiindexeddatabasemanager service.
... this method was removed in firefox 33.
Using nsIDirectoryService
the new method the new method uses nsidirectoryservice to locate files and directories.
...if you want to use mpfilelocprovider, or something like it, to provide one fixed profile, just construct it and call its initialize method - it will register itself.
Autoconfiguration in Thunderbird
this method is not practical for other use cases, because it is difficult to update the configuration file.
...users may also choose to manually modify the account settings, even if configuration information is successfully obtained by the methods described above.
DB Views (message lists)
view interaction with nsitreeview the nsitreeview methods in nsmsgdbview.cpp control the appearance of the thread pane.
... properties these nsmsgdbview methods set properties, nsitreeview.getrowproperties (implementation) nsitreeview.getcellpropreties (implementation) theming the theme uses these properties to style the thread pane.
Filelink Providers
for each input event, the checkvalidity method of the form is automatically called.
... the button to set up the account will only become enabled once the checkvalidity method for the form returns true.
Index
94 access thunderbird window areas thunderbird to access particular parts of the thunderbird window you can use these helper methods.
... an alternative to these methods is to directly access the element by it's id as in the detect when a folder opens example.
MailNews Filters
applyfilterstohdr will in turn call the applyfilterhit method of the passed in nsimsgfilterhitnotify interface ptr.
... finally, add protocol-specific code to apply your filter action in the various applyfilterhit methods imap pop3 news and "after the fact" since seamonkey and thunderbird share the filter code, you will also need to update the seamonkey .dtd and .property files.
Mail and RDF
reflecting data to rdf in order to have a dynamic ui that updates when the underlying content changes, a datasource must implement two key methods of reflecting data into rdf.
...information for this column is queried when the tree's rdf template calls the folder datasource's gettarget() method.
Thunderbird Configuration Files
in almost all cases, edits made using the user.js can be done via the config editor, which is the recommended method.
... linux users: use your own preferred method to create user.js in the profile folder.
Finding the code for a feature
trying to figure that out from the code, i see that is just a clever way to do the addkeywordstomessages or removekeywordsfrommessages method call.
... (please don't do that guys, it really makes code search difficult!) so the answer the your question is, use the nsimsgfolder method "addkeywordstomessages" (and now i remember that i knew that!).
Activity Manager examples
// assuming that gjunkprocessor is the entity initiating the junk processing // activity, and it has cancelfolderop method that cancels the operations on folders process.init("processing folder: " + folder.prettiestname, gjunkprocessor); // folder is being filtered/processed process.addsubject(folder); process.cancelhandler = new canceljunkprocess(); ...
... ////////////////////////////////////////////////////////////////////////////// //// undo handler implementation class mycopyeventundo : public nsiactivityundohandler { public: ns_decl_isupports ns_decl_nsiactivityundohandler mycopyeventundo() {} private: ~mycopyeventundo() {} }; ns_impl_isupports1(mycopyeventundo, nsiactivityundohandler) ns_imethodimp mycopyeventundo::undo(nsiactivityevent *event, nsresult *result) { nsresult rv; // get the subjects of this copy event pruint32 length; nsivariant **subjectlist; rv = event->getsubjects(&length, &subjectlist); if(ns_failed(rv)) return rv; // first subject in the list is the source folder in this particular case nscomptr<nsimsgfolder> folder = do_queryinterface(subjectlist[...
Folders and message lists
getting the current nsimsgfolder the nsimsgfolder interface contains many methods and attributes for working with folders.
...otherwise, use one of the methods described below.
libmime content type handlers
pizzarro <rhp@netscape.com> contents overview api's plugin location/installation sample content type handler plugin overview the libmime module implements a general-purpose mime parser and one of the primary methods provided by the parser is the ability to emit an html representation of an input stream.
..."nsisupports.h" #include "mimecth.h" // {20dabd99-f8b5-11d2-8ee0-00a024a7d144} #define ns_imime_content_type_handler_iid \ { 0x20dabd99, 0xf8b5, 0x11d2, \ { 0x8e, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } } class nsimimecontenttypehandler : public nsisupports { public: static const nsiid& getiid() { static nsiid iid = ns_imime_content_type_handler_iid; return iid; } ns_imethod getcontenttype(char **contenttype) = 0; ns_imethod createcontenttypehandlerclass(const char *content_type, contenttypehandlerinitstruct *initstruct, mimeobjectclass **objclass) = 0; }; #endif /* nsimimecontenttypehandler_h_ */ plugin installation/location the installation of these modules wi...
Virtualenv
the populate_virtualenv.py script, when invoked, installs a list of packages, http://mxr.mozilla.org/mozilla-central/source/build/virtualenv/packages.txt , into the virtualenv via one of various methods.
...when using this method, be aware that the parts of package installation invoked via setup.py, such as console-script creation and dependency resolution, will not be invoked.
Using C struct and pointers
.structtype("st_t", [ { "self": ctypes.pointertype(ctypes.void_t) }, { "str": ctypes.pointertype(ctypes.char) }, { "buff_size": ctypes.size_t }, { "i": ctypes.int }, { "f": ctypes.float }, { "c": ctypes.char } ]); here we are using the structtype() factory method of the ctypes object to create a ctype object that represents the c struct named st_t.
... the first parameter of this method is the name of the type, which corresponds to the name of the c struct.
Standard OS Libraries
, rootx.address(), rooty.address(), windowx.address(), windowy.address(), mask.address() ); xclosedisplay(display); components.utils.reporterror(rootx.value + "," + rooty.value); x11.close(); resources for x11 extended window manager hints githubgists :: noitidart / search · x11 - x11 js-ctypes snippets that can be copied and pasted to scratchpad xcb all the above methods, gdk, gtk, and x11/xlib are meant to be used on the main thread.
... resources for xcb github :: noitidart - ostypes / ostypes_x11.jsm - some method and type signatures xcb freedesktop :: xproto.h mac os x mac os x has two categories of c-based api (carbon, core foundation) and objective-c based api (cocoa).
ctypes.open
there are two options: custom native file (dll, so, dylib, etc.) standard os libraries custom native file for this method, a native file must be created.
...irefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" var filepath_mylib = localfilemylib.path; // "file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" if your add-on is a bootstrap add-on, then you don't need to use this method to convert a chrome:// path; instead, on startup procedure of the bootstrap add-on obtain the file and/or jar path from installpath from the adata parameter.
ArrayType
method overview methods inherited from ctype ctype array([n]) string tosource() string tostring() arraytype cdata syntax cdata sized_arraytype(); cdata unsized_arraytype(length); sized_arraytype and unsized_arraytype are arraytype ctype.
... arraytype cdata method_overview cdata addressofelement(idx) methods inherited from cdata cdata address() string tosource() string tostring() arraytype cdata methods addressofelement() returns a new cdata object of the appropriate pointer type, whose value points to the specified array element on which the method was called.
PointerType
method overview methods inherited from ctype ctype array([n]) string tosource() string tostring() pointertype cdata syntax cdata pointertype(); pointertype is pointertype ctype.
... pointertype cdata method_overview bool isnull() methods inherited from cdata cdata address() string tosource() string tostring() pointertype cdata methods isnull() determines whether or not the pointer's value is null.
Mozilla
the component can then call methods on the observer interface to signal the external code when predefined events occur.
...all the methods that are supposed to show up on this jsobject are actually not properties of the object itself, but rather properties of the prototype of the jsobject for the wrapper (unless the c++ object's class info has the flag nsixpcscriptable::dont_share_prototype set, but lets assume that's not the case here).
Flash Activation: Browser Comparison - Plugins
this can be done by calling a javascript function when the plugin is activated: function plugincreated() { // we don't need to see the plugin, so hide it by resizing var plugin = document.getelementbyid('myplugin'); plugin.height = 0; plugin.width = 0; plugin.callpluginmethod(); } the html, by default, specifies the flash object to be a size that makes it visible, like this: <!-- give the plugin an initial size so it is visible --> <object type="application/x-shockwave-flash" data="myapp.swf" id="myplugin" width="300" height="300"> <param name="callback" value="plugincreated()"> </object> the callback parameter defined in the html can be called in flash usi...
... javascript function plugincreated(), like this: <object type="application/x-my-plugin" data="somedata.mytype" id="myplugin"> <param name="callback" value="plugincreated()"> </object> the plugincreated() function is then responsible for the setup of your script and any calls back into the plugin that you need to make: function plugincreated() { document.getelementbyid('myplugin').callpluginmethod(); } ...
Debugger.Memory - Firefox Developer Tools
ifdbg is a debugger instance, then the methods and accessor properties of dbg.memory control howdbg observes its debuggees’ memory use.
... the dbg.memory object is an instance of debugger.memory; its inherited accesors and methods are described below.
Tutorial: Set a breakpoint - Firefox Developer Tools
when control reaches the start of the report function, debugger calls the breakpoint handler’s hit method, passing a debugger.frame instance.
... the hit method logs the breakpoint hit to the browser content toolbox’s console.
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.
...the difference is that they show the properties and methods within a side panel inside the web console.
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
the angle_instanced_arrays.drawarraysinstancedangle() method of the webgl api renders primitives from array data like the gl.drawarrays() method.
... note: when using webgl2, this method is available as gl.drawarraysinstanced() by default.
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
the angle_instanced_arrays.drawelementsinstancedangle() method of the webgl api renders primitives from array data like the gl.drawelements() method.
... note: when using webgl2, this method is available as gl.drawelementsinstanced() by default.
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
the angle_instanced_arrays.vertexattribdivisorangle() method of the webgl api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
... note: when using webgl2, this method is available as gl.vertexattribdivisor() by default.
AbstractRange - Web APIs
methods the abstractrange interface offers no methods.
...range provides methods that allow you to alter the range's endpoints, as well as methods to compare ranges, detect intersections beween ranges, and so forth.
AbstractWorker - Web APIs
the abstractworker interface of the web workers api is an abstract interface that defines properties and methods that are common to all types of worker, including not only the basic worker, but also serviceworker and sharedworker.
... methods the abstractworker interface doesn't implement or inherit any methods.
Animation.cancel() - Web APIs
WebAPIAnimationcancel
the web animations api's cancel() method of the animation interface clears all keyframeeffects caused by this animation and aborts its playback.
... 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.pause() - Web APIs
WebAPIAnimationpause
the pause() method of the web animations api's animation interface suspends playback of the animation.
... example animation.pause() is used many times in the alice in web animations api land growing/shrinking alice game, largely because animations created with the element.animate() method immediately start playing and must be paused manually if you want to avoid that: // animation of the cupcake slowly getting eaten up var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // doesn't act...
Animation.updatePlaybackRate() - Web APIs
the updateplaybackrate() method of the web animations api's animation interface sets the speed of an animation after first synchronizing its playback position.
... updateplaybackrate() is an asynchronous method that sets the speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in speed does not produce a sharp jump.
AnimationEffect.getComputedTiming() - Web APIs
the getcomputedtiming() method of the animationeffect interface returns the calculated timing properties for this animation effect.
... although many of the attributes of the returned object are common to the effecttiming contained in the object returned by the animationeffect.gettiming() method, the values returned by this object differ in the following ways: duration returns the calculated value of the iteration duration.
AnimationEvent - Web APIs
methods also inherits methods from its parent event.
... animationevent.initanimationevent() initializes a animationevent created using the deprecated document.createevent("animationevent") method.
AudioBuffer - Web APIs
the audiobuffer interface represents a short audio asset residing in memory, created from an audio file using the audiocontext.decodeaudiodata() method, or from raw data using audiocontext.createbuffer().
... methods audiobuffer.getchanneldata() returns a float32array containing the pcm data associated with the channel, defined by the channel parameter (with 0 representing the first channel).
AudioBufferSourceNode.start() - Web APIs
the start() method of the audiobuffersourcenode interface is used to schedule playback of the audio data contained in the buffer, or to begin playback immediately.
...if this parameter isn't specified, the sound plays until it reaches its natural conclusion or is stopped using the stop() method.
AudioBufferSourceNode - Web APIs
an audiobuffersourcenode can be instantiated using the audiocontext.createbuffersource() method.
... methods inherits methods from its parent, audioscheduledsourcenode.
AudioContext.close() - Web APIs
the close() method of the audiocontext interface closes the audio context, releasing any system audio resources that it uses.
...this method throws an invalid_state_err exception if called on an offlineaudiocontext.
AudioContext.createJavaScriptNode() - Web APIs
the audiocontext.createjavascriptnode() method creates a javascriptnode which is used for directly manipulating audio data with javascript.
... important: this method is obsolete, and has been renamed to audiocontext.createscriptprocessor().
AudioContext.createMediaStreamDestination() - Web APIs
the createmediastreamdestination() method of the audiocontext interface is used to create a new mediastreamaudiodestinationnode object associated with a webrtc mediastream representing an audio stream, which may be stored in a local file or sent to another computer.
...this stream can be used in a similar way as a mediastream obtained via navigator.getusermedia — it can, for example, be sent to a remote peer using the rtcpeerconnection addstream() method.
AudioContext.createWaveTable() - Web APIs
the audiocontext method createwavetable() is now obsolete; you should instead use the method createperiodicwave().
... it was the older method for creating a periodic waveform.
AudioContext.resume() - Web APIs
the resume() method of the audiocontext interface resumes the progression of time in an audio context that has previously been suspended.
... this method will cause an invalid_state_err exception to be thrown if called on an offlineaudiocontext.
AudioContext.suspend() - Web APIs
the suspend() method of the audiocontext interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing cpu/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while.
... this method will cause an invalid_state_err exception to be thrown if called on an offlineaudiocontext.
AudioListener.dopplerFactor - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.forwardX - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.forwardY - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.forwardZ - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.positionX - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.positionY - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.positionZ - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.speedOfSound - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
the connect() method of the audionode interface lets you connect one of the node's outputs to a target, which may be either another audionode (thereby directing the sound data to the specified node) or an audioparam, so that the node's output data is automatically used to change the value of that parameter over time.
... examples connecting to an audio input the most obvious use of the connect() method is to direct the audio output from one node into the audio input of another node for further processing.
AudioNode.disconnect() - Web APIs
the disconnect() method of the audionode interface lets you disconnect one or more nodes from the node on which the method is called.
... syntax audionode.disconnect(); audionode.disconnect(output); audionode.disconnect(destination); audionode.disconnect(destination, output); audionode.disconnect(destination, output, input); return value undefined parameters there are several versions of the disconnect() method, which accept different combinations of parameters to control which nodes to disconnect from.
AudioParam.cancelScheduledValues() - Web APIs
the cancelscheduledvalues() method of the audioparam interface cancels all scheduled future changes to the audioparam.
...in some older implementations this method returns void.
AudioParam.setTargetAtTime() - Web APIs
the settargetattime() method of the audioparam interface schedules the start of a gradual change to the audioparam value.
...however, for mathematical reasons, that method does not work if the current value or the target value is 0.
AudioParam.setValueAtTime() - Web APIs
the setvalueattime() method of the audioparam interface schedules an instant change to the audioparam value at a precise time, as measured against audiocontext.currenttime.
...when the buttons are pressed, the currgain variable is incremented/decremented by 0.25, then the setvalueattime() method is used to set the gain value equal to currgain, one second from now (audioctx.currenttime + 1.) // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); ...
AudioParam - Web APIs
methods audioparam.setvalueattime() schedules an instant change to the value of the audioparam at a precise time, as measured against audiocontext.currenttime.
... audioparam.cancelandholdattime() cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
AudioProcessingEvent - Web APIs
the number of channels is defined as a parameter, numberofinputchannels, of the factory method audiocontext.createscriptprocessor().
...the number of channels is defined as a parameter, numberofoutputchannels, of the factory method audiocontext.createscriptprocessor().
AudioScheduledSourceNode.stop() - Web APIs
the stop() method on audioscheduledsourcenode schedules a sound to cease playback at the specified time.
...if the node has already stopped, this method has no effect.
AudioScheduledSourceNode - Web APIs
specifically, this interface defines the start() and stop() methods, as well as the onended event handler.
... methods inherits methods from its parent interface, audionode, and adds the following methods: start() schedules the node to begin playing the constant sound at the specified time.
AudioTrackList.getTrackById() - Web APIs
the audiotracklist method gettrackbyid() returns the first audiotrack object from the track list whose id matches the specified string.
...if no match is found, this method returns null.
AudioWorklet - Web APIs
methods this interface inherits methods from worklet.
... the audioworklet interface does not define any methods of its own.
AudioWorkletGlobalScope - Web APIs
methods registerprocessor() registers a class derived from the audioworkletprocessor interface.
... // test-processor.js class testprocessor extends audioworkletprocessor { constructor () { super() // current sample-frame and time at the moment of instantiation // to see values change, you can put these two lines in process method console.log(currentframe) console.log(currenttime) } // the process method is required - simply output silence, // which the outputs are already filled with process (inputs, outputs, parameters) { return true } } // the sample rate is not going to change ever, // because it's a read-only property of a baseaudiocontext // and is set only during its instantiation console.log(...
AudioWorkletNode - Web APIs
methods also inherits methods from its parent, audionode.
... the audioworkletnode interface does not define any methods of its own.
AuthenticatorAttestationResponse.getTransports() - Web APIs
gettransports() is a method of the authenticatorattestationresponse interface that returns an array containing strings describing the different transports which may be used by the authenticator.
... note: this method may only be used in top-level contexts and will not be available in an <iframe> for example.
BaseAudioContext.createBuffer() - Web APIs
the createbuffer() method of the baseaudiocontext interface is used to create a new, empty audiobuffer object, which can then be populated by data, and played via an audiobuffersourcenode for more details about audio buffers, check out the audiobuffer reference page.
...the asynchronous method decodeaudiodata() does the same thing — takes compressed audio, say, an mp3 file, and directly gives you back an audiobuffer that you can then set to play via in an audiobuffersourcenode.
BaseAudioContext.createChannelMerger() - Web APIs
the createchannelmerger() method of the baseaudiocontext interface creates a channelmergernode, which combines channels from multiple audio streams into a single audio stream.
...to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to.
BaseAudioContext.createChannelSplitter() - Web APIs
the createchannelsplitter() method of the baseaudiocontext interface is used to create a channelsplitternode, which is used to access the individual channels of an audio stream and process them separately.
...to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to.
BaseAudioContext.createScriptProcessor() - Web APIs
the createscriptprocessor() method of the baseaudiocontext interface creates a scriptprocessornode used for direct audio processing.
... important: webkit currently (version 31) requires that a valid buffersize be passed when calling this method.
BaseAudioContext.createStereoPanner() - Web APIs
the createstereopanner() method of the baseaudiocontext interface creates a stereopannernode, which can be used to apply stereo panning to an audio source.
...in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method.
BaseAudioContext.state - Web APIs
possible values are: suspended: the audio context has been suspended (with the audiocontext.suspend() method.) running: the audio context is running normally.
... closed: the audio context has been closed (with the audiocontext.close() method.) example the following snippet is taken from our audiocontext states demo (see it running live.) the audiocontext.onstatechange hander is used to log the current state to the console every time it changes.
BasicCardResponse - Web APIs
examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; ...
BeforeInstallPromptEvent - Web APIs
methods beforeinstallpromptevent.prompt() allows a developer to show the install prompt at a time of their own choosing.
... this method returns a promise.
BiquadFilterNode.getFrequencyResponse() - Web APIs
the getfrequencyresponse() method of the biquadfilternode interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies specified in a specified array of frequencies.
... the two output arrays, magresponseoutput and phaseresponseoutput, must be created before calling this method; they must be the same size as the array of input frequency values (frequencyarray).
Blob.slice() - Web APIs
WebAPIBlobslice
the blob interface's slice() method creates and returns a new blob object which contains data from a subset of the blob on which it's called.
... return value a new blob object containing the specified subset of the data contained within the blob on which this method was called.
Blob.text() - Web APIs
WebAPIBlobtext
the text() method in the blob interface returns a promise that resolves with a string containing the contents of the blob, interpreted as utf-8.
... usage notes the filereader method readastext() is an older method that performs a similar function.
BlobBuilder - Web APIs
just create a blobbuilder and append chunks of data to it by calling the append() method.
... 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.
Bluetooth.getAvailability() - Web APIs
the getavailability() method of bluetooth interface of web bluetooth api interface exposes the bluetooth capabilities of the current device.
... exceptions this method doesn't throw any exceptions.
Bluetooth.requestDevice() - Web APIs
the bluetooth.requestdevice() method of the bluetooth interface returns a promise to a bluetoothdevice object with the specified options.
... if there is no chooser ui, this method returns the first device matching the criteria.
Bluetooth - Web APIs
WebAPIBluetooth
methods bluetooth.getavailability() returns a promise that resolved to a boolean indicating whether the user-agent has the ability to support bluetooth.
...if this option is set, that is the value returned by this method.
Body.blob() - Web APIs
WebAPIBodyblob
the blob() method of the body mixin takes a response stream and reads it to completion.
... note: if the response has a response.type of "opaque", the resulting blob will have a blob.size of 0 and a blob.type of empty string "", which renders it useless for methods like url.createobjecturl.
Broadcast Channel API - Web APIs
// connection to a broadcast channel const bc = new broadcastchannel('test_channel'); sending a message it is enough to call the postmessage() method on the created broadcastchannel object, which takes any object as an argument.
...a function can be run for this event with the onmessage event handler: // a handler that only logs the event to the console: bc.onmessage = function (ev) { console.log(ev); } disconnecting a channel to leave a channel, call the close() method on the object.
CSS.escape() - Web APIs
WebAPICSSescape
the css.escape() static method returns a cssomstring containing the escaped string passed as parameter, mostly for use as part of a css selector.
... examples basic results css.escape(".foo#bar") // "\.foo\#bar" css.escape("()[]{}") // "\(\)\[\]\{\}" css.escape('--a') // "--a" css.escape(0) // "\30 ", the unicode code point of '0' is 30 css.escape('\0') // "\ufffd", the unicode replacement character in context uses to escape a string for use as part of a selector, the escape() method can be used: var element = document.queryselector('#' + css.escape(id) + ' > img'); the escape() method can also be used for escaping strings, although it escapes characters that don't strictly need to be escaped: var element = document.queryselector('a[href="#' + css.escape(fragment) + '"]'); specification specification status comment css object model (cssom)the defi...
CSSGroupingRule - Web APIs
methods common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all methods of this class.
... it has two specific methods: cssgroupingrule.deleterule deletes a rule from the style sheet.
CSSKeyframeRule - Web APIs
methods as a cssrule, csskeyframerule also implements the methods of that interface.
... it has no specific methods.
CSSKeyframesRule - Web APIs
methods as a cssrule, csskeyframesrule also implements the methods of that interface.
... it has three specific methods: csskeyframesrule.appendrule() inserts a new keyframe rule into the current csskeyframesrule.
CSSMathSum - Web APIs
a cssmathsum is the object type returned when the stylepropertymapreadonly.get() method is used on a css property whosevalue is created with a calc() function.
... event handlers no methods none.
CSSMediaRule - Web APIs
methods as a cssconditionrule, and therefore both a cssgroupingrule and a cssrule, cssmediarule also implements the methods of that interface.
... it has no specific methods.
CSSNamespaceRule - Web APIs
methods as a cssrule, cssnamespacerule also implements the methods of that interface.
... it has no specific methods: specification specification status comment css object model (cssom)the definition of 'cssnamespacerule' in that specification.
CSSNumericValue.add() - Web APIs
the add() method of the cssnumericvalue interface adds a supplied number to the cssnumericvalue.
... return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.div() - Web APIs
the div() method of the cssnumericvalue interface divides the cssnumericvalue by the supplied value.
... exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.max() - Web APIs
the max() method of the cssnumericvalue interface returns the highest value from among the values passed.
... exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.min() - Web APIs
the min() method of the cssnumericvalue interface returns the lowest value from among those values passed.
... exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.mul() - Web APIs
the mul() method of the cssnumericvalue interface multiplies the cssnumericvalue by the supplied value.
... return value a cssmathproduct exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.sub() - Web APIs
the sub() method of the cssnumericvalue interface subtracts a supplied number from the cssnumericvalue.
... return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.sum() - Web APIs
the sub() method of the cssnumericvalue interface subtracts a supplied number from the cssnumericvalue.
... syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method.
CSSNumericValue.to() - Web APIs
the to() method of the cssnumericvalue interface converts a numberic value from one unit to another.
... exceptions syntaxerror indicates that an invalid type was passed to the method.
CSSNumericValue.toSum() - Web APIs
the tosum() method of the cssnumericvalue interface converts the object's value to a cssmathsum object to values of the specified unit.
... exceptions syntaxerror undefined typeerror indicates that an invalid type was passed to the method.
CSSPageRule - Web APIs
methods as a cssrule, csspagerule also implements the methods of that interface.
... it has no specific methods.
CSSPrimitiveValue.getFloatValue() - Web APIs
the getfloatvalue() method of the cssprimitivevalue interface is used to get a float value in a specified unit.
...the value can be obtained by using the getfloatvalue method.
CSSPrimitiveValue.setFloatValue() - Web APIs
the setfloatvalue() method of the cssprimitivevalue interface is used to set a float value.
...the value can be obtained by using the getfloatvalue method.
CSSRuleList - Web APIs
note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent stylesheet.
... in fact, .insertrule() and .deleterule() are not even methods of cssrulelist, but only of cssstylesheet.
CSSStyleDeclaration.item() - Web APIs
the cssstyledeclaration.item() method interface returns a css property name from a cssstyledeclaration by index.
... this method doesn't throw exceptions as long as you provide arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is provided.
CSSStyleDeclaration.setProperty() - Web APIs
the cssstyledeclaration.setproperty() method interface sets a new value for a property on a css style declaration object.
...in each case, this is done with the setproperty() method, for example boxpararule.style.setproperty('border', newborder); html <div class="controls"> <button class="border">border</button> <button class="bgcolor">background</button> <button class="color">text</button> </div> <div class="box"> <p>box</p> </div> css html { background: orange; font-family: sans-serif; height: 100%; } body { height: inherit; width: 80%; min-width: ...
CSSSupportsRule - Web APIs
methods as a cssconditionrule and therefore a cssruleand a cssgroupingrule, csssupportsrule also implements the methods of that interface.
... it has no specific methods.
CSSUnitValue - Web APIs
methods none.
... examples the following shows a method of creating a csspositionvalue from individual cssunitvalue constructors.
CSSValue.cssValueType - Web APIs
css_primitive_value the value is a primitive value and an instance of the cssprimitivevalue interface can be obtained by using binding-specific casting methods on this instance of the cssvalue interface.
... css_value_list the value is a cssvalue list and an instance of the cssvaluelist interface can be obtained by using binding-specific casting methods on this instance of the cssvalue interface.
CSSValue - Web APIs
WebAPICSSValue
css_primitive_value the value is a primitive value and an instance of the cssprimitivevalue interface can be obtained by using binding-specific casting methods on this instance of the cssvalue interface.
... css_value_list the value is a cssvalue list and an instance of the cssvaluelist interface can be obtained by using binding-specific casting methods on this instance of the cssvalue interface.
CSSValueList.item() - Web APIs
WebAPICSSValueListitem
the item() method of the cssvaluelist interface is used to retrieve a cssvalue by ordinal index.
...if the index is greater than or equal to the number of values in the list, this method returns null.
Cache.add() - Web APIs
WebAPICacheadd
the add() method of the cache interface takes a url, retrieves it, and adds the resulting response object to the given cache.
... the add() method is functionally equivalent to the following: fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) for more complex operations, you'll need to use cache.put() directly.
Cache.addAll() - Web APIs
WebAPICacheaddAll
the addall() method of the cache interface takes an array of urls, retrieves them, and adds the resulting response objects to the given cache.
... note: addall() will overwrite any key/value pairs previously stored in the cache that match the request, but will fail if a resulting put() operation would overwrite a previous cache entry stored by the same addall() method.
Cache.delete() - Web APIs
WebAPICachedelete
the delete() method of the cache interface finds the cache entry whose key is the request, and if found, deletes the cache entry and returns a promise that resolves to true.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
Cache.keys() - Web APIs
WebAPICachekeys
the keys() method of the cache interface returns a promise that resolves to an array of cache keys.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
Cache.matchAll() - Web APIs
WebAPICachematchAll
the matchall() method of the cache interface returns a promise that resolves to an array of all matching responses in the cache object.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
Cache - Web APIs
WebAPICache
use cachestorage.open() to open a specific named cache object and then call any of the cache methods to maintain the cache.
... methods cache.match(request, options) returns a promise that resolves to the response associated with the first matching request in the cache object.
CacheStorage.keys() - Web APIs
WebAPICacheStoragekeys
the keys() method of the cachestorage interface returns a promise that will resolve with an array containing strings corresponding to all of the named cache objects tracked by the cachestorage object in the order they were created.
... use this method to iterate over a list of all cache objects.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
the canvascapturemediastreamtrack method requestframe() requests that a frame be captured from the canvas and sent to the stream.
... to prevent automatic capture of frames, so that frames are only captured when requestframe() is called, specify a value of 0 for the capturestream() method when creating the stream.
CanvasGradient.addColorStop() - Web APIs
the canvasgradient.addcolorstop() method adds a new color stop, defined by an offset and a color, to a given canvas gradient.
... examples adding stops to a gradient this example uses the addcolorstop method to add stops to a linear canvasgradient object.
CanvasGradient - Web APIs
it is returned by the methods canvasrenderingcontext2d.createlineargradient() or canvasrenderingcontext2d.createradialgradient().
... methods there is no inherited method.
CanvasRenderingContext2D.addHitRegion() - Web APIs
the canvasrenderingcontext2d method addhitregion() adds a hit region to the bitmap.
... examples using the addhitregion method this example demonstrates the addhitregion() method.
CanvasRenderingContext2D.clearHitRegions() - Web APIs
the canvasrenderingcontext2d method clearhitregions() removes all hit regions from the canvas.
... syntax void ctx.clearhitregions(); examples using the clearhitregions method this example demonstrates the clearhitregions() method.
CanvasRenderingContext2D.createImageData() - Web APIs
the canvasrenderingcontext2d.createimagedata() method of the canvas 2d api creates a new, blank imagedata object with the specified dimensions.
... examples creating a blank imagedata object this snippet creates a blank imagedata object using the createimagedata() method.
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
the canvasrenderingcontext2d.drawfocusifneeded() method of the canvas 2d api draws a focus ring around the current or given path, if the specified element is focused.
...the drawfocusifneeded() method is used to draw a focus ring when appropriate.
CanvasRenderingContext2D.ellipse() - Web APIs
the canvasrenderingcontext2d.ellipse() method of the canvas 2d api adds an elliptical arc to the current sub-path.
... syntax void ctx.ellipse(x, y, radiusx, radiusy, rotation, startangle, endangle [, anticlockwise]); the ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusx and radiusy.
CanvasRenderingContext2D.getLineDash() - Web APIs
the getlinedash() method of the canvas 2d api's canvasrenderingcontext2d interface gets the current line dash pattern.
... examples getting the current line dash setting this example demonstrates the getlinedash() method.
CanvasRenderingContext2D.isPointInPath() - Web APIs
the canvasrenderingcontext2d.ispointinpath() method of the canvas 2d api reports whether or not the specified point is contained in the current path.
... examples checking a point in the current path this example uses the ispointinpath() method to check if a point is within the current path.
CanvasRenderingContext2D.isPointInStroke() - Web APIs
the canvasrenderingcontext2d.ispointinstroke() method of the canvas 2d api reports whether or not the specified point is inside the area contained by the stroking of a path.
... examples checking a point in the current path this example uses the ispointinstroke() method to check if a point is within the area of the current path's stroke.
CanvasRenderingContext2D.removeHitRegion() - Web APIs
the canvasrenderingcontext2d method removehitregion() removes a given hit region from the canvas.
... examples using the removehitregion method this example demonstrates the removehitregion() method.
CanvasRenderingContext2D.rotate() - Web APIs
the canvasrenderingcontext2d.rotate() method of the canvas 2d api adds a rotation to the transformation matrix.
...to change the center point, you will need to move the canvas by using the translate() method.
CanvasRenderingContext2D.save() - Web APIs
the canvasrenderingcontext2d.save() method of the canvas 2d api saves the entire state of the canvas by pushing the current state onto a stack.
... syntax void ctx.save(); examples saving the drawing state this example uses the save() method to save the default state and restore() to restore it later, so that you are able to draw a rect with the default state later.
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
the canvasrenderingcontext2d.scrollpathintoview() method of the canvas 2d api scrolls the current or given path into view.
... examples using the scrollpathintoview method this example demonstrates the scrollpathintoview() method.
CanvasRenderingContext2D.setLineDash() - Web APIs
the setlinedash() method of the canvas 2d api's canvasrenderingcontext2d interface sets the line dash pattern used when stroking lines.
... examples basic example this example uses the setlinedash() method to draw a dashed line above a solid line.
CanvasRenderingContext2D.setTransform() - Web APIs
the canvasrenderingcontext2d.settransform() method of the canvas 2d api resets (overrides) the current transformation to the identity matrix, and then invokes a transformation described by the arguments of this method.
... note: see also the transform() method; instead of overriding the current transform matrix, it multiplies it with a given one.
CanvasRenderingContext2D.transform() - Web APIs
the canvasrenderingcontext2d.transform() method of the canvas 2d api multiplies the current transformation with the matrix described by the arguments of this method.
... note: see also the settransform() method, which resets the current transform to the identity matrix and then invokes transform().
Compositing and clipping - Web APIs
globalcompositeoperation we can not only draw new shapes behind existing shapes but we can also use it to mask off certain areas, clear sections from the canvas (not limited to rectangles like the clearrect() method does) and more.
... in the chapter about drawing shapes i only mentioned the stroke() and fill() methods, but there's a third method we can use with paths, called clip().
Drawing text - Web APIs
drawing text the canvas rendering context provides two methods to render text: filltext(text, x, y [, maxwidth]) fills a given text at the given (x,y) position.
...nvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it.
CaretPosition - Web APIs
you can get a caretposition using the document.caretpositionfrompoint method.
... methods caretposition.getclientrect specification specification status comment css object model (cssom) view modulethe definition of 'caretposition' in that specification.
ChannelMergerNode - Web APIs
methods no specific method; inherits methods from its parent, audionode.
...to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to.
ChannelSplitterNode - Web APIs
methods no specific method; inherits methods from its parent, audionode.
...to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to.
Using channel messaging - Web APIs
finally we transfer messagechannel.port2 to the iframe using the window.postmessage method.
...on initport(e) { port2 = e.ports[0]; port2.onmessage = onmessage; } // handle messages received on port2 function onmessage(e) { var listitem = document.createelement('li'); listitem.textcontent = e.data; list.appendchild(listitem); port2.postmessage('message received by iframe: "' + e.data + '"'); } when the initial message is received from the main page via the window.postmessage method, we run the initport function.
Client - Web APIs
WebAPIClient
you can get client/windowclient objects from methods such as clients.matchall() and clients.get().
... methods client.postmessage() sends a message to the client.
Clients.claim() - Web APIs
WebAPIClientsclaim
the claim() method of the clients interface allows an active service worker to set itself as the controller for all clients within its scope.
...the claim() method causes those pages to be controlled immediately.
Clipboard.readText() - Web APIs
the clipboard interface's readtext() method returns a promise which resolves with a copy of the textual contents of the system clipboard..
... to read non-text contents from the clipboard, use the read() method instead.
ClipboardItem() - Web APIs
note: to work with text see the clipboard.readtext() and clipboard.writetext() methods of the clipboard interface.
... examples the below example requests a png image using the fetch api, and in turn, the responses' blob() method, to create a new clipboarditem and write it to the clipboard, using the clipboard api.
ClipboardItem.getType() - Web APIs
the gettype() method of the clipboarditem interface returns a promise that resolves with a blob of the requested mime type or an error if the mime type is not found.
... examples in the following example, we're returning all items on the clipboard via the clipboard.read() method.
ClipboardItem.types - Web APIs
examples in the below example, we're returning all items on the clipboard via the clipboard.read() method.
... then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object.
CompositionEvent.locale - Web APIs
the locale read-only property of the compositionevent interface returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with ime).
... syntax mylocale = compositionevent.locale value a domstring representing the locale of current input method.
Console.group() - Web APIs
WebAPIConsolegroup
the console.groupcollapsed() method is similar, but the new block is collapsed and requires clicking a disclosure button to read it.
... note: from gecko 9 until gecko 51, the groupcollapsed() method was the same as group().
console.trace() - Web APIs
WebAPIConsoletrace
the console interface's trace() method outputs a stack trace to the web console.
...these are assembled and formatted the same way they would be if passed to the console.log() method.
Console API - Web APIs
find out about these at: google chrome devtools implementation safari devtools implementation usage is very simple — the console object — available via window.console, or workerglobalscope.console in workers; accessible using just console — contains many methods that you can call to perform rudimentary debugging tasks, generally focused around logging various values to the browser's web console.
... by far the most commonly-used method is console.log, which is used to log the current value contained inside a specific variable.
ContentIndex.getAll() - Web APIs
the getall() method of the contentindex interface returns a promise that resolves with an iterable list of content index entries.
... syntax var indexedcontent = contentindex.getall(); parameters this method receives no parameters.
ContentIndexEvent - Web APIs
it is not fired when the contentindex.delete method is called.
... methods while contentindexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent.
CredentialsContainer.create() - Web APIs
the create() method of the credentialscontainer interface returns a promise that resolves with a new credential instance based on the provided options, or null if no credential object can be created.
... this method is restricted to top-level contexts.
CredentialsContainer.store() - Web APIs
the store() method of the credentialscontainer stores a set of credentials for the user inside a credential instance, returning this in a promise.
... this method is restricted to top-level contexts.
Crypto - Web APIs
WebAPICrypto
methods this interface implements methods defined on randomsource.
...in addition, the crypto method getrandomvalues() is available on insecure contexts, but the subtle property is not.
CryptoKey - Web APIs
WebAPICryptoKey
the cryptokey interface of the web crypto api represents a cryptographic key obtained from one of the subtlecrypto methods generatekey(), derivekey(), importkey(), or unwrapkey().
... examples the examples for subtlecrypto methods often use cryptokey objects.
DOMImplementation.hasFeature() - Web APIs
the domimplementation.hasfeature() method returns a boolean flag indicating if a given feature is supported.
...the latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
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.
... <svg width="100" height="100" viewbox="-50 0 100 100"> <path fill="red" d="m 0 50 l 50 0 l 50 100 z" /> <path id="flipped" fill="blue" d="m 0 50 l 50 0 l 50 100 z" /> </svg> this javascript first creates an identity matrix, then uses the `flipx()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis.
DOMPointReadOnly.toJSON() - Web APIs
the dompointreadonly method tojson() returns a dompointinit object giving the json form of the point object.
... return value a new dompointinit object whose properties are set to the values in the dompoint or dompointreadonly on which the method was called.
DOMTokenList.replace() - Web APIs
the replace() method of the domtokenlist interface replaces an existing token with a new token.
...irst, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let result = classes.replace("c", "z"); console.log(result); if (result) { span.textcontent = classes; } else { span.textcontent = 'token not replaced successfully'; } the output looks like this: polyfill the following polyfill will add the replace method to the domtokenlist class.
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.
... this method is intended to support feature detection.
DOMTokenList - Web APIs
methods domtokenlist.item(index) returns the item in the list by its index, or undefined if index is greater than or equal to the list's length.
... first, the html: <p class="a b c"></p> now the javascript: let para = document.queryselector("p"); let classes = para.classlist; para.classlist.add("d"); para.textcontent = `paragraph classlist is "${classes}"`; the output looks like this: trimming of whitespace and removal of duplicates methods that modify the domtokenlist (such as domtokenlist.add()) automatically trim any excess whitespace and remove duplicate values from the list.
DataTransfer.setData() - Web APIs
the datatransfer.setdata() method sets the drag operation's drag data to the specified data and type.
... return value void example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods.
DataTransferItem.getAsString() - Web APIs
the datatransferitem.getasstring() method invokes the given callback with the drag data item's string data as the argument if the item's kind is a plain unicode string (i.e.
... example this example shows the use of the getasstring() method as an inline function in a drop event handler.
DataTransferItem.webkitGetAsEntry() - Web APIs
that's done by calling the item's createreader() method.
...for each one, we call its webkitgetasentry() method to obtain a filesystementry representing the file.
DataTransferItem - Web APIs
methods datatransferitem.getasfile() returns the file object associated with the drag data item (or null if the drag item is not a file).
... example all of this interface's methods and properties have their own reference page, and each reference page has an example of its usage.
DataTransferItemList.add() - Web APIs
the datatransferitemlist.add() method creates a new datatransferitem using the specified data and adds it to the drag data list.
... example this example shows the use of the add() method.
DataTransferItemList - Web APIs
methods datatransferitemlist.add() adds an item (either a file object or a string) to the drag item list and returns a datatransferitem object for the new item.
... example each of this interface's methods and properties has a reference page, and each reference page has an example of its usage.
DedicatedWorkerGlobalScope.close() - Web APIs
the close() method of the dedicatedworkerglobalscope interface discards any tasks queued in the dedicatedworkerglobalscope's event loop, effectively closing this particular scope.
... note: there is also a way to stop the worker from the main thread: the worker.terminate method.
DedicatedWorkerGlobalScope.postMessage() - Web APIs
the postmessage() method of the dedicatedworkerglobalscope interface sends a message to the main thread that spawned it.
... the main scope that spawned the worker can send back information to the thread that spawned it using the worker.postmessage method.
DelayNode - Web APIs
WebAPIDelayNode
alternatively, you can use the baseaudiocontext.createdelay() factory method.
... methods no specific methods; inherits methods from its parent, audionode.
Document.adoptNode() - Web APIs
document.adoptnode() transfers a node from another document into the method's document.
... after calling this method, importednode and externalnode are the same object.
Document.clear() - Web APIs
WebAPIDocumentclear
the document.clear() method clears the whole specified document in early (pre-1.0) versions of mozilla.
... in recent versions of mozilla-based applications, as well as in internet explorer and netscape 4, this method does nothing.
Document.cookie - Web APIs
WebAPIDocumentcookie
note that you can only set/update a single cookie at a time using this method.
... the reason for the syntax of the document.cookie accessor property is due to the client-server nature of cookies, which differs from other client-client storage methods (like, for instance, localstorage): the server tells the client to store a cookie http/1.0 200 ok content-type: text/html set-cookie: cookie_name1=cookie_value1 set-cookie: cookie_name2=cookie_value2; expires=sun, 16 jul 3567 06:23:41 gmt [content of the page here] the client sends back to the server its cookies previously stored get /sample_page.html http/1.1 host: www.example.org cookie: ...
Document.createElement() - Web APIs
in an html document, the document.createelement() method creates the html element specified by tagname, or an htmlunknownelement if tagname isn't recognized.
...don't use qualified names (like "html:a") with this method.
Document.createExpression() - Web APIs
this method compiles an xpathexpression which can then be used for (repeated) evaluations.
... firefox 3 note prior to firefox 3, you could call this method on documents other than the one you planned to run the xpath against.
Document.createRange() - Web APIs
the document.createrange() method returns a new range object.
... example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); notes once a range is created, you need to set its boundary points before you can make use of most of its methods.
Document.getBoxObjectFor() - Web APIs
note: this method is obsolete.
... you should use the element.getboundingclientrect() method instead.
Document.getElementsByTagName() - Web APIs
the getelementsbytagname method of document interface returns an htmlcollection of elements with the given tag name.
... the latest w3c specification says elements is an htmlcollection; however, this method returns a nodelist in webkit browsers.
Document.hasFocus() - Web APIs
WebAPIDocumenthasFocus
the hasfocus() method of the document interface returns a boolean value indicating whether the document or any element inside the document has focus.
... this method can be used to determine whether the active element in a document has focus.
Document.importNode() - Web APIs
the document object's importnode() method creates a copy of a node or documentfragment from another document, to be inserted into the current document later.
...to include it, you need to call an insertion method such as appendchild() or insertbefore() with a node that is currently in the document tree.
Document.open() - Web APIs
WebAPIDocumentopen
the document.open() method opens a document for writing.
...this is no longer the case.document non-spec'ed parameters to document.open gecko-specific notes starting with gecko 1.9, this method is subject to the same same-origin policy as other properties, and does not work if doing so would change the document's origin.
Document.queryCommandEnabled() - Web APIs
the document.querycommandenabled() method reports whether or not the specified editor command is enabled by the browser.
... notes for 'cut' and 'copy' commands the method only returns true when called from a user-initiated thread.
Document.querySelectorAll() - Web APIs
the document method queryselectorall() returns a static (not live) nodelist representing a list of the document's elements that match the specified group of selectors.
... note: this method is implemented based on the parentnode mixin's queryselectorall() method.
DocumentFragment.querySelector() - Web APIs
the documentfragment.queryselector() method returns the first element, or null if no matches are found, within the documentfragment (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors.
... examples basic example in this basic example, the first element in the documentfragment with the class "myclass" is returned: var el = documentfragment.queryselector(".myclass"); css syntax and the method's argument the string argument pass to queryselector must follow the css syntax.
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
the elementsfrompoint() method of the documentorshadowroot interface returns an array of all elements at the specified coordinates (relative to the viewport).
... it operates in a similar way to the elementfrompoint() method.
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
the mselementsfromrect method returns the node list of elements that are under a rectangle defined by left, top, width, and height.
... this proprietary method is specific to internet explorer and microsoft edge.
Using the W3C DOM Level 1 Core - Web APIs
now that you are familiar with the basic concepts of the dom, you may want to learn about the dom level 1 fundamental methods.
...the main thing that's useful to authors is the description of the different dom objects and all their properties and methods.
DynamicsCompressorNode - Web APIs
dynamicscompressornode is an audionode that has exactly one input and one output; it is created using the audiocontext.createdynamicscompressor() method.
... methods no specific methods; inherits methods from its parent, audionode.
EXT_color_buffer_half_float - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods this extension extends webglrenderingcontext.renderbufferstorage(): the internalformat parameter now accepts ext.rgba16f_ext and ext.rgba16f_ext.
EXT_disjoint_timer_query - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... methods this extension exposes eight new methods.
EXT_sRGB - Web APIs
WebAPIEXT sRGB
webgl extensions are available using the webglrenderingcontext.getextension() method.
... constants this extension exposes the following constants, which can be used in the teximage2d(), texsubimage2d(), renderbufferstorage() and getframebufferattachmentparameter() methods.
Element.animate() - Web APIs
WebAPIElementanimate
the element interface's animate() method is a shortcut method which creates a new animation, applies it to the element, then plays the animation.
... examples in the demo down the rabbit hole (with the web animation api), we use the convenient animate() method to immediately create and play an animation on the #tunnel element to make it flow upwards, infinitely.
Element.getAnimations() - Web APIs
the getanimations() method of the element interface (specified on the animatable mixin) returns an array of all animation objects affecting this element or which are scheduled to do so in future.
... return value an array of animation objects, each representing an animation currently targetting the element on which this method is called, or one of its descendant elements if { subtree: true } is specified.
Element.getAttributeNodeNS() - Web APIs
the corresponding setter method is setattributenodens.
... 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 'getattributenodens()' 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.
... originally, microsoft intended this method to return a textrectangle object for each line of text.
Element.hasAttribute() - Web APIs
the element.hasattribute() method returns a boolean value indicating whether the specified element has the specified attribute or not.
... 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) getattributens g...
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
to insert the html into the document rather than replace the contents of an element, use the method insertadjacenthtml().
... we add a second method that logs information about mouseevent based events (such as mousedown, click, and mouseenter): function logevent(event) { var msg = "event <strong>" + event.type + "</strong> at <em>" + event.clientx + ", " + event.clienty + "</em>"; log(msg); } then we use this as the event handler for a number of mouse events on the box that contains our log: var boxelem = document.querysele...
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.
... it is not recommended you use insertadjacenthtml() when inserting plain text; instead, use the node.textcontent property or the element.insertadjacenttext() method.
Element.insertAdjacentText() - Web APIs
the insertadjacenttext() method of the element interface inserts a given text node at a given position relative to the element it is invoked upon.
... polyfill you can polyfill the insertadjacenttext() method in internet explorer 5.5 (maybe earlier) and higher with the 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 ) } specificat...
Element.querySelector() - Web APIs
the queryselector() method of the element interface returns the first element that is a descendant of the element on which it is invoked that matches the specified group of selectors.
...the first match of those remaining elements is returned by the queryselector() method.
Element.removeAttribute() - Web APIs
the element method removeattribute() removes the attribute with the specified name 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 g...
Element.removeAttributeNS() - Web APIs
the removeattributens() method of the element interface removes the specified attribute from an element.
... 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) getattributens g...
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) getattributens g...
...etattributenode 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.
Element.setPointerCapture() - Web APIs
the setpointercapture() method of the element interface is used to designate a specific element as the capture target of future pointer events.
... return value this method returns undefined.
Element.toggleAttribute() - Web APIs
the toggleattribute() method of the element interface toggles a boolean attribute (removing it if it is present and adding it if it is not present) on the given element.
... 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) getattributens g...
Event.cancelable - Web APIs
WebAPIEventcancelable
event listeners that handle multiple kinds of events may want to check cancelable before invoking their preventdefault() methods.
... to cancel an event, call the preventdefault() method on the event.
EventSource.close() - Web APIs
WebAPIEventSourceclose
the close() method of the eventsource interface closes the connection, if one is made, and sets the eventsource.readystate attribute to 2 (closed).
... note: if the connection is already closed, the method does nothing.
EventSource - Web APIs
methods this interface also inherits methods from its parent, eventtarget.
...if the connection is already closed, the method does nothing.
EventTarget.dispatchEvent() - Web APIs
the dispatchevent() method throws unspecified_event_type_err if the event's type was not specified by initializing the event before the method was called, or if the event's type is null or an empty string.
... full support 12firefox full support 2ie full support 9 full support 9 no support 6 — 11notes alternate name notes older versions of ie supported an equivalent, proprietary eventtarget.fireevent() method.alternate name uses the non-standard name: fireeventopera full support 9safari full support 3.2webview android full support 4chrome android full support 18firefox android full support ...
EventTarget - Web APIs
methods eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
... additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties.
ExtendableEvent.waitUntil() - Web APIs
the extendableevent.waituntil() method tells the event dispatcher that work is ongoing.
... the waituntil() method must be initially called within the event callback, but after that it can be called multiple times, until all the promises passed to it settle.
FetchEvent.respondWith() - Web APIs
the respondwith() method of fetchevent prevents the browser's default fetch handling, and allows you to provide a promise for a response yourself.
... return fetch(event.request); }()); }); note: caches.match() is a convenience method.
Fetch basic concepts - Web APIs
in a nutshell at the heart of fetch are the interface abstractions of http requests, responses, headers, and body payloads, along with a global fetch method for initiating asynchronous resource requests.
... when a request or response object is created, it has an associated headers object whose guard is set as summarized below: new object's type creating constructor guard setting of associated headers object request request() request request() with mode of no-cors request-no-cors response response() response error() or redirect() methods immutable a header's guard affects the set(), delete(), and append() methods which change the header's contents.
FileList - Web APIs
WebAPIFileList
for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type description length integer a read-only value indicating the number of files in the list.
... methods item() returns a file object representing the file at the specified index in the file list.
FileReader.readAsArrayBuffer() - Web APIs
the filereader interface's readasarraybuffer() method is used to start reading the contents of a specified blob or file.
... newer api available the blob.arraybuffer() method is a newer promise-based api to read a file as an array buffer.
FileReader.readAsBinaryString() - Web APIs
the readasbinarystring method is used to start reading the contents of the specified blob or file.
... note that this method was once removed from the file api specification, but re-introduced for backward compatibility.
FileReader.readAsText() - Web APIs
the readastext() method is used to read the contents of the specified blob or file.
... newer api avaliable the blob.text() method is a newer promise-based api to read a file as text.
FileReaderSync.readAsArrayBuffer() - Web APIs
the readasarraybuffer() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an 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.
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.
... 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.
FileSystem - Web APIs
some browsers offer additional apis to create and manage file systems, such as chrome's requestfilesystem() method.
... 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.
FileSystemDirectoryEntry.createReader() - Web APIs
the filesystemdirectoryentry interface's method createreader() returns a filesystemdirectoryreader object which can be used to read the entries in the directory.
... example this example creates a method called readdirectory(), which fetches all of the entries in the specified filesystemdirectoryentry and returns them in an array.
FileSystemEntry.getParent() - Web APIs
the filesystementry interface's method getparent() obtains a filesystemdirectoryentry.
... using promises currently, there isn't a promise-based version of this method.
FileSystemFlags - Web APIs
the filesystemflags dictionary defines a set of values which are used when specifying option flags when calling certain methods in the file and directory entries api.
... methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this: datadirectoryentry.getdirectory("workspace", { create: true }, function(entry) { }); here, we see that the create property is provided, with a value of true, indicating that the directory should be created if it's not already there.
FocusEvent - Web APIs
methods this interface has no specific methods.
... it inherits methods from its parent uievent, and indirectly from event.
FormData.delete() - Web APIs
WebAPIFormDatadelete
the delete() method of the formdata interface deletes a key and its value(s) from a formdata object.
... note: this method is available in web workers.
FormData.entries() - Web APIs
WebAPIFormDataentries
the formdata.entries() method returns an iterator allowing to go through all key/value pairs contained in this object.
... note: this method is available in web workers.
FormData.has() - Web APIs
WebAPIFormDatahas
the has() method of the formdata interface returns a boolean stating whether a formdata object contains a certain key.
... note: this method is available in web workers.
FormData.keys() - Web APIs
WebAPIFormDatakeys
the formdata.keys() method returns an iterator allowing to go through all keys contained in this object.
... note: this method is available in web workers.
FormData.values() - Web APIs
WebAPIFormDatavalues
the formdata.values() method returns an iterator allowing to go through all values contained in this object.
... note: this method is available in web workers.
FormData - Web APIs
WebAPIFormData
the formdata interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttprequest.send() method.
... methods formdata.append() appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist.
FormDataEvent - Web APIs
this allows a formdata object to be quickly obtained in response to a formdata event firing, rather than needing to put it together yourself when you wish to submit form data via a method like xmlhttprequest (see using formdata objects).
... methods inherits methods from its parent interface, event.
Using the Frame Timing API - Web APIs
registering for notifications after an observer is created, the next step is to use the performanceobserver.observe() method to specify the set of performance events to observe.
...this object has three methods to retrieve frame data: performanceobserverentrylist.getentries() returns a list of explicitly observed performanceentry objects based on the list of entry types given to performanceobserver.observe().
Using the Gamepad API - Web APIs
in addition to these events, the api also adds a gamepad object, which you can use to query the state of a connected gamepad, and a navigator.getgamepads() method which you can use to get a list of gamepads known to the page.
... the navigator.getgamepads() method returns an array of all devices currently visible to the webpage, as gamepad objects (the first value is always null, so null will be returned if there are no gamepads connected.) this can then be used to get the same information.
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/error monitoring handlers previously installed using geolocation.watchposition().
... syntax navigator.geolocation.clearwatch(id); parameters id the id number returned by the geolocation.watchposition() method when installing the handler you wish to remove.
Geolocation - Web APIs
be aware that each browser has its own policies and methods for requesting this permission.
... methods the geolocation interface doesn't inherit any method.
Using the Geolocation API - Web APIs
you can test for the presence of geolocation thusly: if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method.
... const watchid = navigator.geolocation.watchposition((position) => { dosomething(position.coords.latitude, position.coords.longitude); }); the watchposition() method returns an id number that can be used to uniquely identify the requested position watcher; you use this value in tandem with the clearwatch() method to stop watching the user's location.
GestureEvent - Web APIs
initial value: 1.0 methods this interface also inherits methods of its parents, uievent and event.
...if the event has already being dispatched, this method does nothing.
GlobalEventHandlers.onpointerdown - Web APIs
then the event's preventdefault() method is called to ensure that the mousedown event isn't triggered, potentially causing events to be handled twice if we had a handler for those events in case pointer event support is missing.
... in addition, the event's preventdefault() method is called to ensure that the mouseup event isn't triggered unnecessarily.
HTMLAreaElement - Web APIs
the htmlareaelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements.
... methods inherits methods from its parent, htmlelement, and implements those from htmlhyperlinkelementutils.
HTMLBaseElement - Web APIs
this object inherits all of the properties and methods as described in the htmlelement interface.
... methods no specific method; inherits attributes from its parent, htmlelement.
HTMLCanvasElement.captureStream() - Web APIs
the htmlcanvaselement capturestream() method returns a mediastream which includes a canvascapturemediastreamtrack containing a real-time video capture of the canvas's contents.
...if not set, a new frame will be captured each time the canvas changes; if set to 0, frames will not be captured automatically; instead, they will only be captured when the returned track's requestframe() method is called.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
the htmlcanvaselement.mozfetchasstream() internal method used to create a new input stream that, when ready, would provide the contents of the canvas as image data.
... however, this non-standard and internal method has been removed.
HTMLCanvasElement.mozGetAsFile() - Web APIs
the non-standard, firefox-specific the htmlcanvaselement method mozgetasfile() returns a memory-based file object representing the image contained in the canvas.
... html <canvas id="canvas" width="100" height="100"></canvas> <p><a href="#" id="link">click here to try out mozgetasfile()</a>.</p> javascript the following code uses mozgetasfile() to create a file object from the canvas and appends it as an image to the page by loading it as a data url using the readasdataurl() method.
HTMLCollection - Web APIs
the htmlcollection interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list.
... methods htmlcollection.item() returns the specific node at the given zero-based index into the list.
HTMLDialogElement.returnValue - Web APIs
examples the following example displays a button to open a <dialog> containing a form via the showmodal() method.
... <!-- simple pop-up dialog box containing a form --> <dialog id="favdialog"> <form method="dialog"> <p><label>favorite animal: <select name="favanimal" required> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button>cancel</button> <button>confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; ...
HTMLElement.forceSpellCheck() - Web APIs
the forcespellcheck() method of the htmlelement interface forces a spelling and grammar check on html elements, even if the user has not focused on the elements.
... this method overrides user agent behavior.
HTMLElement - Web APIs
methods inherits methods from its parent, element, and implements those from documentandelementeventhandlers, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement and toucheventhandlers.
... added the following method: forcespellcheck().
HTMLFormControlsCollection - Web APIs
this interface replaces one method from htmlcollection, on which it is based.
... methods this interface inherits the methods of its parent, htmlcollection.
HTMLHeadElement - Web APIs
this object inherits all of the properties and methods described in the htmlelement interface.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLHeadingElement - Web APIs
it inherits methods and properties from the htmlelement interface.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLHtmlElement - Web APIs
this object inherits the properties and methods described in the htmlelement interface.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLHyperlinkElementUtils - Web APIs
the htmlhyperlinkelementutils mixin defines utility methods and properties to work with htmlanchorelement and htmlareaelement.
... methods note: this interface doesn't inherit any method.
HTMLIFrameElement - Web APIs
the htmliframeelement interface provides special properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.
... methods inherits properties from its parent, htmlelement.
HTMLImageElement - Web APIs
the htmlimageelement interface represents an html <img> element, providing the properties and methods used to manipulate image elements.
... methods inherits properties from its parent, htmlelement.
HTMLInputElement.mozGetFileNameArray() - Web APIs
the htmlinputelement.mozgetfilenamearray() method returns an array of the names of the files that were selected by the user on an html input element.
... note: this method is gecko-specific and is not available in other browsers.
HTMLInputElement.mozSetFileNameArray() - Web APIs
the htmlinputelement.mozsetfilenamearray() method sets the names of the files that selected on an html input element.
... note: this method is gecko-specific and is not available in other browsers.
HTMLKeygenElement - Web APIs
the <keygen> elements expose the htmlkeygenelement interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements.
... methods name & arguments return description checkvalidity() boolean always returns true because keygen objects are never candidates for constraint validation.
HTMLLabelElement - Web APIs
it inherits methods and properties from the base htmlelement interface.
... methods no specific methods; inherits methods from its parent, htmlelement.
HTMLLegendElement - Web APIs
it inherits properties and methods from the htmlelement interface.
... htmllegendelement.align is a domstring representing the alignment relative to the form set methods no specific method; inherits methods from its parent, htmlelement.
HTMLLinkElement - Web APIs
this object inherits all of the properties and methods of the htmlelement interface.
... methods no specific method; inherits methods from its parent, htmlelement, and linkstyle.
HTMLMapElement - Web APIs
the htmlmapelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements.
... methods no specific method; inherits methods from its parent, htmlelement .
HTMLMediaElement.load() - Web APIs
the htmlmediaelement method load() resets the media element to its initial state and begins the process of selecting a media source and loading the media in preparation for playback to begin at the beginning.
... this method is generally only useful when you've made dynamic changes to the set of sources available for the media element, either by changing the element's src attribute or by adding or removing <source> elements nested within the media element itself.
HTMLMetaElement - Web APIs
it inherits all of the properties and methods described in the htmlelement interface.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLMeterElement - Web APIs
the html <meter> elements expose the htmlmeterelement interface, which provides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements.
... methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement.
HTMLObjectElement.setCustomValidity - Web APIs
the setcustomvalidity() method of the htmlobjectelement interface sets a custom validity message for the element.
...additionally you must call the reportvalidity method on the same element or nothing will happen.
HTMLOptGroupElement - Web APIs
the htmloptgroupelement interface provides special properties and methods (beyond the regular htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLOptionElement - Web APIs
the htmloptionelement interface represents <option> elements and inherits all classes and methods of the htmlelement interface.
... methods inherits methods from its parent, htmlelement.
HTMLOptionsCollection - Web APIs
the htmloptionscollection interface represents a collection of <option> html elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items.
... methods this interface inherits the methods of its parent, htmlcollection.
HTMLPictureElement - Web APIs
it doesn't implement specific properties or methods.
... methods no specific method, but inherits methods from its parent, htmlelement.
HTMLPreElement - Web APIs
the htmlpreelement interface exposes specific properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>).
... methods no specific method; inherits properties from its parent, htmlelement.
HTMLProgressElement - Web APIs
the htmlprogresselement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <progress> elements.
... methods no specific method; inherits properties from its parent, htmlelement.
HTMLQuoteElement - Web APIs
the htmlquoteelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element.
... methods no specific method; inherits properties from its parent, htmlelement.
HTMLSelectElement.remove() - Web APIs
the htmlselectelement.remove() method removes the element at the specified index from the options collection for this select element.
...if the index is not found the method has no effect.
HTMLSourceElement - Web APIs
note: if the src property is updated (along with any siblings), the parent htmlmediaelement's load method should be called when done, since <source> elements are not re-scanned automatically.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLSpanElement - Web APIs
the htmlspanelement interface represents a <span> element and derives from the htmlelement interface, but without implementing any additional properties or methods.
... methods this interface has no methods, but inherits methods from: htmlelement.
HTMLStyleElement - Web APIs
it inherits properties and methods from its parent, htmlelement, and from linkstyle.
... methods no specific method; inherits properties from its parent, htmlelement, and linkstyle.
HTMLTableCellElement - Web APIs
the htmltablecellelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header or data cells, in an html document.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLTableElement.createCaption() - Web APIs
the htmltableelement.createcaption() method returns the <caption> element associated with a given <table>.
... if no <caption> element exists on the table, this method creates it, and then returns it.
HTMLTableElement.createTFoot() - Web APIs
the htmltableelement.createtfoot() method returns the <tfoot> element associated with a given <table>.
... if no footer exists in the table, this methods creates it, and then returns it.
HTMLTableElement.createTHead() - Web APIs
the htmltableelement.createthead() method returns the <thead> element associated with a given <table>.
... if no header exists in the table, this method creates it, and then returns it.
HTMLTableElement.deleteCaption() - Web APIs
the htmltableelement.deletecaption() method removes the <caption> element from a given <table>.
... if there is no <caption> element associated with the table, this method does nothing.
HTMLTitleElement - Web APIs
this element inherits all of the properties and methods of the htmlelement interface.
... methods no specific method; inherits methods from its parent, htmlelement.
HTMLUnknownElement - Web APIs
the htmlunknownelement interface represents an invalid html element and derives from the htmlelement interface, but without implementing any additional properties or methods.
... methods no specific method; inherits properties from its parent, htmlelement.
Headers.delete() - Web APIs
WebAPIHeadersdelete
the delete() method of the headers interface deletes a header from the current headers object.
... this method throws a typeerror for the following reasons: the value of the name parameter is not the name of an http header.
Headers.entries() - Web APIs
WebAPIHeadersentries
the headers.entries() method returns an iterator allowing to go through all key/value pairs contained in this object.
... note: this method is available in web workers.
Headers.get() - Web APIs
WebAPIHeadersget
the get() method of the headers interface returns a byte string of all the values of a header within a headers object with a given name.
...if the given name is not the name of an http header, this method throws a typeerror.
Headers.getAll() - Web APIs
WebAPIHeadersgetAll
the getall() method of the headers interface used to return an array of all the values of a header within a headers object with a given name; in newer versions of the fetch spec, it has been deleted, and headers.get() has been updated to fetch all header values instead of only the first one.
...if the given name is not the name of an http header, this method throws a typeerror.
Headers.has() - Web APIs
WebAPIHeadershas
the has() method of the headers interface returns a boolean stating whether a headers object contains a certain header.
...if the given name is not a valid http header name, this method throws a typeerror.
Headers.keys() - Web APIs
WebAPIHeaderskeys
the headers.keys() method returns an iterator allowing to go through all keys contained in this object.
... note: this method is available in web workers.
Headers.set() - Web APIs
WebAPIHeadersset
the set() method of the headers interface sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
...if the given name is not the name of an http header, this method throws a typeerror.
Headers.values() - Web APIs
WebAPIHeadersvalues
the headers.values() method returns an iterator allowing to go through all values contained in this object.
... note: this method is available in web workers.
History.forward() - Web APIs
WebAPIHistoryforward
the history.forward() method causes the browser to move forward one page in the session history.
... this method is asynchronous.
History.go() - Web APIs
WebAPIHistorygo
the history.go() method loads a specific page from the session history.
... this method is asynchronous.
History.state - Web APIs
WebAPIHistorystate
the value is null until the pushstate() or replacestate() method is used.
... examples the code below logs the value of history.state before using the pushstate() method to push a value to the history.
Ajax navigation example - Web APIs
302: "found", 303: "see other", 304: "not modified", 305: "use proxy", 306: "reserved", 307: "temporary redirect", 308: "permanent redirect", 400: "bad request", 401: "unauthorized", 402: "payment required", 403: "forbidden", 404: "not found", 405: "method not allowed", 406: "not acceptable", 407: "proxy authentication required", 408: "request timeout", 409: "conflict", 410: "gone", 411: "length required", 412: "precondition failed", 413: "request entity too large", 414: "request-uri too long", 415: "unsupported media type", ...
...attachevent("onload", init) : (onload = init); // public methods this.open = requestpage; this.stop = abortreq; this.rebuildlinks = init; })(); for more information, please see: working with the history api.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
the advance() method of the idbcursor interface sets the number of times a cursor should move its position forward.
... 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
the continue() method of the idbcursor interface advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter.
... 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
the delete() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
the update() method of the idbcursor interface returns an idbrequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBDatabase.transaction() - Web APIs
the transaction method of the idbdatabase interface immediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store.
... 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
methods inherits from: eventtarget idbdatabase.close() returns immediately and closes the connection to a database in a separate thread.
... idbdatabase.transaction() immediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store.
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.
... exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid.
IDBIndex.count() - Web APIs
WebAPIIDBIndexcount
the count() method of the idbindex interface returns an idbrequest object, and in a separate thread, returns the number of records within a key range.
... 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
the get() method of the idbindex interface returns an idbrequest object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an idbkeyrange.
... 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
the getall() method of the idbindex interface retrieves all objects that are inside the index.
... exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.getAllKeys() - Web APIs
the getallkeys() method of the idbindex interface instantly retrieves the primary keys of all objects inside the index, setting them as the result of the request object.
... 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
the getkey() method of the idbindex interface returns an idbrequest object, and, in a separate thread, finds either the primary key that corresponds to the given key in this index or the first corresponding primary key, if key is set to an idbkeyrange.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.multiEntry - Web APIs
this is decided when the index is created, using the idbobjectstore.createindex method.
... this method takes an optional options parameter whose multientry property is set to true/false.
IDBIndex.unique - Web APIs
WebAPIIDBIndexunique
this is decided when the index is created, using the idbobjectstore.createindex method.
... this method takes an optional parameter, unique, which if set to true means that the index will not be able to accept duplicate entries.
IDBKeyRange.bound() - Web APIs
WebAPIIDBKeyRangebound
the bound() method of the idbkeyrange interface creates a new key range with the specified upper and lower bounds.
... 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.lowerBound() - Web APIs
the lowerbound() method of the idbkeyrange interface creates a new key range with only a lower bound.
... 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
the only() method of the idbkeyrange interface creates a new key range containing a single value.
... 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
the upperbound() method of the idbkeyrange interface creates a new upper-bound key range.
... exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
IDBKeyRange - Web APIs
methods static methods idbkeyrange.bound() creates a new key range with upper and lower bounds.
... instance methods idbkeyrange.includes() returns a boolean indicating whether a specified key is inside the key range.
IDBLocaleAwareKeyRange - Web APIs
the idblocaleawarekeyrange interface of the indexeddb api is a firefox-specific version of idbkeyrange — it functions in exactly the same fashion, and has the same properties and methods, but it is intended for use with idbindex objects when the original index had a locale value specified upon its creation (see createindex()'s optionalparameters) — that is, it has locale aware sorting enabled.
... methods this interface inherits all the methods of its parent interface, idbkeyrange.
IDBMutableFile - Web APIs
note: this interface used to be called filehandle , but it was changed to this (bug 1006485.) as idbmutablefile objects are bound to a fake file system built on top of indexeddb, such an object is created using the idbdatabase.createmutablefile method.
... methods mutablefile.open() returns a lockedfile object to read or write the associated file safely.
IDBObjectStore.clear() - Web APIs
the clear() method of the idbobjectstore interface creates and immediately returns an idbrequest object, and clears this object store in a separate thread.
... 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
the count() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore has been deleted.
IDBObjectStore.getKey() - Web APIs
the getkey() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, returns the key selected by the specified query.
... 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
the index() method of the idbobjectstore interface opens a named index in the current object store, after which it can be used to, for example, return a series of records sorted by that index using a cursor.
... 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.openCursor() - Web APIs
the opencursor() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, returns a new idbcursorwithvalue object.
... 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
the openkeycursor() method of the idbobjectstore interface returns an idbrequest object whose result will be set to an idbcursor that can be used to iterate through matching results.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted.
IDBOpenDBRequest - Web APIs
uest" target="_top"><rect x="291" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="371" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbopendbrequest</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits methods from its parents idbrequest and eventtarget.
... methods no methods, but inherits methods from its parents idbrequest and eventtarget.
IDBRequest - Web APIs
in plain words, all asynchronous methods return a request object.
... methods no methods, but inherits methods from eventtarget.
IDBTransaction.abort() - Web APIs
the abort() method of the idbtransaction interface rolls back all the changes to objects in the database associated with this transaction.
... 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.
IDBVersionChangeEvent - Web APIs
properties also inherits properties from its parent, method.
... methods no specific method, but inherits properties from its parent, method.
IIRFilterNode.getFrequencyResponse() - Web APIs
the getfrequencyresponse() method of the iirfilternode interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies specified in a specified array of frequencies.
... the two output arrays, magresponseoutput and phaseresponseoutput, must be created before calling this method; they must be the same size as the array of input frequency values (frequencyarray).
IIRFilterNode - Web APIs
methods inherits methods from its parent, audionode.
... it also has the following additional methods: getfrequencyresponse() uses the filter's current parameter settings to calculate the response for frequencies specified in the provided array of frequencies.
IdleDeadline - Web APIs
it offers a method, timeremaining(), which lets you determine how much longer the user agent estimates it will remain idle and a property, didtimeout, which lets you determine if your callback is executing because its timeout duration expired.
... 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.
ImageBitmap - Web APIs
it can be created from a variety of source objects using the createimagebitmap() factory method.
... methods imagebitmap.close() disposes of all graphical resources associated with an imagebitmap.
ImageBitmapRenderingContext.transferFromImageBitmap() - Web APIs
the imagebitmaprenderingcontext.transferfromimagebitmap() method displays the given imagebitmap in the canvas associated with this rendering context.
... this method was previously named transferimagebitmap(), but was renamed in a spec change.
ImageCapture - Web APIs
the imagecapture interface of the mediastream image capture api provides methods to enable the capture of images or photos from a camera or other photographic device.
... methods the imagecapture interface is based on eventtarget, so it includes the methods defined by that interface as well as the ones listed below.
Browser storage limits and eviction criteria - Web APIs
different types of data storage even in the same browser, using the same storage method, there are different classes of data storage to understand.
... storage is temporary by default; developers can choose to use persistent storage for their sites using the storagemanager.persist() method available in the storage api.
Checking when a deadline is due - Web APIs
var minutecheck = now.getminutes(); var hourcheck = now.gethours(); var daycheck = now.getdate(); var monthcheck = now.getmonth(); var yearcheck = now.getfullyear(); the date object has a number of methods to extract various parts of the date and time inside it.
...low), and year (getfullyear() is needed; getyear() is deprecated, and returns a weird value that is not much use to anyone!) var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { next we create another indexeddb objectstore, and use the opencursor() method to open a cursor, which is basically a way in indexeddb to iterate through all the items in the store.
IntersectionObserver.unobserve() - Web APIs
the intersectionobserver method unobserve() instructs the intersectionobserver to stop observing the specified target element.
...if the specified element isn't being observed, this method does nothing and no exception is thrown.
Keyboard.lock() - Web APIs
WebAPIKeyboardlock
the lock() method of the keyboard interface returns a promise after enabling the capture of keypresses for any or all of the keys on the physical keyboard.
... this method can only capture keys that are granted access by the underlying operating system.
Keyboard - Web APIs
WebAPIKeyboard
methods keyboard.getlayoutmap() returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys.
... keyboard.unlock() unlocks all keys captured by the lock() method and returns synchronously.
KeyframeEffect.setKeyframes() - Web APIs
the setkeyframes() method of the keyframeeffect interface replaces the keyframes that make up the affected keyframeeffect with a new set of keyframes.
...this is the canonical format returned by the getkeyframes() method.
Location: assign() - Web APIs
WebAPILocationassign
the location.assign() method causes the window to load and display the document at the url specified.
...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.
Location - Web APIs
WebAPILocation
methods location.assign() loads the resource at the url provided in parameter.
...the difference from the assign() method and setting the href property is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to navigate to it.
LockManager - Web APIs
the lockmanager interface of the the web locks api provides methods for requesting a new lock object and querying for an existing lock object.
... methods lockmanager.request() requests a lock object with parameters specifying its name and characteristics.
LockedFile.flush() - Web APIs
WebAPILockedFileflush
summary the flush method is used to ensure any change made to a file is properly written on disk.
...to avoid that, it's possible to force a write onto the disk by calling the flush method.
LockedFile.readAsArrayBuffer() - Web APIs
summary the readasarraybuffer method is used to read the content of the lockedfile object and provide the result of that reading as an arraybuffer.
... in many ways, it performs like the filereader.readasarraybuffer() method.
LockedFile.readAsText() - Web APIs
summary the readastext method is used to read the content of the lockedfile object and provide the result of that reading as a string.
... in many ways, it performs like the filereader.readastext() method.
LockedFile - Web APIs
lockedfile.onabort the abort event is triggered each time the abort() method is called.
... methods lockedfile.getmetadata() allows to retrieve the file metadata (size and date of the last modification).
MSManipulationEvent - Web APIs
this proprietary method is specific to internet explorer.
... methods msmanipulationevent.initmsmanipulationevent(): used to create a manipulation event that can be called from javascript.
MSSiteModeEvent - Web APIs
this proprietary method is specific to internet explorer and microsoft edge.
... dom information inheritance hierarchy event mssitemodeevent methods method description initevent initializes a new generic event that the createevent method created.
MediaCapabilities.decodingInfo() - Web APIs
the mediacapabilities.decodinginfo() method, part of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe whether decoding the media described would be supported, smooth, and powerefficient.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration.
MediaCapabilities.encodingInfo() - Web APIs
the mediacapabilities.encodinginfo() method, part of the mediacapabilities interface of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe how compatible the device is with the type of media.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements.
MediaDevices.getDisplayMedia() - Web APIs
the mediadevices interface's getdisplaymedia() method prompts the user to select and grant permission to capture the contents of a display or portion thereof (such as a window) as a mediastream.
... example in the example below, a startcapture() method is created which initiates screen capture given a set of options specified by the displaymediaoptions parameter.
MediaKeySystemAccess - Web APIs
you can request an instance of this object using the navigator.requestmediakeysystemaccess() method.
... methods mediakeysystemaccess.createmediakeys() returns a promise that resolves to a new mediakeys object.
MediaList - Web APIs
WebAPIMediaList
note: medialist is a live list; updating the list using properties or methods listed below will immediately update the behavior of the document.
... methods medialist.appendmedium() adds a media query to the medialist.
MediaRecorder.ondataavailable - Web APIs
if a timeslice property was passed into the mediarecorder.start() method that started media capture, a dataavailable event is fired every timeslice milliseconds.
...so if the method call looked like this — recorder.start(1000); — the dataavailable event would fire after each second of media capture, and our event handler would be called every second with a blob of media data that's one second long.
MediaRecorder.pause() - Web APIs
the media.pause() method (part of the mediarecorder api) is used to pause recording of media streams.
... 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.start() - Web APIs
the mediarecorder method start(), which is part of the mediastream recording api, begins recording media into one or more blob objects.
...if this parameter isn't included, the entire media duration is recorded into a single blob unless the requestdata() method is called to obtain the blob and trigger the creation of a new blob into which the media continues to be recorded.
MediaSession.setPositionState() - Web APIs
the mediasession method setpositionstate() is used to update the current document's media playback position and speed for presentation by user's device in any kind of interface that provides details about ongoing media.
... call this method on the navigator object's mediasession object.
MediaSession - Web APIs
methods setactionhandler() sets an event handler for a media session action, such as play or pause.
... see the method page for a full list.
MediaSource - Web APIs
methods inherits methods from its parent interface, eventtarget.
... static methods mediasource.istypesupported() returns a boolean value indicating if the given mime type is supported by the current user agent — this is, if it can successfully create sourcebuffer objects for that mime type.
MediaStream.addTrack() - Web APIs
the mediastream.addtrack() method adds a new track to the stream.
... if the specified track is already in the stream's track set, this method has no effect.
MediaStream.getTrackById() - Web APIs
the mediastream.gettrackbyid() method returns a mediastreamtrack object representing the track with the specified id string.
... if there is no track with the specified id, this method returns null.
MediaStreamAudioDestinationNode - Web APIs
it is an audionode that acts as an audio destination, created using the audiocontext.createmediastreamdestination method.
... methods inherits methods from its parent, audionode.
MediaStreamEvent - Web APIs
methods a mediastreamevent being an event, this event also implements these properties.
... there is no specific mediastreamevent method.
MediaStreamTrackEvent - Web APIs
the mediastreamtrackevent interface represents events which indicate that a mediastream has had tracks added to or removed from the stream through calls to media stream api methods.
... methods also inherits methods from its parent event.
MerchantValidationEvent() - Web APIs
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.
... rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier.
MessagePort - Web APIs
methods inherits methods from its parent, eventtarget postmessage() sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
... when the iframe has loaded, we register an onmessage handler for messagechannel.port1 and transfer messagechannel.port2 to the iframe using the window.postmessage method along with a message.
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 desc...
... methods initmousescrollevent() see nsidommousescrollevent::initmousescrollevent().
MutationObserver.disconnect() - Web APIs
the mutationobserver method disconnect() tells the observer to stop watching for mutations.
... the observer can be reused by calling its observe() method again.
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.
... example in this example, we demonstrate how to call the method observe() on an instance of mutationobserver, once it has been set up, passing it a target element and a mutationobserverinit options object.
NDEFReader.scan() - Web APIs
WebAPINDEFReaderscan
the scan() method of ndefreader interface reads ndef records from compatible nfc devices, e.g., ndef nfc tags.
... 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.
NDEFRecord.toRecords() - Web APIs
the torecords() method of the ndefrecord interface of web nfc api parses record payload ndefrecord.data besed on ndefrecord.recordtype and returns the result.
... in practice, it's possible to implement the parsing mechanism manually, but this method simplifies the process.
NDEFWriter.write() - Web APIs
WebAPINDEFWriterwrite
the write() method of ndefwriter interface writes a specified message to a compatiable nfc tag.
... 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.
NavigationPreloadManager - Web APIs
the navigationpreloadmanager interface of the the service worker api provides methods for managing the preloading of resources with a service worker.
... methods navigationpreloadmanager.enable() enables navigation preloading and returns a promise that resolves.
Navigator.getBattery() - Web APIs
the getbattery() method provides information about the system's battery.
... 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.
NavigatorLanguage - Web APIs
navigatorlanguage contains methods and properties related to the language of the navigator.
... methods the navigatorlanguage interface neither implements, nor inherit any method.
NavigatorOnLine - Web APIs
the navigatoronline interface contains methods and properties related to the connectivity status of the browser.
... methods the navigatoronline interface neither implements, nor inherit any method.
NavigatorPlugins.javaEnabled() - Web APIs
this method indicates whether the current browser is java-enabled or not.
... syntax result = window.navigator.javaenabled() example if (window.navigator.javaenabled()) { // browser has java } notes the return value for this method indicates whether the preference that controls java is on or off - not whether the browser offers java support in general.
NavigatorPlugins - Web APIs
the navigatorplugins mixin adds to the navigator interface methods and properties for discovering and interacting with plugins installed into the browser.
... methods the navigatorplugins interface doesn't inherit any methods.
NavigatorStorage - Web APIs
the storage standard is designed to serve as a common basis for the implementation of all of those apis and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.
... methods the navigatorstorage mixin has no methods.
Node.cloneNode() - Web APIs
WebAPINodecloneNode
the node.clonenode() method returns a duplicate of the node on which this method was called.
... the newclone has no parent and is not part of the document, until it is added to another node that is part of the document (using node.appendchild() or a similar method).
Node.getUserData() - Web APIs
WebAPINodegetUserData
the node.getuserdata() method returns any user domuserdata set previously on the given node by node.setuserdata().
... the node.setuserdata and node.getuserdata methods are no longer available from web content.
Node.isSupported() - Web APIs
WebAPINodeisSupported
this is the same name which can be passed to the method hasfeature on domimplementation.
...if the version is not specified, supporting any version of the feature will cause the method to return true.
Node.lookupNamespaceURI() - Web APIs
the node.lookupnamespaceuri() method accepts a prefix and returns the namespace uri associated with it on the given node if found (and null if not).
...if this parameter is null, the method will return the default namespace uri, if any.
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.
... due to bug 312019, this method does not work with dynamically assigned namespaces, that is, those set with the node.prefix property.
NodeIterator.detach() - Web APIs
the nodeiterator.detach() method is a no-op, kept for backward compatibility only.
...once this method had been called, calls to other methods on nodeiterator would raise the invalid_state_err exception.
NodeIterator.filter - Web APIs
the nodeiterator.filter read-only method returns a nodefilter object, that is an object implement an acceptnode(node) method, used to screen nodes.
... when creating the nodeiterator, the filter object is passed in as the third parameter, and the object method acceptnode(node) is called on every single node to determine whether or not to accept it.
NonDocumentTypeChildNode - Web APIs
the nondocumenttypechildnode interface contains methods that are particular to node objects that can have a parent, but not suitable for documenttype.
... methods there are neither inherited nor specific methods.
Notification.close() - Web APIs
the close() method of the notification interface is used to close/remove a previously displayed notification.
... note: this api shouldn't be used just to have the notification removed from the screen after a fixed delay since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown.
Notification.requestPermission() - Web APIs
the requestpermission() method of the notification interface requests permission from the user for the current origin to display notifications.
... syntax the latest spec has updated this method to a promise-based syntax that works like this: notification.requestpermission().then(function(permission) { ...
Notification - Web APIs
methods static methods these methods are available only on the notification object itself.
... instance methods these properties are available only on an instance of the notification object or through its prototype.
Notifications API - Web APIs
first, the user needs to grant the current origin permission to display system notifications, which is generally done when the app or site initialises, using the notification.requestpermission() method.
... service worker additions serviceworkerregistration includes the serviceworkerregistration.shownotification() and serviceworkerregistration.getnotifications() method, for controlling the display of notifications.
OES_element_index_uint - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now accepts gl.unsigned_int.
OES_standard_derivatives - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... constants this extension exposes one new constant, which can be used in the hint() and getparameter() methods.
OES_texture_float_linear - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... with the help of this extension, you can now set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use floating-point textures.
OES_texture_half_float_linear - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... with the help of this extension, you can now set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use half floating-point textures.
OVR_multiview2 - Web APIs
for more information, see also: multiview on webxr three.js multiview demo multiview in babylon.js optimizing virtual reality: understanding multiview multiview webgl rendering for oculus browser 6.0+ webgl extensions are available using the webglrenderingcontext.getextension() method.
... methods framebuffertexturemultiviewovr() simultaneously renders to multiple elements of a 2d texture array.
OfflineAudioContext.OfflineAudioContext() - Web APIs
syntax var offlineaudioctx = new offlineaudiocontext(numberofchannels, length, samplerate); var offlineaudioctx = new offlineaudiocontext(options); parameters you can specify the parameters for the offlineaudiocontext() constructor as either the same set of parameters as are inputs into the audiocontext.createbuffer() method, or by passing those parameters in an options object.
...this works in exactly the same way as when you create a new audiobuffer with the audiocontext.createbuffer() method.
OfflineAudioContext.startRendering() - Web APIs
the startrendering() method of the offlineaudiocontext interface starts rendering the audio graph, taking into account the current connections and the current scheduled changes.
... browsers currently support two versions of the startrendering() method — an older event-based version and a newer promise-based version.
OrientationSensor - Web APIs
instead it provides properties and methods accessed by interfaces that inherit from it.
... methods orientationsensor.populatematrix() populates the given object with the rotation matrix based on the latest sensor reading.
PaintWorklet.registerPaint - Web APIs
the paintworklet.registerpaint() method of the paintworklet interface registers a class programmatically generate an image where a css property expects a file.
...to use it, you register it with the css.paintworklet.addmodule() method: <script> css.paintworklet.addmodule('checkboardworklet.js'); </script> you can then use the paint() css function in your css anywhere an <image> value is valid.
PaintWorklet - Web APIs
methods this interface inherits methods from worklet.
... css.paintworklet.addmodule() the addmodule() method, inhertied from the worklet interface loads the module in the given javascript file and adds it to the current paintworklet.
PannerNode.distanceModel - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
PannerNode.maxDistance - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
PannerNode.panningModel - Web APIs
example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation.
...if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
ParentNode.querySelector() - Web APIs
the parentnode mixin defines the queryselector() method as returning an element representing the first element matching the specified group of selectors which are descendants of the object on which the method was called.
... note: this method is implemented as document.queryselector(), documentfragment.queryselector() and element.queryselector().
Path2D.addPath() - Web APIs
WebAPIPath2DaddPath
the path2d.addpath() method of the canvas 2d api adds one path2d object to another path2d object.
... html <canvas id="canvas"></canvas> javascript first, we create two separate path2d objects, each of which contains a rectangle made using the rect() method.
Path2D - Web APIs
WebAPIPath2D
the path methods of the canvasrenderingcontext2d interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired.
... methods path2d.addpath() adds a path to the current path.
PaymentDetailsBase - Web APIs
modifiersoptional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers.
... for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!").
PaymentRequestEvent - Web APIs
methoddataread only returns an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.
... methods openwindow() opens the specified url in a new window, if and only if the given url is on the same origin as the calling page.
PaymentResponse.details - Web APIs
the details read-only property of the paymentresponse interface returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer.
... payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you requested details: paymentresponse.details, // shipping address information address: todict(paymentresponse.shippingaddress) }; // send information to the server }); specifications specification status comment payment request api candidate recommendation initial definition.
PaymentResponse.onpayerdetailchange - Web APIs
const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed.
... const errors = await promise.all(promisestovalidate).then(results => results.reduce((errors, result), object.assign(errors, result)) ); // if we found any errors, wait for them to be corrected if (object.getownpropertynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things/", { 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.
performance.setResourceTimingBufferSize() - Web APIs
the setresourcetimingbuffersize() method sets the browser's resource timing buffer size to the specified number of "resource" performance entry type objects.
... return value none this method has no return value.
PerformanceEntry.duration - Web APIs
performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["to...
...json"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'duration' in that specification.
PerformanceEntry.name - Web APIs
performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["to...
...json"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'name' in that specification.
PerformanceEntry.startTime - Web APIs
performance.mark not supported"); return; } // create some performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["to...
...json"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'starttime' in that specification.
PerformanceEventTiming - Web APIs
methods performanceeventtiming.tojson() converts the performanceeventtiming object to json.
... (navigator.sendbeacon && navigator.sendbeacon('/analytics', body)) || fetch('/analytics', {body, method: 'post', keepalive: true}); } // use a try/catch instead of feature detecting `first-input` // support, since some browsers throw when using the new `type` option.
PerformanceNavigation - Web APIs
type_reload (1) the page was accessed by clicking the reload button or via the location.reload() method.
... methods the performance interface doesn't inherit any methods.
PerformanceNavigationTiming - Web APIs
the performancenavigationtiming interface provides methods and properties to store and retrieve metrics regarding the browser's document navigation events.
... methods performancenavigationtiming.tojson() returns a domstring that is the json representation of the performancenavigationtiming object.
PeformanceObserver.disconnect() - Web APIs
the disconnect() method of the performanceobserver interface is used to stop the performance observer from receiving any performance entry events.
... candidate recommendation initial definition of disconnect() method.
PerformanceObserver.observe() - Web APIs
the observe() method of the performanceobserver interface is used to specify the set of performance entry types to observe.
... candidate recommendation initial definition of observe() method.
PerformanceObserver.takeRecords() - Web APIs
the takerecords() method of the performanceobserver interface returns the current list of performance entries stored in the performance observer, emptying it out.
... candidate recommendation initial definition of takerecords() method.
PerformanceObserverEntryList - Web APIs
the performanceobserverentrylist interface is a list of peformance events that were explicitly observed via the observe() method.
... methods performanceobserverentrylist.getentries() returns a list of explicitly observed performanceentry objects based on the given filter.
PeriodicWave - Web APIs
if you wish to establish custom property values at the outset, use the audiocontext.createperiodicwave() factory method instead.
... methods none; also, periodicwave doesn't inherit any methods.
Permissions.revoke() - Web APIs
the permissions.revoke() method of the permissions interface reverts a currently set permission back to its default state, which is usually prompt.
... syntax this method is called on the global permissions object navigator.permissions.
Permissions API - Web APIs
once you have this object you can then perform permission-related tasks, for example querying a permission using the permissions.query() method to return a promise that resolves with the permissionstatus for a specific api.
... permissions provides the core permission api functionality, such as methods for querying and revoking permissions.
PluginArray - Web APIs
the pluginarray is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods.
... methods pluginarray.item returns the plugin at the specified index into the array.
PointerEvent - Web APIs
methods pointerevent.getcoalescedevents() returns a sequence of all pointerevent instances that were coalesced into the dispatched pointermove event.
... editor's draft added the getcoalescedevents() and getpredictedevents() methods and pointerrawupdate event.
Pointer events - Web APIs
releasepointercapture() this method releases (stops) pointer capture that was previously set for a specific pointer event.
... pointer events – level 2 recommendation adds haspointercapture method and clarifies more edge cases and dynamic scenarios.
ProgressEvent.initProgressEvent() - Web APIs
the progressevent.initprogressevent() method initializes an animation event created using the deprecated document.createevent("progressevent") method.
... note: this method has been dropped during the standard process.
ProgressEvent - Web APIs
methods also inherits methods from its parent event.
... progressevent.initprogressevent() initializes a progressevent created using the deprecated document.createevent("progressevent") method.
PublicKeyCredential.getClientExtensionResults() - Web APIs
getclientextensionresults() is a method of the publickeycredential interface that returns an arraybuffer which contains a map between the extensions identifiers and their results after having being processed by the client.
... note: this method may only be used in top-level contexts and will not be available in an <iframe> for example.
PushSubscription.getKey() - Web APIs
the getkey() method of the pushsubscription interface returns an arraybuffer representing a client public key, which can then be sent to a server and used in encrypting push message data.
... syntax ​var key = subscription.getkey(name); parameters name a domstring representing the encryption method used to generate a client key.
RTCDTMFToneChangeEvent - Web APIs
methods supports the methods defined in event.
... there are no additional methods.
RTCIceTransport - Web APIs
methods also includes methods from eventtarget, the parent interface.
... getlocalparameters() returns a rtciceparameters object describing the ice parameters established by a call to the rtcpeerconnection.setlocaldescription() method.
RTCIdentityErrorEvent - Web APIs
methods a rtcidentityerrorevent being an event, this event also implements these properties.
... there is no specific rtcidentityerrorevent method.
RTCIdentityEvent - Web APIs
methods a rtcidentityevent being an event, this event also implements these properties.
... there is no specific rtcidentityevent method.
RTCPeerConnection.addIceCandidate() - Web APIs
during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods.
... 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.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer.
... rtcofferoptions dictionary the rtcofferoptions dictionary is used to customize the offer created by this method.
RTCPeerConnection.generateCertificate() - Web APIs
the generatecertificate() method of the rtcpeerconnection interface creates and stores an x.509 certificate and corresponding private key then returns an rtccertificate, providing access to it.
... rtcpeerconnection.generatecertificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof.
RTCPeerConnection.getConfiguration() - Web APIs
the rtcpeerconnection.getconfiguration() method returns an rtcconfiguration object which indicates the current configuration of the rtcpeerconnection on which the method is called.
... syntax var configuration = rtcpeerconnection.getconfiguration(); parameters this method takes no input parameters.
RTCPeerConnection.getSenders() - Web APIs
the rtcpeerconnection method getsenders() returns an array of rtcrtpsender objects, each of which represents the rtp sender responsible for transmitting one track's data.
... a sender object provides methods and properties for examining and controlling the encoding and transmission of the track's data.
RTCPeerConnection.removeStream() - Web APIs
the rtcpeerconnection.removestream() method removes a mediastream as a local source of audio or video.
...because this method has been deprecated, you should instead use removetrack() if your target browser versions have implemented it.
RTCPeerConnection.removeTrack() - Web APIs
the rtcpeerconnection.removetrack() method tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders().
... if the track is already stopped, or is not in the connection's senders list, this method has no effect.
RTCPeerConnection.restartIce() - Web APIs
the webrtc api's rtcpeerconnection interface offers the restartice() method to allow a web application to easily request that ice candidate gathering be redone on both ends of the connection.
... this simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ice restart.
RTCPeerConnection.setConfiguration() - Web APIs
the rtcpeerconnection.setconfiguration() method sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object.
... the most common use case for this method (and even then, probably not a very common use case) is to replace the set of ice servers to be used.
RTCPeerConnection.setIdentityProvider() - Web APIs
the rtcpeerconnection.setidentityprovider() method sets the identity provider (idp) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username.
... syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method.
RTCPeerConnectionIceEvent - Web APIs
methods a rtcpeerconnectioniceevent being an event, this event also implements these properties.
... there is no specific rtcdatachannelevent method.
RTCRtpReceiver - Web APIs
methods rtcrtpreceiver.getcontributingsources() returns an array of rtcrtpcontributingsource instances for each unique csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds.
... static methods rtcrtpreceiver.getcapabilities() returns the most optimistic view of the capabilities of the system for receiving media of the given kind.
RTCRtpSender.replaceTrack() - Web APIs
the rtcrtpsender method replacetrack() replaces the track currently being used as the sender's source with a new mediastreamtrack.
... invalidstateerror the track on which this method was called is stopped rather than running.
RTCRtpSender.setStreams() - Web APIs
the rtcrtpsender method setstreams() associates the sender's track with the specified mediastream or array of mediastream objects.
... function addtrackstostream(stream) { let senders = pc.getsenders(); senders.foreach((sender) => { if (sender.track && (sender.transport.state === connected)) { sender.setstreams(stream); } }); } after calling the rtcpeerconnection method getsenders() to get the list of the connection's senders, the addtrackstostream() function iterates over the list.
RTCRtpStreamStats - Web APIs
the rtcrtpstreamstats dictionary is returned by the rtcpeerconnection.getstats(), rtcrtpsender.getstats(), and rtcrtpreceiver.getstats() methods to provide detailed statistics about webrtc connectivity.
... while the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on.
RTCRtpTransceiver.stop() - Web APIs
the stop() method in the rtcrtptransceiver interface permanently stops the transceiver by stopping both the associated rtcrtpsender and rtcrtpreceiver.
... this method does nothing if the transceiver is already stopped.
RTCSctpTransport - Web APIs
rtcsctptransport.maxmessagesizeread only an integer value indicating the maximum size, in bytes, of a message which can be sent using the rtcdatachannel.send() method.
... methods this interface has no methods, but inherits methods from: eventtarget example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsctptransport' in that specification.
RTCSessionDescription() - Web APIs
this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself.
... this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself.
RTCSessionDescription.toJSON() - Web APIs
the rtcsessiondescription.tojson() method generates a json description of the object.
... example // sd is a rtcsessiondescriptor alert(json.stringify(sd)); // this call the tojson() method behind the scene.
Range.compareBoundaryPoints() - Web APIs
the range.compareboundarypoints() method compares the boundary points of the range with those of another range.
... parameters how a constant describing the comparison method: range.end_to_end compares the end boundary-point of sourcerange to the end boundary-point of range.
Range.deleteContents() - Web APIs
the range.deletecontents() method removes the contents of the range from the document.
... unlike range.extractcontents(), this method does not return a documentfragment containing the deleted content.
Range.detach() - Web APIs
WebAPIRangedetach
the range.detach() method does nothing.
...the method has been kept for compatibility.
Range.extractContents() - Web APIs
the range.extractcontents() method moves contents of the range from the document tree into a documentfragment.
...html attribute events are retained or duplicated as they are for the node.clonenode() method.
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.
... this method is useful for determining the viewport coordinates of the cursor or selection inside a text box.
Range.surroundContents() - Web APIs
the range.surroundcontents() method moves content of the range into a new node, placing the new node at the start of the specified range.
... this method is nearly equivalent to newnode.appendchild(range.extractcontents()); range.insertnode(newnode).
ReadableStreamBYOBReader.cancel() - Web APIs
the cancel() method of the readablestreambyobreader interface cancels the stream, signaling a loss of interest in the stream by a consumer.
... note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()).
ReadableStreamBYOBReader.releaseLock() - Web APIs
the releaselock() method of the readablestreambyobreader interface releases the reader's lock on the stream.
... a reader’s lock cannot be released while it still has a pending read request, i.e., if a promise returned by the reader’s readablestreambyobreader.read() method has not finished.
ReadableStreamDefaultController.error() - Web APIs
the error() method of the readablestreamdefaultcontroller interface causes any future interactions with the associated stream to error.
... note: the error() method can be called more than once, and can be called when the stream is not readable.
ReadableStreamDefaultReader.cancel() - Web APIs
the cancel() method of the readablestreamdefaultreader interface cancels the stream, signaling a loss of interest in the stream by a consumer.
... note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()).
ReadableStreamDefaultReader.releaseLock() - Web APIs
the releaselock() method of the readablestreamdefaultreader interface releases the reader's lock on the stream.
... a reader’s lock cannot be released while it still has a pending read request, i.e., if a promise returned by the reader’s readablestreamdefaultreader.read() method has not finished.
RenderingContext - Web APIs
by using the shorthand renderingcontext, methods and properties which can make use of any of these interfaces can be specified and written more easily; since <canvas> supports several rendering systems, it's helpful from a specification and browser implementation perspective to have a shorthand that means "one of these interfaces." as such, renderingcontext is an implementation detail, and isn't something web developers directly use.
... the primary use of this type is the definition of the <canvas> element's htmlcanvaselement.getcontext() method, which returns a renderingcontext (meaning it returns any one of the rendering context types).
Report - Web APIs
WebAPIReport
reports can be accessed in a number of ways: via the reportingobserver.takerecords() method — this returns all reports in an observer's report queue, and then empties the queue.
... methods this interface has no methods defined on it.
ReportingObserver - Web APIs
methods reportingobserver.disconnect() stops a reporting observer that had previously started observing from collecting reports.
... note: if you look at the complete source code, you'll notice that we actually call the deprecated getusermedia() method twice.
Response.error() - Web APIs
WebAPIResponseerror
the error() method of the response interface returns a new response object associated with a network error.
... note: this is mainly relevant to serviceworkers; the error method is used to return an error if you so wish it.
Response - Web APIs
WebAPIResponse
methods response.clone() creates a clone of a response object.
... body interface methods response implements body, so it also has the following methods available to it: body.arraybuffer() takes a response stream and reads it to completion.
SVGAElement - Web APIs
the svgaelement interface provides access to the properties of <a> element, as well as methods to manipulate them.
... methods this interface has no methods but inherits methods from its parent, svggraphicselement.
SVGAngle - Web APIs
WebAPISVGAngle
methods newvaluespecifiedunits reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object.
...object attributes unittype, valueinspecifiedunits, and valueasstring might be modified as a result of this method.
SVGAnimatedAngle - Web APIs
interface overview also implement none methods none properties readonly svgangle baseval readonly svgangle animval normative document svg 1.1 (2nd edition) properties name type description baseval svgangle the base value of the given attribute before applying any animations.
... methods the svganimatedangle interface do not provide any specific methods.
SVGAnimatedBoolean - Web APIs
interface overview also implement none methods none properties readonly boolean baseval readonly boolean animval normative document svg 1.1 (2nd edition) properties name type description baseval boolean the base value of the given attribute before applying any animations.
... methods the svganimatedboolean interface do not provide any specific methods.
SVGAnimatedEnumeration - Web APIs
interface overview also implement none methods none properties unsigned short baseval readonly unsigned short animval normative document svg 1.1 (2nd edition) properties name type description baseval unsigned short the base value of the given attribute before applying any animations.
... methods the svganimatedenumeration interface do not provide any specific methods.
SVGAnimatedInteger - Web APIs
interface overview also implement none methods none properties readonly long baseval readonly long animval normative document svg 1.1 (2nd edition) properties name type description baseval long the base value of the given attribute before applying any animations.
... methods the svganimatedinteger interface do not provide any specific methods.
SVGAnimatedLength - Web APIs
interface overview also implement none methods none properties readonly svglength baseval readonly svglength animval normative document svg 1.1 (2nd edition) properties name type description baseval svglength the base value of the given attribute before applying any animations.
... methods the svganimatedlength interface do not provide any specific methods.
SVGAnimatedLengthList - Web APIs
interface overview also implement none methods none properties readonly svglengthlist baseval readonly svglengthlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svglengthlist the base value of the given attribute before applying any animations.
... methods the svganimatedlengthlist interface do not provide any specific methods.
SVGAnimatedNumber - Web APIs
interface overview also implement none methods none properties float baseval readonly float animval normative document svg 1.1 (2nd edition) properties name type description baseval float the base value of the given attribute before applying any animations.
... methods the svganimatednumber interface do not provide any specific methods.
SVGAnimatedNumberList - Web APIs
interface overview also implement none methods none properties readonly svgnumberlist baseval readonly svgnumberlist animval normative document svg 1.1 (2nd edition) properties svganimatednumberlist.baseval read only is a svgnumberlist that represents the base value of the given attribute before applying any animations.
... methods the svganimatednumberlist interface do not provide any specific methods.
SVGAnimatedPathData - Web APIs
interface overview also implement none methods none properties svgpathseglist animatednormalizedpathseglist svgpathseglist animatedpathseglist svgpathseglist normalizedpathseglist svgpathseglist pathseglist normative document svg 1.1 (2nd edition) properties this interface also inherits properti...
... methods this interface does not provide any specific methods, but implements those of its parent, svgpathelement.
SVGAnimatedPreserveAspectRatio - Web APIs
interface overview also implement none methods none properties readonly float baseval readonly float animval normative document svg 1.1 (2nd edition) properties svganimatedpreserveaspectratio.baseval read only is a svgpreserveaspectratio that represents the base value of the given attribute before applying any animations.
... methods the svganimatedpreserveaspectratio interface do not provide any specific methods.
SVGAnimatedRect - Web APIs
interface overview also implement none methods none properties readonly svgrect baseval readonly svgrect animval normative document svg 1.1 (2nd edition) properties name type description baseval svgrect the base value of the given attribute before applying any animations.
... methods the svganimatedrect interface do not provide any specific methods.
SVGAnimatedTransformList - Web APIs
interface overview also implement none methods none properties readonly svgtransformlist baseval readonly svgtransformlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svgtransformlist the base value of the given attribute before applying any animations.
... methods the svganimatedtransformlist interface doesn't provide any specific methods.
SVGClipPathElement - Web APIs
the svgclippathelement interface provides access to the properties of <clippath> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent, svgelement.
SVGCursorElement - Web APIs
the svgcursorelement interface provides access to the properties of <cursor> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent, svgelement.
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 ...
... methods the svgdocument interface does not provide any specific methods.
SVGFilterElement - Web APIs
the svgfilterelement interface provides access to the properties of <filter> elements, as well as methods to manipulate them.
... methods svgfilterelement.setfilterres() sets the values of the filterres attribute.
SVGFitToViewBox - Web APIs
interface overview also implement none methods none properties svganimatedpreserveaspectratio preserveaspectratio svganimatedrect viewbox normative document svg 1.1 (2nd edition) properties name type description ...
... methods the svgfittoviewbox interface does not provide any specific methods.
SVGForeignObjectElement - Web APIs
the svgforeignobjectelement interface provides access to the properties of <foreignobject> elements, as well as methods to manipulate them.
... methods this interface has no methods but inherits methods from its parent, svggraphicselement and implements methods from svgurireference.
SVGGeometryElement.getPointAtLength() - Web APIs
the svggeometryelement.getpointatlength() method returns the point at a given distance along the path.
... note: this method was originally part of the svgpathelement interface.
SVGGeometryElement.getTotalLength() - Web APIs
the svggeometryelement.gettotallength() method returns the user agent's computed value for the total length of the path in user units.
... note: this method was originally part of the svgpathelement interface.
SVGGeometryElement - Web APIs
ght="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="171" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggeometryelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: the pathlength property and the gettotallength() and getpointatlength() methods were originally part of the svgpathelement interface.
... methods this interface also inherits methods from its parent, svggraphicselement.
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 ...
... methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGLineElement - Web APIs
the svglineelement interface provides access to the properties of <line> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggeometryelement.
SVGMarkerElement - Web APIs
interface overview also implement none methods void setorienttoangle(in svgangle angle) void setorienttoauto() properties svganimatedlength refx svganimatedlength refy svganimatedenumeration markerunits svganimatedlength markerwidth svganimatedlength markerheight svganimatedenumeration orienttype svganimatedangle orientangle constants ...
... methods this also inherits methods from its parent, svgelement, and implements properties from svgstylable.
SVGMaskElement - Web APIs
the svgmaskelement interface provides access to the properties of <mask> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGNumberList - Web APIs
interface overview also implement none methods void clear() svgnumber initialize(in svgnumber newitem) svgnumber getitem(in unsigned long index) svgnumber insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber replaceitem(in svgnumber newitem, in unsigned long index) svgnumber removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) propertie...
... methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGPathElement.getTotalLength() - Web APIs
the svgpathelement.gettotallength() method returns the user agent's computed value for the total length of the path in user units.
... note: in svg 2 this method was moved to the svggeometryelement interface, from which the svgpathelement inherits it.
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 = ...
... methods the svgpathseg interface does not provide any specific methods.
SVGPathSegList - Web APIs
interface overview also implement none methods void clear() svgpathseg initialize(in svgpathseg newitem) svgpathseg getitem(in unsigned long index) svgpathseg insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg replaceitem(in svgpathseg newitem, in unsigned long index) svgpathseg removeitem(in unsigned long index) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long number...
... methods clear() void clears all existing current items from the list, with the result being an empty list.
SVGPointList - Web APIs
interface overview also implement none methods void clear() svgpoint initialize(in svgpoint newitem) svgpoint getitem(in unsigned long index) svgpoint insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint replaceitem(in svgpoint newitem, in unsigned long index) svgpoint removeitem(in unsigned long index) svgpoint appenditem(in svgpoint newitem) ...
... methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
SVGPolygonElement - Web APIs
the svgpolygonelement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement.
SVGPolylineElement - Web APIs
the svgpolylineelement interface provides access to the properties of <polyline> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement.
SVGPreserveAspectRatio - Web APIs
interface overview also implement none methods none properties unsigned short align unsigned short meetorslice constants svg_preserveaspectratio_unknown = 0 svg_preserveaspectratio_none = 1 svg_preserveaspectratio_xminymin = 2 svg_preserveaspectratio_xmidymin = 3 svg_preserveaspectratio_xmaxymin = 4 svg_preserveaspectratio_xminymid = 5 svg_preserveaspectratio_xmi...
... methods the svgpreserveaspectratio interface do not provide any specific methods.
SVGRectElement - Web APIs
the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement.
SVGStringList - Web APIs
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 n...
... methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
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.
SVGTests - Web APIs
WebAPISVGTests
methods svgtests.hasextension() read only returns true if the browser supports the given extension, specified by a uri.
... candidate recommendation removed requiredfeatures property and hasextension() method.
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(in svgtransform newite...
... methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty list.
Screen - Web APIs
WebAPIScreen
methods screen.lockorientation lock the screen orientation (only works in fullscreen or for installed apps) screen.unlockorientation unlock the screen orientation (only works in fullscreen or for installed apps) methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
... additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties.
ScriptProcessorNode - Web APIs
the size of the input and output buffer are defined at the creation time, when the audiocontext.createscriptprocessor() method is called (both are defined by audiocontext.createscriptprocessor()'s buffersize parameter).
... methods no specific methods; inherits methods from its parent, audionode.
ScrollToOptions - Web APIs
a scrolltooptions dictionary can be provided as a parameter for the following methods: window.scroll() window.scrollby() window.scrollto() element.scroll() element.scrollby() element.scrollto() properties scrolltooptions.top specifies the number of pixels along the y axis to scroll the window or element.
... when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
Selection.collapse() - Web APIs
the selection.collapse() method collapses the current selection to a single point.
...this value can also be set to null — if null is specified, the method will behave like selection.removeallranges(), i.e.
Selection.deleteFromDocument() - Web APIs
the deletefromdocument() method of the selection interface deletes the selected text from the document's dom.
...upon clicking the button, the window.getselection() method gets the selected text, and the deletefromdocument() method removes it.
Selection.modify() - Web APIs
WebAPISelectionmodify
the selection.modify() method applies a change to the current selection or cursor position, using simple textual commands.
...ocumentboundary">document boundary</option> </select> <br><br> <button>extend selection</button> javascript let select = document.queryselector('select'); let button = document.queryselector('button'); button.addeventlistener('click', modify); function modify() { let selection = window.getselection(); selection.modify('extend', 'forward', select.value); } result specifications this method is not part of any specification.
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.
... we also have a button that when pressed invokes a function that runs the setbaseandextent() method with the specified offsets, and copies the selection into the output paragraph at the very bottom of the html.
Sensor - Web APIs
WebAPISensor
instead it provides properties, event handlers, and methods accessed by interfaces that inherit from it.
... methods sensor.start() activates one of the sensors based on sensor.
ServiceWorkerContainer.getRegistration() - Web APIs
the getregistration() method of the serviceworkercontainer interface gets a serviceworkerregistration object whose scope url matches the provided document url.
... the method returns a promise that resolves to a serviceworkerregistration or undefined.
ServiceWorkerContainer.getRegistrations() - Web APIs
the getregistrations() method of the serviceworkercontainer interface gets all serviceworkerregistrations associated with a serviceworkercontainer, in an array.
... the method returns a promise that resolves to an array of serviceworkerregistration.
ServiceWorkerContainer.register() - Web APIs
the register() method of the serviceworkercontainer interface creates or updates a serviceworkerregistration for the given scripturl.
...you can call this method unconditionally from the controlled page.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
consider using another method to synchronize subscription information between your service worker and the app server, or make sure your code using fetch() is robust enough to handle cases where attempts to exchange data fail.
... self.addeventlistener("pushsubscriptionchange", event => { event.waituntil(swregistration.pushmanager.subscribe(event.oldsubscription.options) .then(subscription => { return fetch("register", { method: "post", headers: { "content-type": "application/json" }, body: json.stringify({ endpoint: subscription.endpoint }) }); }) ); }, false); when a pushsubscriptionchange event arrives, indicating that the subscription has expired, we resubscribe by calling the push manager's subscribe() method.
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
the serviceworkerglobalscope.skipwaiting() method of the serviceworkerglobalscope forces the waiting service worker to become the active service worker.
... use this method with clients.claim() to ensure that updates to the underlying service worker take effect immediately for both the current client and all other active clients.
ServiceWorkerRegistration - Web APIs
methods also implements methods from its parent interface, eventtarget.
... notifications api living standard adds the shownotification() method and the getnotifications() method.
SharedWorkerGlobalScope.close() - Web APIs
the close() method of the sharedworkerglobalscope interface discards any tasks queued in the sharedworkerglobalscope's event loop, effectively closing this particular scope.
... note: there is also a way to stop the worker from the main thread: the worker.terminate method.
SharedWorkerGlobalScope: connect event - Web APIs
the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker.
...nect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) addeventlistener equivalent you could also set up an event handler using the addeventlistener() method: self.addeventlistener('connect', function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } }); specifications specification status html living standardthe definition of 'connect event' in that specification.
SharedWorkerGlobalScope - Web APIs
workerglobalscope.performance read only returns the performance object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
... methods this interface inherits methods from the workerglobalscope interface, and its parent eventtarget, and therefore implements methods from windowtimers, windowbase64, and windoweventhandlers.
SourceBuffer.appendBufferAsync() - Web APIs
the appendbufferasync() method of the sourcebuffer interface begins the process of asynchronously appending media segment data from an arraybuffer or arraybufferview object to the sourcebuffer.
... specification status comment media source extensions recommendation initial definition; does not include this method.
SourceBuffer.remove() - Web APIs
the remove() method of the sourcebuffer interface removes media segments within a specific time range from the sourcebuffer.
... this method can only be called when sourcebuffer.updating equals false.
SourceBuffer.removeAsync() - Web APIs
the removeasync() method of the sourcebuffer interface starts the process of asynchronously removing from the sourcebuffer media segments found within a specific time range.
... this method can only be called when updating is false.
SpeechGrammarList - Web APIs
methods speechgrammarlist.item() standard getter — allows individual speechgrammar objects to be retrieved from the speechgrammarlist using array syntax.
... examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property.
SpeechSynthesis.getVoices() - Web APIs
the getvoices() method of the speechsynthesis interface returns a list of speechsynthesisvoice objects representing all the available voices on the current device.
... note: the spec wrongly lists this method as returning as a speechsynthesisvoicelist object, but this was in fact removed from the spec.
SpeechSynthesis: voiceschanged event - Web APIs
the voiceschanged event of the web speech api is fired when the list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) bubbles no cancelable no interface event event handler property onvoiceschanged examples this could be used to repopulate a list of voices that the user can choose between when the event fires.
... you can use the voiceschanged event in an addeventlistener method: var synth = window.speechsynthesis; synth.addeventlistener('voiceschanged', function() { var voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } }); or use the onvoiceschanged event handler property: synth.onvoiceschanged = function() { var voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; option.s...
SpeechSynthesisErrorEvent.error - Web APIs
possible codes are: canceled a speechsynthesis.cancel method call caused the speechsynthesisutterance to be removed from the queue before it had begun being spoken.
... interrupted a speechsynthesis.cancel method call caused the speechsynthesisutterance to be interrupted after it had begun being spoken and before it completed.
StereoPannerNode - Web APIs
methods no specific method; inherits methods from its parent, audionode.
...in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method.
Storage.removeItem() - Web APIs
the removeitem() method of the storage interface, when passed a key name, will remove that key from the given storage object if it exists.
... if there is no item associated with the given key, this method will do nothing.
StorageManager.estimate() - Web APIs
the estimate() method of the storagemanager interface asks the storage manager for how much storage the current origin takes up (usage), and how much space is available (quota).
... this method operates asynchronously, so it returns a promise which resolves once the information is available.
StylePropertyMapReadOnly.get() - Web APIs
the get() method of the stylepropertymapreadonly interface returns a cssstylevalue object for the first value of the specified property.
...we create an array of properties of interest and use the stylepropertymapreadonly's get() method to get only those values.
StyleSheetList - Web APIs
it is an array-like object but can't be iterated over using array methods.
... examples get document stylesheet objects with for loop for (let i = 0; i < document.stylesheets.length; i++) { let stylesheet = document.stylesheets[i]; } get all css rules for the document using array methods const allcss = [...document.stylesheets] .map(stylesheet => { try { return [...stylesheet.cssrules] .map(rule => rule.csstext) .join(''); } catch (e) { console.log('access to stylesheet %s is denied.
SubtleCrypto.decrypt() - Web APIs
the decrypt() method of the subtlecrypto interface decrypts some encrypted data.
... supported algorithms the decrypt() method supports the same algorithms as the encrypt() method.
SubtleCrypto.deriveKey() - Web APIs
the derivekey() method of the subtlecrypto interface can be used to derive a secret key from a master key.
... /* get some key material to use as input to the derivekey method.
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
the sign() method of the subtlecrypto interface generates a digital signature.
... you can use the corresponding subtlecrypto.verify() method to verify the signature.
SubtleCrypto.verify() - Web APIs
the verify() method of the subtlecrypto interface verifies a digital signature.
... supported algorithms the verify() method supports the same algorithms as the sign() method.
Text.replaceWholeText() - Web APIs
the text.replacewholetext() method replaces the text of the node and all of its logically adjacent text nodes with the specified text.
... this method returns the text node which received the replacement text, or null if the replacement text is an empty string.
Text.splitText() - Web APIs
WebAPITextsplitText
the text.splittext() method breaks the text node into two nodes at the specified offset, keeping both nodes in the tree as siblings.
... separated text nodes can be concatenated using the node.normalize() method.
TextEncoder.prototype.encodeInto() - Web APIs
the textencoder.prototype.encodeinto() method takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
... this is potentially more performant than the older encode() method especially when the target buffer is a view into a wasm heap.
TextEncoder - Web APIs
methods the textencoder interface doesn't inherit any method.
...this is potentially more performant than the older encode() method.
getTrackById() - Web APIs
the texttracklist method gettrackbyid() returns the first texttrack object from the track list whose id matches the specified string.
...if no match is found, this method returns null.
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.
... this method may only be called before the timeevent has been dispatched via the dispatchevent method, though it may be called multiple times during that phase if necessary.
TimeRanges - Web APIs
you reference each time range by using the start() and end() methods, passing the index number of the time range you want to retrieve.
... methods timeranges.start() returns the time for the start of the range with the specified index.
TouchList.item() - Web APIs
WebAPITouchListitem
the item() method returns the touch object at the specified index in the touchlist.
... example this code example illustrates the use of the touchlist interface's item method and the length property.
Touch events - Web APIs
note: the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus or other contact method.
... this lets us get the coordinates of the previous position of each touch and use the appropriate context methods to draw a line segment joining the two positions together.
Transferable - Web APIs
this interface does not define any method or property; it is merely a tag indicating objects that can be used in specific conditions, such as being transfered to a worker using the worker.postmessage() method.
... methods the transferable interface does not implement or inherit specific properties.
TransitionEvent - Web APIs
methods also inherits properties from its parent event.
... transitionevent.inittransitionevent() initializes a transitionevent created using the deprecated document.createevent("transitionevent") method.
TreeWalker - Web APIs
a treewalker can be created using the document.createtreewalker() method.
... methods this interface doesn't inherit any method.
URLSearchParams.keys() - Web APIs
the keys() method of the urlsearchparams interface returns an iterator allowing iteration through all keys contained in this object.
... note: this method is available in web workers.
URLSearchParams.sort() - Web APIs
the urlsearchparams.sort() method sorts all key/value pairs contained in this object in place and returns undefined.
...this method uses a stable sorting algorithm (i.e.
URLSearchParams.toString() - Web APIs
the tostring() method of the urlsearchparams interface returns a query string suitable for use in a url.
... note: this method returns the query string without the question mark.
URLSearchParams - Web APIs
the urlsearchparams interface defines utility methods to work with the query string of a url.
... methods urlsearchparams.append() appends a specified key/value pair as a new search parameter.
URLUtilsReadOnly - Web APIs
the obsolete urlutilsreadonly interface previously defined utility methods for working with urls.
... methods this interface doesn't inherit any methods.
USB - Web APIs
WebAPIUSB
the usb interface of the webusb api provides attributes and methods for finding and connecting usb devices from a web page.
... methods usb.getdevices() returns a promise that resolves with an array of usbdevice objects for paired attached devices.
USBDevice - Web APIs
WebAPIUSBDevice
the usbdevice interface of the the webusb api provides access to metadata about a paired usb device and methods for controlling it.
... methods usbdevice.claiminterface() returns a promise that resolves when the requested interface is claimed for exclusive access.
Vibration API - Web APIs
vibration is controlled with a single method: navigator.vibrate().
... if(vibrateinterval) clearinterval(vibrateinterval); navigator.vibrate(0); } // start persistent vibration at given duration and interval // assumes a number value is given function startpersistentvibrate(duration, interval) { vibrateinterval = setinterval(function() { startvibrate(duration); }, interval); } of course, the snippet above doesn't take into account the array method of vibration; persistent array-based vibration will require calculating the sum of the array items and creating an interval based on that number (with an additional delay, probably).
VideoPlaybackQuality - Web APIs
a videoplaybackquality object is returned by the htmlvideoelement.getvideoplaybackquality() method and contains metrics that can be used to determine the playback quality of a video.
... methods the videoplaybackquality interface has no methods, and does not inherit any.
getTrackById - Web APIs
the videotracklist method gettrackbyid() returns the first videotrack object from the track list whose id matches the specified string.
...if no match is found, this method returns null.
WEBGL_color_buffer_float - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods this extension extends webglrenderingcontext.renderbufferstorage(): the internalformat parameter now accepts ext.rgba32f_ext and ext.rgb32f_ext ( ).
WEBGL_compressed_texture_astc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... methods this extension exposes one new methods.
WEBGL_compressed_texture_etc1 - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... constants the compressed texture format is exposed by a constant and can be used with the compressedteximage2d() method (note that etc1 is not supported with the compressedtexsubimage2d() method).
WEBGL_debug_renderer_info - Web APIs
the webglrenderingcontext.getparameter() method can help you to detect which features are supported and the failifmajorperformancecaveat context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow.
... webgl extensions are available using the webglrenderingcontext.getextension() method.
WEBGL_depth_texture - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... extended methods this extension extends webglrenderingcontext.teximage2d(): the format and internalformat parameters now accept gl.depth_component and gl.depth_stencil.
WEBGL_lose_context.loseContext() - Web APIs
the webgl_lose_context.losecontext() method is part of the webgl api and allows you to simulate losing the context of a webglrenderingcontext context.
... syntax gl.getextension('webgl_lose_context').losecontext(); examples with this method, you can simulate the webglcontextlost event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').losecontext(); // webglcontextevent event with type "webglcontextlost" is logged.
WEBGL_lose_context.restoreContext() - Web APIs
the webgl_lose_context.restorecontext() method is part of the webgl api and allows you to simulate restoring the context of a webglrenderingcontext object.
... examples with this method, you can simulate the webglcontextrestored event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextrestored', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').restorecontext(); specifications specification status comment webgl_lose_contextthe definition of 'webgl_lose_context.losecontext' in that specification.
WEBGL_lose_context - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
... methods webgl_lose_context.losecontext() simulates losing the context.
WakeLock.request() - Web APIs
WebAPIWakeLockrequest
the request() method of the wakelock interface returns a promise that resolves with a wakelocksentinel object, which allows control over screen dimming and locking.
...the request() method is wrapped in a try...catch statement to account for if the browser refuses the request for any reason.
WakeLock - Web APIs
WebAPIWakeLock
methods request requests a wakelocksentinel object, which returns a promise that resolves with a wakelocksentinel object.
...the wakelock.request method is wrapped in a try...catch statement to account for if the browser refuses the request for any reason.
WebGL2RenderingContext.clientWaitSync() - Web APIs
the webgl2renderingcontext.clientwaitsync() method of the webgl 2 api blocks and waits for a webglsync object to become signaled or a given timeout to be passed.
... gl.already_signaled: indicates that the sync object was signaled when this method was called.
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
the webgl2renderingcontext.drawarraysinstanced() method of the webgl 2 api renders primitives from array data like the gl.drawarrays() method.
... note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too.
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
the webgl2renderingcontext.drawelementsinstanced() method of the webgl 2 api renders primitives from array data like the gl.drawelements() method.
... note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too.
WebGL2RenderingContext.framebufferTextureLayer() - Web APIs
the webgl2renderingcontext.framebuffertexturelayer() method of the webgl 2 api attaches a single layer of a texture to a framebuffer.
... this method is similar to webglrenderingcontext.framebuffertexture2d(), but only a given single layer of the texture level is attached to the attachment point.
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
the webgl2renderingcontext.uniformmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uniform variables.
... there are no 2x2, 3x3, and 4x4 versions of this method.
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
the webgl2renderingcontext.vertexattribdivisor() method of the webgl 2 api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawarraysinstanced() and gl.drawelementsinstanced().
... note: when using webgl 1, the angle_instanced_arrays extension can provide this method, too.
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
the webgl2renderingcontext.vertexattribipointer() method of the webgl 2 api specifies integer data formats and locations of vertex attributes in a vertex attributes array.
...the main difference is that while values specified by vertexattribpointer are always interpreted as floating-point values in the shader (even if they were originally specified as integers in the buffer), this method allows specifying values which are interpreted as integers in the shader.
WebGL2RenderingContext.waitSync() - Web APIs
the webgl2renderingcontext.waitsync() method of the webgl 2 api returns immediately, but waits on the gl server until the given webglsync object is signaled.
... the method is a no-op in the absence of the possibility of synchronizing between multiple gl contexts.
WebGLBuffer - Web APIs
description the webglbuffer object does not define any methods or properties of its own and its content is not directly accessible.
... when working with webglbuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindbuffer() webglrenderingcontext.createbuffer() webglrenderingcontext.deletebuffer() webglrenderingcontext.isbuffer() examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); specifications specification status comment webgl 1.0the definition of 'webglbuffer' in that specification.
WebGLContextEvent - Web APIs
inheritance this interface inherits properties and methods from its parent interface, event.
... methods this interface doesn't define any own methods, but inherits methods from its parent interface, event.
WebGLFramebuffer - Web APIs
description the webglframebuffer object does not define any methods or properties of its own and its content is not directly accessible.
... when working with webglframebuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindframebuffer() webglrenderingcontext.createframebuffer() webglrenderingcontext.deleteframebuffer() webglrenderingcontext.isframebuffer() examples creating a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createframebuffer(); specifications specification status comment webgl 1.0the definition of 'webglframebuffer' in that specification.
WebGLRenderbuffer - Web APIs
description the webglrenderbuffer object does not define any methods or properties of its own and its content is not directly accessible.
... when working with webglrenderbuffer objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindrenderbuffer() webglrenderingcontext.createrenderbuffer() webglrenderingcontext.deleterenderbuffer() webglrenderingcontext.isrenderbuffer() examples creating a render buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createrenderbuffer(); specifications specification status comment webgl 1.0the definition of 'webglrenderbuffer' in that specification.
WebGLRenderingContext.bufferData() - Web APIs
the webglrenderingcontext.bufferdata() method of the webgl api initializes and creates the buffer object's data store.
... examples using bufferdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); getting buffer information to check the current buffer usage and buffer size, use the webglrenderingcontext.getbufferparameter() method.
WebGLRenderingContext.clearColor() - Web APIs
the webglrenderingcontext.clearcolor() method of the webgl api specifies the color values used when clearing color buffers.
... this specifies what color values to use when calling the clear() method.
WebGLRenderingContext.clearDepth() - Web APIs
the webglrenderingcontext.cleardepth() method of the webgl api specifies the clear value for the depth buffer.
... this specifies what depth value to use when calling the clear() method.
WebGLRenderingContext.clearStencil() - Web APIs
the webglrenderingcontext.clearstencil() method of the webgl api specifies the clear value for the stencil buffer.
... this specifies what stencil value to use when calling the clear() method.
WebGLRenderingContext.commit() - Web APIs
the webglrenderingcontext.commit() method pushes frames back to the original htmlcanvaselement, if the context is not directly fixed to a specific canvas.
... // push frames back to the original htmlcanvaselement gl.commit(); specifications specification status comment html living standardthe definition of 'the commit() method of the offscreencanvas object's rendering context' in that specification.
WebGLRenderingContext.cullFace() - Web APIs
the webglrenderingcontext.cullface() method of the webgl api specifies whether or not front- and/or back-facing polygons can be culled.
...to enable or disable culling, use the enable() and disable() methods with the argument gl.cull_face.
WebGLRenderingContext.deleteBuffer() - Web APIs
the webglrenderingcontext.deletebuffer() method of the webgl api deletes a given webglbuffer.
... this method has no effect if the buffer has already been deleted.
WebGLRenderingContext.deleteFramebuffer() - Web APIs
the webglrenderingcontext.deleteframebuffer() method of the webgl api deletes a given webglframebuffer object.
... this method has no effect if the frame buffer has already been deleted.
WebGLRenderingContext.deleteProgram() - Web APIs
the webglrenderingcontext.deleteprogram() method of the webgl api deletes a given webglprogram object.
... this method has no effect if the program has already been deleted.
WebGLRenderingContext.deleteRenderbuffer() - Web APIs
the webglrenderingcontext.deleterenderbuffer() method of the webgl api deletes a given webglrenderbuffer object.
... this method has no effect if the render buffer has already been deleted.
WebGLRenderingContext.deleteShader() - Web APIs
the webglrenderingcontext.deleteshader() method of the webgl api marks a given webglshader object for deletion.
...this method has no effect if the shader has already been deleted, and the webglshader is automatically marked for deletion when it is destroyed by the garbage collector.
WebGLRenderingContext.deleteTexture() - Web APIs
the webglrenderingcontext.deletetexture() method of the webgl api deletes a given webgltexture object.
... this method has no effect if the texture has already been deleted.
WebGLRenderingContext.depthFunc() - Web APIs
the webglrenderingcontext.depthfunc() method of the webgl api specifies a function that compares incoming pixel depth to the current depth buffer value.
...to enable or disable depth testing, use the enable() and disable() methods with the argument gl.depth_test.
WebGLRenderingContext.disable() - Web APIs
the webglrenderingcontext.disable() method of the webgl api disables specific webgl capabilities for this context.
... examples gl.disable(gl.dither); to check if a capability is disabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // false specifications specification status comment webgl 1.0the definition of 'disable' in that specification.
WebGLRenderingContext.enable() - Web APIs
the webglrenderingcontext.enable() method of the webgl api enables specific webgl capabilities for this context.
... examples gl.enable(gl.dither); to check if a capability is enabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // true specifications specification status comment webgl 1.0the definition of 'enable' in that specification.
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
the webglrenderingcontext method enablevertexattribarray(), part of the webgl api, turns on the generic vertex attribute array at the specified index into the list of attribute arrays.
...once that's been done, other methods can be used to access the attribute, including vertexattribpointer(), vertexattrib*(), and getvertexattrib().
WebGLRenderingContext.getExtension() - Web APIs
the webglrenderingcontext.getextension() method enables a webgl extension.
... examples once a webgl extension is enabled, you are able to use the methods, properties or constants that this extension object provides.
WebGLRenderingContext.getSupportedExtensions() - Web APIs
the webglrenderingcontext.getsupportedextensions() method returns a list of all the supported webgl extensions.
...] see also the webglrenderingcontext.getextension() method to get a specific extension object.
WebGLRenderingContext.isEnabled() - Web APIs
the webglrenderingcontext.isenabled() method of the webgl api tests whether a specific webgl capability is enabled or not for this context.
... examples gl.isenabled(gl.stencil_test); // false to activate or deactivate a specific capability, use the webglrenderingcontext.enable() and webglrenderingcontext.disable() methods: gl.enable(gl.stencil_test); gl.disable(gl.stencil_test); specifications specification status comment webgl 1.0the definition of 'isenabled' in that specification.
WebGLRenderingContext.pixelStorei() - Web APIs
the webglrenderingcontext.pixelstorei() method of the webgl api specifies the pixel storage modes.
... opengl es 3.0 gl.unpack_skip_images number of pixel images skipped before the first pixel is read from memory glint 0 0 to infinity opengl es 3.0 examples setting the pixel storage mode affects the webglrenderingcontext.readpixels() operations, as well as unpacking of textures with the webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d() methods.
WebGLRenderingContext.polygonOffset() - Web APIs
the webglrenderingcontext.polygonoffset() method of the webgl api specifies the scale factors and units to calculate depth values.
...to enable or disable polygon offset fill, use the enable() and disable() methods with the argument gl.polygon_offset_fill.
WebGLRenderingContext.sampleCoverage() - Web APIs
the webglrenderingcontext.samplecoverage() method of the webgl api specifies multi-sample coverage parameters for anti-aliasing effects.
...to enable or disable multi-sampling, use the enable() and disable() methods with the argument gl.sample_coverage and gl.sample_alpha_to_coverage.
WebGLRenderingContext.stencilFunc() - Web APIs
the webglrenderingcontext.stencilfunc() method of the webgl api sets the front and back function and reference value for stencil testing.
...to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test.
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
the webglrenderingcontext.stencilfuncseparate() method of the webgl api sets the front and/or back function and reference value for stencil testing.
...to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test.
WebGLRenderingContext.stencilMask() - Web APIs
the webglrenderingcontext.stencilmask() method of the webgl api controls enabling and disabling of both the front and back writing of individual bits in the stencil planes.
... the webglrenderingcontext.stencilmaskseparate() method can set front and back stencil writemasks to different values.
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
the webglrenderingcontext.stencilmaskseparate() method of the webgl api controls enabling and disabling of front and/or back writing of individual bits in the stencil planes.
... the webglrenderingcontext.stencilmask() method can set both, the front and back stencil writemasks to one value at the same time.
WebGLRenderingContext.stencilOp() - Web APIs
the webglrenderingcontext.stencilop() method of the webgl api sets both the front and back-facing stencil test actions.
...to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test.
WebGLRenderingContext.stencilOpSeparate() - Web APIs
the webglrenderingcontext.stencilopseparate() method of the webgl api sets the front and/or back-facing stencil test actions.
...to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test.
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
the webglrenderingcontext.uniformmatrix[234]fv() methods of the webgl api specify matrix values for uniform variables.
... the three versions of this method (uniformmatrix2fv(), uniformmatrix3fv(), and uniformmatrix4fv()) take as the input value 2-component, 3-component, and 4-component square matrices, respectively.
WebGLRenderingContext.vertexAttribPointer() - Web APIs
the webglrenderingcontext.vertexattribpointer() method of the webgl api binds the buffer currently bound to gl.array_buffer to a generic vertex attribute of the current vertex buffer object and specifies its layout.
...first, we need to bind the webglbuffer we want to use to gl.array_buffer, then, with this method, gl.vertexattribpointer(), we specify in what order the attributes are stored, and what data type they are in.
WebGLRenderingContext - Web APIs
the webgl context the following properties and methods provide general information and functionality to deal with the webgl context: webglrenderingcontext.canvas a read-only back-reference to the htmlcanvaselement.
... working with extensions these methods manage webgl extensions: webglrenderingcontext.getsupportedextensions() returns an array of domstring elements with all the supported webgl extensions.
WebGLShaderPrecisionFormat - Web APIs
the webglshaderprecisionformat interface is part of the webgl api and represents the information returned by calling the webglrenderingcontext.getshaderprecisionformat() method.
... examples a webglshaderprecisionformat object is returned by the webglrenderingcontext.getshaderprecisionformat() method.
WebGLTexture - Web APIs
description the webgltexture object does not define any methods or properties of its own and its content is not directly accessible.
... when working with webgltexture objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.bindtexture() webglrenderingcontext.createtexture() webglrenderingcontext.deletetexture() webglrenderingcontext.istexture() examples creating a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); specifications specification status comment webgl 1.0the definition of 'webgltexture' in that specification.
WebGLUniformLocation - Web APIs
description the webgluniformlocation object does not define any methods or properties of its own and its content is not directly accessible.
... when working with webgluniformlocation objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.getuniformlocation() webglrenderingcontext.uniform() examples getting an uniform location var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var location = gl.getuniformlocation(webglprogram, 'uniformname'); specifications specification status comment webgl 1.0the definition of 'webgluniformlocation' in that specification.
Lifetime of a WebRTC session - Web APIs
signaling signaling is the process of sending control information between two devices to determine the communication protocols, channels, media codecs and formats, and method of data transfer, as well as any required routing information.
... in particular, if a developer already has a method in place for connecting two devices, it doesn’t make sense for them to have to use another one, defined by the specification, just for webrtc.
WebSocket.send() - Web APIs
WebAPIWebSocketsend
the websocket.send() method enqueues the specified data to be transmitted to the server over the websocket connection, increasing the value of bufferedamount by the number of bytes needed to contain the data.
... note: gecko's implementation of the send() method differs somewhat from the specification in gecko 6.0; gecko returns a boolean indicating whether or not the connection is still open (and, by extension, that the data was successfully queued or transmitted); this is corrected in gecko 8.0.
Basic concepts behind Web Audio API - Web APIs
created from raw pcm data (the audio context has methods to decode supported audio formats).
... you can grab data using the following methods: analysernode.getfloatfrequencydata() copies the current frequency data into a float32array array passed into it.
Using IIR filters - Web APIs
}, false); frequency response we only have one method available on iirfilternode instances, getfrequencyresponse(), this allows us to see what is happening to the frequencies of the audio being passed into the filter.
... let's draw a frequency plot of the filter we've created with the data we get back from this method.
Using the Web Speech API - Web APIs
var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); we add our grammar to the list using the speechgrammarlist.addfromstring() method.
...the foreach() method is used to output colored indicators showing what colors to try saying.
Window.clearImmediate() - Web APIs
this method clears the action specified by window.setimmediate.
... this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+.
Window.console - Web APIs
WebAPIWindowconsole
the window.console property returns a reference to the console object, which provides methods for logging information to the browser's console.
... these methods are intended for debugging purposes only and should not be relied on for presenting information to end users.
Window.external - Web APIs
WebAPIWindowexternal
however, this is now deprecated, and the contained methods are now dummy functions that do nothing as per spec.
... methods the external object has the following methods: method description addsearchprovider(descriptionurl) dummy function; does nothing.
Window.forward() - Web APIs
WebAPIWindowforward
this was a firefox-specific method and was removed in firefox 31.
... note: use the standard window.history.forward() method instead.
Window.getDefaultComputedStyle() - Web APIs
the getdefaultcomputedstyle() method gives the default computed values of all the css properties of an element, ignoring author styling.
...00px; top: 200px; height: 100px; } </style> <div id="elem-container">dummy</div> <div id="output"></div> <script> var elem = document.getelementbyid("elem-container"); var thecssprop = window.getdefaultcomputedstyle(elem).position; document.getelementbyid("output").innerhtml = thecssprop; // will output "static" </script> use with pseudo-elements the getdefaultcomputedstyle() method can pull style info from pseudo-elements (e.g., ::before or ::after).
Window.history - Web APIs
WebAPIWindowhistory
in particular, that article explains security features of the pushstate() and replacestate() methods that you should be aware of before using them.
...the closest available solution is the location.replace() method, which replaces the current item of the session history with the provided url.
Window.minimize() - Web APIs
WebAPIWindowminimize
the window.minimize() method sets the window to a minimized state.
... a way to undo this method programatically is by calling window.moveto().
Window.onmozbeforepaint - Web APIs
this is used in concert with the window.mozrequestanimationframe() method to perform smooth, synchronized animations from javascript code.
...this time is the same for all animations being run in the same browser window, including those using the window.mozrequestanimationframe() method, css transitions, and smil animations.
Privileged features - Web APIs
the dependent feature is currently under revision to be removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method.
... note: as of gecko 1.9, the internet explorer equivalent to this feature is the window.showmodaldialog() method.
window.requestIdleCallback() - Web APIs
the window.requestidlecallback() method queues a function to be called during a browser's idle periods.
... syntax var handle = window.requestidlecallback(callback[, options]) return value an id which can be used to cancel the callback by passing it into the window.cancelidlecallback() method.
Window.resizeBy() - Web APIs
WebAPIWindowresizeBy
the window.resizeby() method resizes the current window by a specified amount.
... example // shrink the window window.resizeby(-200, -200); notes this method resizes the window relative to its current size.
Window.scroll() - Web APIs
WebAPIWindowscroll
the window.scroll() method scrolls the window to a particular place in the document.
... examples <!-- put the 100th vertical pixel at the top of the window --> <button onclick="scroll(0, 100);">click to scroll down 100 pixels</button> using options: window.scroll({ top: 100, left: 100, behavior: 'smooth' }); notes window.scrollto() is effectively the same as this method.
Window.sidebar - Web APIs
WebAPIWindowsidebar
returns a sidebar object which contains several methods for registering add-ons with the browser.
... methods the sidebar object returned has the following methods: method description (seamonkey) description (firefox) addpanel(title, contenturl, "") adds a sidebar panel.
WindowOrWorkerGlobalScope.atob() - Web APIs
you can use the btoa() method to encode and transmit data which may otherwise cause communication problems, then transmit it and use the atob() method to decode the data again.
... living standard method moved to the windoworworkerglobalscope mixin in the latest spec.
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobalscope mixin cancels a timed, repeating action which was previously established by a call to setinterval().
... living standard method moved to the windoworworkerglobalscope mixin in the latest spec.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
the cleartimeout() method of the windoworworkerglobalscope mixin cancels a timeout previously established by calling settimeout().
... living standard method moved to the windoworworkerglobalscope mixin in the latest spec.
self.createImageBitmap() - Web APIs
the createimagebitmap() method creates a bitmap from a given source, optionally cropped to contain only a portion of that source.
... the method exists on the global scope in both windows and workers.
Worker.prototype.postMessage() - Web APIs
the postmessage() method of the worker interface sends a message to the worker's inner scope.
... the worker can send back information to the thread that spawned it using the dedicatedworkerglobalscope.postmessage method.
Worker - Web APIs
WebAPIWorker
methods inherits methods from its parent, eventtarget, and implements methods from abstractworker.
...serviceworker instances do not support this method.
WorkerGlobalScope.close() - Web APIs
the close() method of the workerglobalscope interface discards any tasks queued in the workerglobalscope's event loop, effectively closing this particular scope.
... note: there is also a way to stop the worker from the main thread: the worker.terminate method.
WorkerGlobalScope.dump() - Web APIs
the dump() method of the workerglobalscope interface allows you to write a message to stdout — i.e.
... specifications this method does not appear in any specification.
WorkerNavigator - Web APIs
workernavigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object.
... methods the workernavigator interface implements methods from the navigatorid, navigatorlanguage and navigatoronline interfaces.
Worklet - Web APIs
WebAPIWorklet
the worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly.
... methods worklet.addmodule() adds the script module at the given url to the current worklet.
WritableStream.getWriter() - Web APIs
the getwriter() method of the writablestream interface returns a new instance of writablestreamdefaultwriter and locks the stream to that instance.
...inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultController.error() - Web APIs
the error() method of the writablestreamdefaultcontroller interface causes any future interactions with the associated stream to error.
... this method is rarely used, since usually it suffices to return a rejected promise from one of the underlying sink’s methods.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
note: you generally wouldn't use this constructor manually; instead, you'd use the writablestream.getwriter() method.
...inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultWriter.abort() - Web APIs
the abort() method of the writablestreamdefaultwriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
... if the writer is active, the abort() method behaves the same as that for the associated stream (writablestream.abort()).
WritableStreamDefaultWriter.close() - Web APIs
the close() method of the writablestreamdefaultwriter interface closes the associated writable stream.
...inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultWriter - Web APIs
methods writablestreamdefaultwriter.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
...inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
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.
... 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.
XMLDocument - Web APIs
it inherits from the generic document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents.
... methods also inherits methods from: document xmldocument.load() loads an xml document.
Synchronous and asynchronous requests - Web APIs
:( client.setrequestheader("content-type", "text/plain;charset=utf-8"); client.send(analyticsdata); } using the sendbeacon() method, the data will be transmitted asynchronously to the web server when the user agent has had an opportunity to do so, without delaying the unload or affecting the performance of the next navigation.
... the following example shows a theoretical analytics code pattern that submits data to a server by using the sendbeacon() method.
XMLHttpRequest.abort() - Web APIs
the xmlhttprequest.abort() method aborts the request if it has already been sent.
... var xhr = new xmlhttprequest(), method = "get", url = "https://developer.mozilla.org/"; xhr.open(method, url, true); xhr.send(); if (oh_noes_we_need_to_cancel_right_now_or_else) { xhr.abort(); } specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequest.openRequest() - Web APIs
this mozilla-specific method is available only from within privileged code, and is only called from a c++ context in order to initialize an xmlhttprequest.
... to initialize a request from javascript code, use the standard open() method instead.
XMLHttpRequest.overrideMimeType() - Web APIs
the xmlhttprequest method overridemimetype() specifies a mime type other than the one provided by the server to be used instead when interpreting the data being transferred in a request.
...this method must be called before calling send().
XMLHttpRequest.setRequestHeader() - Web APIs
the xmlhttprequest method setrequestheader() sets the value of an http request header.
...if this method is called several times with the same header, the values are merged into one single request header.
XPathEvaluator.createExpression() - Web APIs
this method compiles an xpathexpression which can then be used for (repeated) evaluations of the xpath expression.
... example the following example shows the use of the evaluate() method.
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.
XPathResult.iterateNext() - Web APIs
the iteratenext() method of the xpathresult interface iterates over a node set result and returns the next node from it or null if there are no more nodes.
... example the following example shows the use of the iteratenext() method.
XPathResult.snapshotItem() - Web APIs
the snapshotitem() method of the xpathresult interface returns an item of the snapshot collection or null in case the index is not within the range of nodes.
... example the following example shows the use of the snapshotitem() method.
XRBoundedReferenceSpace - Web APIs
methods xrboundedreferencespace inherits the methods of its parent interface, xrreferencespace.
... it has no further methods.
XRFrame.getViewerPose() - Web APIs
the getviewerpose() method, a member of the xrframe interface, returns a xrviewerpose object which describes the viewer's pose (position and orientation) relative to the specified reference space.
... see the getpose() method for a way to calculate a pose that represents the difference between two spaces.
XRInputSource.targetRayMode - Web APIs
the read-only xrinputsource property targetraymode indicates the method by which the target ray for the input source should be generated and how it should be presented to the user.
... 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.
XRInputSource.targetRaySpace - Web APIs
this shared space represents the same location as the space returned by the xrsession method requestreferencespace(), but is maintained as a different object to allow for future enhancements to the api.
... to determine the position and orientation of the target ray while rendering a frame, pass it into the xrframe method getpose() method, then use the returned xrpose object's transform to gather the spatial information you need.
XRInputSourceArray.keys() - Web APIs
the keys() method in the xrinputsourcearray interface returns a javascript iterator which can then be used to iterate over the keys used to reference each item in the array of input sources.
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourceArray.values() - Web APIs
the xrinputsourcearray method values() returns a javascript iterator that can walk over the list of xrinputsource objects contained in the array, from first to last.
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourceEvent - Web APIs
because this is an event frame, not an animation frame, you cannot call the xrframe method getviewerpose() on it; instead, use getpose().
... methods the xrinputsourceevent interface doesn't define any methods; however, several methods are inherited from the parent interface, event.
XRSession.requestAnimationFrame() - Web APIs
the xrsession method requestanimationframe(), much like the window method of the same name, schedules a callback to be executed the next time the browser is ready to paint the session's virtual environment to the xr display.
... note: despite the obvious similarities between these methods and the global requestanimationframe() function provided by the window interface, you must not treat these as interchangeable.
XRSpace - Web APIs
WebAPIXRSpace
methods the xrspace interface provides no methods of its own.
... however, it inherits the methods of eventtarget, its parent interface.
XRSystem - Web APIs
WebAPIXRSystem
the webxr device api interface xrsystem provides methods which let you get access to an xrsession object representing a webxr session.
... methods in addition to inheriting methods from its parent interface, eventtarget, the xrsystem interface includes the following methods: issessionsupported() returns a promise which resolves to true if the browser supports the given xrsessionmode.
XRTargetRayMode - Web APIs
the webxr device api enumerated type xrtargetraymode describes the method by an input controller's targeting ray is being produced.
...the style of the ray is generally up to you, as is the method for indicating the endpoint of the ray.
Generating HTML - Web APIs
figure 3 : xsl stylesheet with 2 namespaces (example2.xsl) xsl stylesheet (example2.xsl): <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html"/> ...
... the final xslt stylesheet looks as follows: figure 6 : final xslt stylesheetview example | view source xsl stylesheet: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </style> </head> <body> <p class="mybox"> <span c...
msCachingEnabled - Web APIs
the mscachingenabled method gets the current caching state for an xmlhttprequest.
... this proprietary method is specific to internet explorer and microsoft edge.
msGetRegionContent - Web APIs
this proprietary method is specific to internet explorer browser.
...if an element is not a region, this method throws a domexception with the invalidaccesserror error code.
mssitemodejumplistitemremoved - Web APIs
this proprietary method is specific to internet explorer and microsoft edge.
... syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mssitemodejumplistitemremoved", handler, usecapture) general info synchronous no bubbles no cancelable no note this event is raised once for every item that has been removed since the last time mssitemodeshowjumplist was called.
msthumbnailclick - Web APIs
this proprietary method is specific to internet explorer and microsoft edge.
... syntax event property object.onmsthumbnailclick = handler; addeventlistener method object.addeventlistener("msthumbnailclick", handler, usecapture) general info synchronous no bubbles no cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut.
Architecture - Accessibility
to get around this problem, mozilla allows the magic value of -2 to be passed into accessibletext/accessiblehypertext methods that take a character offset.
...not only can this save extra calls, but it will always return the visual line of text when used with the gettext methods and line boundaries.
Web Accessibility: Understanding Colors and Luminance - Accessibility
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.
... (see the video, the photosensitive epilepsy analysis tool) measuring color & luminance methods that measures color exploring the rgb color space further, as it is the color space used by the data type <color>, note that there are actually multiple "versions" of the rgb color space, such as srgb, scrgb, and rgba.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
for other document types there may be other document methods for determining the language.
...note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document.
: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.
... syntax :scope examples identity match in this simple example, we demonstrate that using the :scope pseudo-class from the element.matches() method matches the element on which it's called.
@charset - CSS: Cascading Style Sheets
WebCSS@charset
as there are several ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the unicode byte-order character placed at the beginning of the file.
...this method is obsoleted in html5 and must not be used.
Box alignment in Flexbox - CSS: Cascading Style Sheets
the box alignment specification details how alignment works in various layout methods; on this page, we explore how box alignment works in the context of flexbox.
... as this page aims to detail things which are specific to flexbox and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods.
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
alignment and writing modes remember that with all of these alignment methods, the values of flex-start and flex-end are writing mode-aware.
... the box alignment module also includes other methods of creating space between items, such as the column-gap and row-gap feature as seen in css grid layout.
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
there is no method in flexbox to tell items in one row to line up with items in the row above — each flex line acts like a new flex container.
...in a one dimensional method like flexbox, we only control the row or column.
Ordering Flex Items - CSS: Cascading Style Sheets
new layout methods such as flexbox and grid bring with them the possibility of controlling the order of content.
...especially when using newer layout methods you should ensure that your browser testing includes testing the site using keyboard only, rather than a mouse or touchscreen.
Flow Layout and Overflow - CSS: Cascading Style Sheets
summary whether you are in continuous media on the web or in a paged media format such as print or epub, understanding how content overflows is useful when dealing with any layout method.
... by understanding how overflow works in normal flow, you should find it easier to understand the implications of overflow content in layout methods such as grid and flexbox.
In Flow and Out of Flow - CSS: Cascading Style Sheets
all elements that are in flow, will be laid out using this method.
...for this reason methods which remove elements from being in-flow should be used with understanding of the effect that they have.
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs.
... our new layout methods give us the ability to use these logical values to place items, however, as soon as we start to combine them with the physical properties used for margins and padding, we need to remember that those physical properties will not change according to writing mode.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
for more information about this interaction see the guide on the relationship of grid layout to other layout methods and the section on display: contents.
...many of the issues are similar to those raised regarding css flexbox, which also gives methods of reordering content with flex-direction and the order property.
Card - CSS: Cascading Style Sheets
useful fallbacks or alternative methods flexbox could be used to lay out the card, in which case you should make the content area grow, and other items not grow.
... see the columns recipe for demonstrations of each of these layout methods.
Cookbook template - CSS: Cascading Style Sheets
why did you choose a certain method?
... useful fallbacks or alternative methods if there are useful alternative methods for building the recipe, or fallback recipes to use if you have to support non-supporting browsers, include them in separate sections down here.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
this is a grouping method to select several matching elements.
...xt 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() ...
display - CSS: Cascading Style Sheets
WebCSSdisplay
the <display-legacy> methods allow the same results with single keyword values, and should be favoured by developers until the two keyword values are better supported.
...ine layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layout methods backwards compatibility of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and progressive e...
table-layout - CSS: Cascading Style Sheets
under the "fixed" layout method, the entire table can be rendered once the first table row has been downloaded and analyzed.
... this can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided.
Audio and Video Delivery - Developer guides
other tips for audio/video stopping the download of media while stopping the playback of media is as easy as calling the element's pause() method, the browser keeps downloading the media until the media element is disposed of through garbage collection.
... here's a trick that stops the download at once: var mediaelement = document.queryselector("#mymediaelementid"); mediaelement.removeattribute("src"); mediaelement.load(); by removing the media element's src attribute and invoking the load() method, you release the resources associated with the video, which stops the network download.
Rich-Text Editing in Mozilla - Developer guides
executing commands when an html document has been switched to designmode, the document object exposes the document.execcommand method which allows one to run commands to manipulate the contents of the editable region.
...ntlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</op...
Making content editable - Developer guides
</div> here's the above html in action: executing commands when an html element has contenteditable set to true, the document.execcommand() method is made available.
...ntlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</op...
Separate sites for mobile and desktop - Developer guides
since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also provides for the best performance out of any of the other options presented here.
...this factor aside, there is one case where this strategy really shines over other methods.
User input and controls - Developer guides
for devices providing a mouse/touchpad as a pointing method, the pointer lock api helps you in implementing a first person 3d game or other applications requiring full control of the pointing device.
...locking the screen orientation is made possible by invoking the screen.lockorientation method, while the screen.unlockorientation method removes all the previous screen locks that have been set.
Developer guides
parsing and serializing xml the web platform provides different methods of parsing and serializing xml, each with its pros and cons.
...the transmission is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to "multipart/form-data".
HTML attribute: accept - HTML: Hypertext Markup Language
for example, a file picker that needs content that can be presented as an image, including both standard image formats and pdf files, might look like this: <input type="file" accept="image/*,.pdf"> using file inputs a basic example <form method="post" enctype="multipart/form-data"> <div> <label for="file">choose file to upload</label> <input type="file" id="file" name="file" multiple> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces the following output: note: you can find this example on github too — see the source code, and also see it running live.
... let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } specifications specification status html living standardthe definition o...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
receiving and saving the image the code that handles the newly-downloaded image is found in the imagereceived() method: function imagereceived() { let canvas = document.createelement("canvas"); let context = canvas.getcontext("2d"); canvas.width = downloadedimg.width; canvas.height = downloadedimg.height; context.drawimage(downloadedimg, 0, 0); imagebox.appendchild(canvas); try { localstorage.setitem("saved-image-example", canvas.todataurl("image/png")); } catch(err) { console.log("e...
...the canvas method todataurl() is used to convert the image into a data:// url representing a png image, which is then saved into local storage using setitem().
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
the getstartdate() method can be used to determine the beginning point of the media timeline's reference frame.
... emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
allowfullscreen set to true if the <iframe> can activate fullscreen mode by calling the requestfullscreen() method.
...this can be used in the target attribute of the <a>, <form>, or <base> elements; the formtarget attribute of the <input> or <button> elements; or the windowname parameter in the window.open() method.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
if the alt attribute is purposefully left off because the image has no textual equivalent, consider alternate methods to present what the image is trying to communicate.
...if you have information that's particularly important or valuable for the user, present it inline using one of the methods mentioned above instead of using title.
<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.
...change", watchcolorpicker, false); function watchcolorpicker(event) { document.queryselectorall("p").foreach(function(p) { p.style.color = event.target.value; }); } selecting the value if the <input> element's implementation of the color type on the user's browser doesn't support a color well, but is instead a text field for entering the color string directly, you can use the select() method to select the text currently in the edit field.
<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 attribute contains a domstring whose value is the current contents of the text editing control being used to enter the password.
... <label for="pin">pin:</label> <input id="pin" type="password" inputmode="numeric" minlength="4" maxlength="8" size="8"> selecting text as with other textual entry controls, you can use the select() method to select all the text in the password field.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
methods select(), stepdown(), and stepup().
... using time inputs although among the date and time input types time has the widest browser support, it is not yet approaching universal, so it is likely that you'll need to provide an alternative method for entering the date and time, so that safari users (and users of other non-supporting browsers) can still easily enter time values.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
non-standard attributes methods the value of this attribute provides information about the functions that might be performed on an object.
...for example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
the getstartdate() method can be used to determine the beginning point of the media timeline's reference frame.
... emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
Compression in HTTP - HTTP
compression happens at three different levels: first some file formats are compressed with specific optimized methods, then general encryption can happen at the http level (the resource is transmitted compressed from end to end), and finally compression can be defined at the connection level, between two nodes of an http connection.
... to do this, http uses a mechanism similar to the content negotiation for end-to-end compression: the node transmitting the request advertizes its will using the te header and the other node chooses the adequate method, applies it, and indicates its choice with the transfer-encoding header.
Access-Control-Allow-Headers - HTTP
the preflight request is an options request which includes some combination of the three preflight request headers: access-control-request-method, access-control-request-headers, and origin, such as: options /resource/foo access-control-request-method: delete access-control-request-headers: origin, x-requested-with origin: https://foo.bar.org response if the server allows cors requests to use the delete method, it responds with an access-control-allow-methods response header, which lists delete along with the other methods it supports: ...
... http/1.1 200 ok content-length: 0 connection: keep-alive access-control-allow-origin: https://foo.bar.org access-control-allow-methods: post, get, options, delete access-control-max-age: 86400 if the requested method isn't supported, the server will respond with an error.
CSP: base-uri - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: child-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
CSP: connect-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: default-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: font-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
CSP: frame-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
CSP: img-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: manifest-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
CSP: media-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
CSP: object-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
CSP: prefetch-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: script-src-attr - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: script-src-elem - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: style-src-attr - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: style-src-elem - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method than using the unsafe-inline expression.
CSP: worker-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
...if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression.
If-Unmodified-Since - HTTP
the if-unmodified-since request http header makes the request conditional: the server will send back the requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date.
... there are two common use cases: in conjunction with non-safe methods, like post, it can be used to implement an optimistic concurrency control, like done by some wikis: editions are rejected if the stored document has been modified since the original has been retrieved.
DELETE - HTTP
WebHTTPMethodsDELETE
the http delete request method deletes the specified resource.
... request has body may successful response has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted.
HEAD - HTTP
WebHTTPMethodsHEAD
the http head method requests the headers that would be returned if the head request's url was instead requested with the http get method.
... a response to a head method should not have a body.
Network Error Logging - HTTP
http 400 (bad request) response { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dns in this report and no server_ip is available to include.
... { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 18, "method": "post", "phase": "dns", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "", "status_code": 0, "type": "dns.name_not_resolved", "url": "https://example-host.com/" } } the type of the network error may be one of the following pre-defined values from the specification, but browsers can add and send their own error types: dns.unreachable the user's dns server is unreachable dns.name_not_resolved the user's dns server responded but was unable to resolve an ip address for the requested uri.
Proxy servers and tunneling - HTTP
the http protocol specifies a request method called connect.
...note, however, that not all proxy servers support the connect method or limit it to port 443 only.
301 Moved Permanently - HTTP
WebHTTPStatus301
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there.
... it is therefore recommended to use the 301 code only as a response for get or head methods and to use the 308 permanent redirect for post methods instead, as the method change is explicitly prohibited with this status.
HTTP
WebHTTP
this article describes different methods of caching and how to use http headers to control them.
... http request methods the different operations that can be done with http: get, post, and also less common requests like options, delete, or trace.
Enumerability and ownership of properties - JavaScript
property enumerability and ownership - built-in methods of detection, retrieval, and iteration functionality own object own object and its prototype chain prototype chain only detection enumerable nonenumerable enumerable and nonenumerable propertyisenumerable hasownproperty hasownproperty – filtered to exc...
... detection can occur by simplepropertyretriever.thegetmethodyouwant(obj).indexof(prop) > -1 iteration can occur by simplepropertyretriever.thegetmethodyouwant(obj).foreach(function (value, prop) {}); (or use filter(), map(), etc.) var simplepropertyretriever = { getownenumerables: function(obj) { return this._getpropertynames(obj, true, false, this._enumerable); // or could use for..in filtered with hasownproperty or just this: retu...
Concurrency model and the event loop - JavaScript
two distinct runtimes can only communicate through sending messages via the postmessage method.
... this method adds a message to the other runtime if the latter listens to message events.
JavaScript technologies overview - JavaScript
a prototype-based inheritance mechanism built-in objects and functions (json, math, array.prototype methods, object introspection methods, etc.) strict mode browser support as of october 2016, the current versions of the major web browsers implement ecmascript 5.1 and ecmascript 2015, but older versions (still in use) implement ecmascript 5 only.
...objects in the dom tree may be addressed and manipulated by using methods on the objects.
RangeError: radix must be an integer - JavaScript
the javascript exception "radix must be an integer at least 2 and no greater than 36" occurs when the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified and is not between 2 and 36.
... the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified.
TypeError: X.prototype.y called on incompatible type - JavaScript
message typeerror: 'this' is not a set object (edge) typeerror: function.prototype.tostring called on incompatible object (firefox) typeerror: function.prototype.bind called on incompatible target (firefox) typeerror: method set.prototype.add called on incompatible receiver undefined (chrome) typeerror: bind must be called on a function (chrome) error type typeerror what went wrong?
... this issue can arise when using the function.prototype.call() or function.prototype.apply() methods, and providing a this argument which does not have the expected type.
Warning: expression closures are deprecated - JavaScript
examples deprecated syntax expression closures omit curly braces or return statements from function declarations or from method definitions in objects.
... var x = function() { return 1; } var obj = { count: function() { return 1; } }; standard syntax using arrow functions alternatively, you can use arrow functions: var x = () => 1; standard syntax using shorthand method syntax expression closures can also be found with getter and setter, like this: var obj = { get x() 1, set x(v) this.v = v }; with es2015 method definitions, this can be converted to: var obj = { get x() { return 1 }, set x(v) { this.v = v } }; ...
RangeError: repeat count must be non-negative - JavaScript
the javascript exception "repeat count must be non-negative" occurs when the string.prototype.repeat() method is used with a count argument that is a negative number.
... the string.prototype.repeat() method has been used.
TypeError: "x" is not a constructor - JavaScript
however, some global objects are not and their properties and methods are static.
... this is not legal (the promise constructor is not being called correctly) and will throw a typeerror: this is not a constructor exception: return new promise.resolve(true); instead, use the promise.resolve() or promise.reject() static methods: // this is legal, but unnecessarily long: return new promise((resolve, reject) => { resolve(true); }) // instead, return the static method: return promise.resolve(true); return promise.reject(false); ...
RangeError: precision is out of range - JavaScript
there was an out of range precision argument in one of these methods: number.prototype.toexponential() number.prototype.tofixed() number.prototype.toprecision() the allowed range for these methods is usually between 0 and 20 (or 21).
... method firefox (spidermonkey) chrome, opera (v8) number.prototype.toexponential() 0 to 100 0 to 20 number.prototype.tofixed() -20 to 100 0 to 20 number.prototype.toprecision() 1 to 100 1 to 21 examples invalid cases 77.1234.toexponential(-1); // rangeerror 77.1234.toexponential(101); // rangeerror 2.34.tofixed(-100); // rangeerror 2.34.tofixed(1001); // rangeerror 1234.5.toprecision(-1); // rangeerror 1234.5.toprecision(101); // rangeerror valid cases 77.1234.toexponential(4); // 7.7123e+1 77.1234.toexponential(2); // 7.71e+1 2.34.tofixed(1); // 2.3 2.35.tofixed(1); // 2.4 (note that it rounds up in this case) 5.123456.toprec...
RangeError: repeat count must be less than infinity - JavaScript
the javascript exception "repeat count must be less than infinity" occurs when the string.prototype.repeat() method is used with a count argument that is infinity.
... the string.prototype.repeat() method has been used.
TypeError: "x" is (not) "y" - JavaScript
also, certain methods, such as object.create() or symbol.keyfor(), require a specific type, that must be provided.
... examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // typeerror: foo is undefined var foo = null; foo.substring(1); // typeerror: foo is null // certain methods might require a specific type var foo = {} symbol.keyfor(foo); // typeerror: foo is not a symbol var foo = 'bar' object.create(foo); // typeerror: "foo" is not an object or null fixing the issue to fix null pointer to undefined values, you can use the typeof operator, for example.
getter - JavaScript
description sometimes it is desirable to allow access to a property that returns a dynamically computed value, or you may want to reflect the status of an internal variable without requiring the use of explicit method calls.
...e.log(obj.hello); // "world" console.log(object.getownpropertydescriptor(obj, 'hello')); // undefined console.log( object.getownpropertydescriptor( object.getprototypeof(obj), 'hello' ) ); // { configurable: true, enumerable: false, get: function get hello() { return 'world'; }, set: undefined } specifications specification ecmascript (ecma-262)the definition of 'method definitions' in that specification.
Array.prototype[@@iterator]() - JavaScript
the @@iterator method is part of the iterable protocol, that defines how to synchronously iterate over a sequence of values.
...if you have a function that takes an iterator and then iterate over the value, but don't know if that object is going to have a [iterable].prototype.values method.
Array.prototype.filter() - JavaScript
the filter() method creates a new array with all elements that pass the test implemented by the provided function.
...h criteria (query) */ const filteritems = (arr, query) => { return arr.filter(el => el.tolowercase().indexof(query.tolowercase()) !== -1) } console.log(filteritems(fruits, 'ap')) // ['apple', 'grapes'] console.log(filteritems(fruits, 'an')) // ['banana', 'mango', 'orange'] affecting initial array (modifying, appending and deleting) the following examples tests the behavior of the filter method when the array is modified.
Array.prototype.flat() - JavaScript
the flat() method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.
...4500 examples flattening nested arrays const arr1 = [1, 2, [3, 4]]; arr1.flat(); // [1, 2, 3, 4] const arr2 = [1, 2, [3, 4, [5, 6]]]; arr2.flat(); // [1, 2, 3, 4, [5, 6]] const arr3 = [1, 2, [3, 4, [5, 6]]]; arr3.flat(2); // [1, 2, 3, 4, 5, 6] const arr4 = [1, 2, [3, 4, [5, 6, [7, 8, [9, 10]]]]]; arr4.flat(infinity); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] flattening and array holes the flat method removes empty slots in arrays: const arr5 = [1, 2, , 4, 5]; arr5.flat(); // [1, 2, 4, 5] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.flat' in that specification.
Array.prototype.sort() - JavaScript
the sort() method sorts the elements of an array in place and returns the sorted array.
...the following function will sort the array in ascending order (if it doesn't contain infinity and nan): function comparenumbers(a, b) { return a - b; } the sort method can be conveniently used with function expressions: var numbers = [4, 2, 5, 1, 3]; numbers.sort(function(a, b) { return a - b; }); console.log(numbers); // [1, 2, 3, 4, 5] es2015 provides arrow function expressions with even shorter syntax.
Array.prototype.splice() - JavaScript
the splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
...in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided.
ArrayBuffer.prototype.slice() - JavaScript
the slice() method returns a new arraybuffer whose contents are a copy of this arraybuffer's bytes from begin, inclusive, up to end, exclusive.
... description the slice() method copies up to, but not including, the byte indicated by the end parameter.
ArrayBuffer - JavaScript
static methods arraybuffer.isview(arg) returns true if arg is one of the arraybuffer views, such as typed array objects or a dataview.
... instance methods arraybuffer.prototype.slice() returns a new arraybuffer whose contents are a copy of this arraybuffer's bytes from begin (inclusive) up to end (exclusive).
BigInt.asIntN() - JavaScript
the bigint.asintn static method is used to wrap a bigint value to a signed integer between -2width-1 and 2width-1-1.
... examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic.
BigInt.asUintN() - JavaScript
the bigint.asuintn static method is used to wrap a bigint value to an unsigned integer between 0 and 2width-1.
... examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic.
BigInt64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
BigUint64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
DataView.prototype.getBigInt64() - JavaScript
the getbigint64() method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the dataview.
... examples using the getbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbigint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbigint64()' in that specification.
DataView.prototype.getBigUint64() - JavaScript
the getbiguint64() method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the dataview.
... examples using the getbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbiguint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getbiguint64()' in that specification.
DataView.prototype.getFloat32() - JavaScript
the getfloat32() method gets a signed 32-bit float (float) at the specified byte offset from the start of the dataview.
... examples using the getfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getfloat32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getfloat32' in that specification.
DataView.prototype.getFloat64() - JavaScript
the getfloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the dataview.
... examples using the getfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getfloat64(0); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getfloat64' in that specification.
DataView.prototype.getInt16() - JavaScript
the getint16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the dataview.
... examples using the getint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint16' in that specification.
DataView.prototype.getInt32() - JavaScript
the getint32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the dataview.
... examples using the getint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint32' in that specification.
DataView.prototype.getInt8() - JavaScript
the getint8() method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the dataview.
... examples using the getint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getint8' in that specification.
DataView.prototype.getUint16() - JavaScript
the getuint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the dataview.
... examples using the getuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint16' in that specification.
DataView.prototype.getUint32() - JavaScript
the getuint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the dataview.
... examples using the getuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint32' in that specification.
DataView.prototype.getUint8() - JavaScript
the getuint8() method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the dataview.
... examples using the getuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.getuint8' in that specification.
DataView.prototype.setBigInt64() - JavaScript
the setbigint64() method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the dataview.
... examples using the setbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbigint64(0, 3n); dataview.getbigint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setbigint64()' in that specification.
DataView.prototype.setBigUint64() - JavaScript
the setbiguint64() method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the dataview.
... examples using the setbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbiguint64(0, 3n); dataview.getbiguint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setbiguint64()' in that specification.
DataView.prototype.setFloat32() - JavaScript
the setfloat32() method stores a signed 32-bit float (float) value at the specified byte offset from the start of the dataview.
... examples using the setfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat32(1, 3); dataview.getfloat32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setfloat32' in that specification.
DataView.prototype.setFloat64() - JavaScript
the setfloat64() method stores a signed 64-bit float (double) value at the specified byte offset from the start of the dataview.
... examples using the setfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat64(0, 3); dataview.getfloat64(0); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setfloat64' in that specification.
DataView.prototype.setInt16() - JavaScript
the setint16() method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the dataview.
... examples using the setint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint16(1, 3); dataview.getint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setint16' in that specification.
DataView.prototype.setInt32() - JavaScript
the setint32() method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the dataview.
... examples using the setint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint32(1, 3); dataview.getint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setint32' in that specification.
DataView.prototype.setInt8() - JavaScript
the setint8() method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... examples using the setint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint8(1, 3); dataview.getint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setint8' in that specification.
DataView.prototype.setUint16() - JavaScript
the setuint16() method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the dataview.
... examples using the setuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint16(1, 3); dataview.getuint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setuint16' in that specification.
DataView.prototype.setUint32() - JavaScript
the setuint32() method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the dataview.
... examples using the setuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint32(1, 3); dataview.getuint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setuint32' in that specification.
DataView.prototype.setUint8() - JavaScript
the setuint8() method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... examples using the setuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint8(1, 3); dataview.getuint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.setuint8' in that specification.
Date.prototype.getDay() - JavaScript
the getday() method returns the day of the week for the specified date according to local time, where 0 represents sunday.
...using this method, the internationalization is made easier: var options = { weekday: 'long'}; console.log(new intl.datetimeformat('en-us', options).format(xmas95)); // monday console.log(new intl.datetimeformat('de-de', options).format(xmas95)); // montag specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getday' in that specification.
Date.prototype.getFullYear() - JavaScript
the getfullyear() method returns the year of the specified date according to local time.
... use this method instead of the getyear() method.
Date.prototype.getMonth() - JavaScript
the getmonth() method returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year).
...using this method, internationalization is made easier: var options = { month: 'long'}; console.log(new intl.datetimeformat('en-us', options).format(xmas95)); // december console.log(new intl.datetimeformat('de-de', options).format(xmas95)); // dezember specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getmonth' in that specification.
Date.prototype.setFullYear() - JavaScript
the setfullyear() method sets the full year for a specified date according to local time.
... description if you do not specify the monthvalue and datevalue parameters, the values returned from the getmonth() and getdate() methods are used.
Date.prototype.setHours() - JavaScript
the sethours() method sets the hours for a specified date according to local time, and returns the number of milliseconds since january 1, 1970 00:00:00 utc until the time represented by the updated date instance.
... description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used.
Date.prototype.setMinutes() - JavaScript
the setminutes() method sets the minutes for a specified date according to local time.
... description if you do not specify the secondsvalue and msvalue parameters, the values returned from getseconds() and getmilliseconds() methods are used.
Date.prototype.setSeconds() - JavaScript
the setseconds() method sets the seconds for a specified date according to local time.
... description if you do not specify the msvalue parameter, the value returned from the getmilliseconds() method is used.
Date.prototype.setTime() - JavaScript
the settime() method sets the date object to the time represented by a number of milliseconds since january 1, 1970, 00:00:00 utc.
... description use the settime() method to help assign a date and time to another date object.
Date.prototype.setUTCFullYear() - JavaScript
the setutcfullyear() method sets the full year for a specified date according to universal time.
... description if you do not specify the monthvalue and dayvalue parameters, the values returned from the getutcmonth() and getutcdate() methods are used.
Date.prototype.setUTCHours() - JavaScript
the setutchours() method sets the hour for a specified date according to universal time, and returns the number of milliseconds since january 1, 1970 00:00:00 utc until the time represented by the updated date instance.
... description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getutcminutes(), getutcseconds(), and getutcmilliseconds() methods are used.
Date.prototype.setUTCMinutes() - JavaScript
the setutcminutes() method sets the minutes for a specified date according to universal time.
... description if you do not specify the secondsvalue and msvalue parameters, the values returned from getutcseconds() and getutcmilliseconds() methods are used.
Date.prototype.setUTCMonth() - JavaScript
the setutcmonth() method sets the month for a specified date according to universal time.
... description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used.
Date.prototype.setUTCSeconds() - JavaScript
the setutcseconds() method sets the seconds for a specified date according to universal time.
... description if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used.
Date.prototype.setYear() - JavaScript
the setyear() method sets the year for a specified date according to local time.
... because setyear() does not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setfullyear() method.
Date.prototype.toGMTString() - JavaScript
the togmtstring() method converts a date to a string, using internet greenwich mean time (gmt) conventions.
... examples simple example in this example, the togmtstring() method converts the date to gmt (utc) using the operating system's time-zone offset and returns a string value that is similar to the following form.
Date.prototype.toJSON() - JavaScript
the tojson() method returns a string representation of the date object.
...this method is generally intended to, by default, usefully serialize date objects during json serialization.
Error.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified error object.
... description the error object overrides the object.prototype.tostring() method inherited by all objects.
FinalizationRegistry.prototype.register() - JavaScript
the register() method registers an object with a finalizationregistry instance so that if the object is garbage-collected, the registry's callback may get called.
... unregistertoken optional a token that may be used with the unregister method later to unregister the target object.
Float32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Float64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Function.displayName - JavaScript
the display name of a function: function dosomething() {} console.log(dosomething.displayname); // "undefined" var popup = function(content) { console.log(content); }; popup.displayname = 'show popup'; console.log(popup.displayname); // "show popup" defining a displayname in function expressions you can define a function with a display name in a function expression: var object = { somemethod: function() {} }; object.somemethod.displayname = 'somemethod'; console.log(object.somemethod.displayname); // logs "somemethod" try { somemethod } catch(e) { console.log(e); } // referenceerror: somemethod is not defined changing displayname dynamically you can dynamically change the displayname of a function: var object = { // anonymous somemethod: function(value) { arguments.cal...
...lee.displayname = 'somemethod (' + value + ')'; } }; console.log(object.somemethod.displayname); // "undefined" object.somemethod('123') console.log(object.somemethod.displayname); // "somemethod (123)" specifications not part of any standard.
Function.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... this method is usually called internally by javascript and not explicitly in code.
Function - JavaScript
instance methods function.prototype.apply(thisarg [, argsarray]) calls a function and sets its this to the provided thisarg.
... overrides the object.prototype.tostring method.
Generator.prototype.return() - JavaScript
the return() method returns the given value and finishes the generator.
... examples using return() the following example shows a simple generator and the return method.
Generator.prototype.throw() - JavaScript
the throw() method resumes the execution of a generator by throwing an error into it and returns an object with two properties done and value.
... examples using throw() the following example shows a simple generator and an error that is thrown using the throw method.
Int16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Int32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Int8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Intl.Collator.prototype.resolvedOptions() - JavaScript
the intl.collator.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and collation options computed during initialization of this collator object.
... examples using the resolvedoptions method var de = new intl.collator('de', { sensitivity: 'base' }) var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de" usedoptions.usage; // "sort" usedoptions.sensitivity; // "base" usedoptions.ignorepunctuation; // false usedoptions.collation; // "default" usedoptions.numeric; // false specifications specification ecma...
Intl.Collator - JavaScript
static methods intl.collator.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.collator.prototype.compare getter function that compares two strings according to the sort order of this intl.collator object.
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
the intl.datetimeformat.prototype.formatrangetoparts() method allows locale-specific tokens representing each part of the formatted date range produced by datetimeformat formatters.
... syntax intl.datetimeformat.prototype.formatrangetoparts(startdate, enddate) examples basic formatrangetoparts usage this method receives two dates and returns an array of objects containing the locale-specific tokens representing each part of the formatted date range.
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.datetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this datetimeformat object.
... examples using the resolvedoptions method var germanfakeregion = new intl.datetimeformat('de-xx', { timezone: 'utc' }); var usedoptions = germanfakeregion.resolvedoptions(); usedoptions.locale; // "de" usedoptions.calendar; // "gregory" usedoptions.numberingsystem; // "latn" usedoptions.timezone; // "utc" usedoptions.month; // "numeric" specifications specification ecmascript intern...
Intl.DisplayNames.prototype.of() - JavaScript
the of() method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames.
... examples using the of method let regionnames = new intl.displaynames(['en'], {type: 'region'}); regionnames.of('419'); // "latin america" let languagenames = new intl.displaynames(['en'], {type: 'language'}); languagenames.of('fr'); // "french" let currencynames = new intl.displaynames(['en'], {type: 'currency'}); currencynames.of('eur'); // "euro" specifications specification intl.displaynamesth...
Intl.DisplayNames - JavaScript
static methods intl.displaynames.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames.
Intl​.ListFormat.prototype​.format() - JavaScript
the format() method returns a string with a language-specific representation of the list.
... syntax listformat.format([list]); parameters list an iterable object, such as an array return value a language-specific formatted string representing the elements of the list description the format() method returns a string that has been formatted based on parameters provided in the intl.listformat object.
Intl.ListFormat - JavaScript
static methods intl.listformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.listformat.prototype.format() returns a language-specific formatted string representing the elements of the list.
Intl.Locale.prototype.toString() - JavaScript
calling the tostring method on a locale object will return the identifier string for that particular locale.
... the tostring method allows locale instances to be provided as an argument to existing intl constructors, serialized in json, or any other context where an exact string representation is useful.
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
the intl.numberformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and number formatting options computed during initialization of this numberformat object.
... examples using the resolvedoptions method var de = new intl.numberformat('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.numberingsystem; // "latn" usedoptions.notation; // "standard" usedoptions.signdisplay; // "auto" usedoption.style; // "decimal" usedoptions.minimumintegerdigits; // 1 usedoptions.minimumfractiondigits; // 0 use...
Intl.NumberFormat - JavaScript
static methods intl.numberformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.numberformat.prototype.format() getter function that formats a number according to the locale and formatting options of this numberformat object.
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
the intl.pluralrules.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and plural formatting options computed during initialization of this pluralrules object.
... examples using the resolvedoptions method var de = new intl.pluralrules('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.maximumfractiondigits; // 3 usedoptions.minimumfractiondigits; // 0 usedoptions.minimumintegerdigits; // 1 usedoptions.pluralcategories; // array [ "one", "other" ] usedoptions.type; // "cardinal" specifications specificatio...
Intl.PluralRules - JavaScript
static methods intl.pluralrules.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
the intl.relativetimeformat.prototype.formattoparts() method returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
... description the intl.relativetimeformat.prototype.formattoparts method is a version of the format method which it returns an array of objects which represent "parts" of the object, separating the formatted number into its consituent parts and separating it from other surrounding text.
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.relativetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this relativetimeformat object.
... examples using the resolvedoptions method var de = new intl.relativetimeformat('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.style; // "long" usedoptions.numeric; // "always" usedoptions.numberingsystem; // "latn" specifications specification status comment ecmascript internationalization api (ecma-402)the definition of 'relativetimefor...
Intl.RelativeTimeFormat - JavaScript
static methods intl.relativetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
... instance methods intl.relativetimeformat.prototype.format() formats a value and a unit according to the locale and formatting options of the given intl.relativetimeformat object.
Intl - JavaScript
static methods intl.getcanonicallocales() returns canonical locale names.
... locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying locales and determining the one they will actually use: they all accept locales and options arguments, and negotiate the requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property.
Map.prototype.forEach() - JavaScript
the foreach() method executes a provided function once per each key/value pair in the map object, in insertion order.
... description the foreach method executes the provided callback once for each key of the map which actually exist.
Map.prototype.set() - JavaScript
the set() method adds or updates an element with a specified key and a value to a map object.
... examples using set() let mymap = new map() // add new elements to the map mymap.set('bar', 'foo') mymap.set(1, 'foobar') // update an element in the map mymap.set('bar', 'baz') using the set() with chaining since the set() method returns back the same map object, you can chain the method call like below: // add new elements to the map with chaining.
Math.acos() - JavaScript
description the math.acos() method returns a numeric value between 0 and π radians for x between -1 and 1.
... because acos() is a static method of math, you always use it as math.acos(), rather than as a method of a math object you created (math is not a constructor).
Math.asin() - JavaScript
description the math.asin() method returns a numeric value between -π2-\frac{\pi}{2} and π2\frac{\pi}{2} radians for x between -1 and 1.
... because asin() is a static method of math, you always use it as math.asin(), rather than as a method of a math object you created (math is not a constructor).
Math.atan() - JavaScript
description the math.atan() method returns a numeric value between -π2-\frac{\pi}{2} and π2\frac{\pi}{2} radians.
... because atan() is a static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor).
Math.atan2() - JavaScript
description the math.atan2() method returns a numeric value between -π and π representing the angle theta of an (x, y) point.
... because atan2() is a static method of math, you always use it as math.atan2(), rather than as a method of a math object you created (math is not a constructor).
Math.clz32() - JavaScript
var counttrailsmethods = (function(stdlib, foreign, heap) { "use asm"; var clz = stdlib.math.clz32; function ctrz(integer) { // count trailing zeros integer = integer | 0; // coerce to an integer // 1.
...now, inversing the bits reveals the lowest bits return 32 - clz(~integer) |0; } function ctron(integer) { // count trailing ones integer = integer | 0; // coerce to an integer return ctrz(~integer) |0; } // unfourtunately, asm.js demands slow crummy objects: return {a: ctrz, b: ctron}; })(window, null, null); var ctrz = counttrailsmethods.a; var ctron = counttrailsmethods.b; polyfill the following polyfill is the most efficient.
Math.cos() - JavaScript
description the math.cos() method returns a numeric value between -1 and 1, which represents the cosine of the angle.
... because cos() is a static method of math, you always use it as math.cos(), rather than as a method of a math object you created (math is not a constructor).
Math.sin() - JavaScript
description the math.sin() method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians.
... because sin() is a static method of math, you always use it as math.sin(), rather than as a method of a math object you created (math is not a constructor).
Math.tan() - JavaScript
description the math.tan() method returns a numeric value that represents the tangent of the angle.
... because tan() is a static method of math, you always use it as math.tan(), rather than as a method of a math object you created (math is not a constructor).
Number.isFinite() - JavaScript
the number.isfinite() method determines whether the passed value is a finite number.
... description in comparison to the global isfinite() function, this method doesn't forcibly convert the parameter to a number.
Number.isInteger() - JavaScript
the number.isinteger() method determines whether the passed value is an integer.
...the method will also return true for floating point numbers that can be represented as integer.
Number.parseFloat() - JavaScript
the number.parsefloat() method parses an argument and returns a floating point number.
... polyfill if (number.parsefloat === undefined) { number.parsefloat = parsefloat; } examples number.parsefloat vs parsefloat this method has the same functionality as the global parsefloat() function: number.parsefloat === parsefloat; // true this method is also part of ecmascript 2015.
Number.parseInt() - JavaScript
the number.parseint() method parses a string argument and returns an integer of the specified radix or base.
... polyfill if (number.parseint === undefined) { number.parseint = window.parseint } examples number.parseint vs parseint this method has the same functionality as the global parseint() function: number.parseint === parseint // true and is part of ecmascript 2015 (its purpose is modularization of globals).
Number.prototype.toPrecision() - JavaScript
the toprecision() method returns a string representing the number object to the specified precision.
...see the discussion of rounding in the description of the number.prototype.tofixed() method, which also applies to toprecision().
Number.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... this method is usually called internally by javascript and not explicitly in web code.
Number.prototype.valueOf() - JavaScript
the valueof() method returns the wrapped primitive value of a number object.
... description this method is usually called internally by javascript and not explicitly in web code.
Object.prototype.__defineGetter__() - JavaScript
this method should not be used since better alternatives exist.
... the __definegetter__ method binds an object's property to a function to be called when that property is looked up.
Object.prototype.__defineSetter__() - JavaScript
the __definesetter__ method binds an object's property to a function to be called when an attempt is made to set that property.
... description the __definesetter__ method allows a setter to be defined on a pre-existing object.
Object.prototype.constructor - JavaScript
*/ } parent.prototype.parentmethod = function parentmethod() {} function child() { parent.call(this) // make sure everything is initialized properly } child.prototype = object.create(parent.prototype) // re-define child prototype to parent prototype child.prototype.constructor = child // return original constructor to child but when do we need to perform the last line here?
... take the following case: the object has the create() method to create itself.
Object.freeze() - JavaScript
the object.freeze() method freezes an object.
... in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.isExtensible() - JavaScript
the object.isextensible() method determines if an object is extensible (whether it can have new properties added to it).
...var frozen = object.freeze({}); object.isextensible(frozen); // === false non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.isSealed() - JavaScript
the object.issealed() method determines if an object is sealed.
...object.isfrozen(sealed); // === true // (all properties also non-writable) var s2 = object.seal({ p: 3 }); object.isfrozen(s2); // === false // ('p' is still writable) var s3 = object.seal({ get p() { return 0; } }); object.isfrozen(s3); // === true // (only configurability matters for accessor properties) non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.keys() - JavaScript
the object.keys() method returns an array of a given object's own enumerable property names, iterated in the same order that a normal loop would.
... non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.seal() - JavaScript
the object.seal() method seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable.
...object.defineproperty(obj, 'ohai', { value: 17 }); // throws a typeerror object.defineproperty(obj, 'foo', { value: 'eit' }); // changes existing property value non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.setPrototypeOf() - JavaScript
the object.setprototypeof() method sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or null.
...otherwise, this method changes the [[prototype]] of obj to the new value.
Promise.reject() - JavaScript
the promise.reject() method returns a promise object that is rejected with a given reason.
... examples using the static promise.reject() method promise.reject(new error('fail')).then(function() { // not called }, function(error) { console.error(error); // stacktrace }); specifications specification ecmascript (ecma-262)the definition of 'promise.reject' in that specification.
Reflect.apply() - JavaScript
the static reflect.apply() method calls a target function with arguments as specified.
... description in es5, you typically use the function.prototype.apply() method to call a function with a given this value and arguments provided as an array (or an array-like object).
Reflect.defineProperty() - JavaScript
the static reflect.defineproperty() method is like object.defineproperty() but returns a boolean.
... description the reflect.defineproperty method allows precise addition to or modification of a property on an object.
Reflect.deleteProperty() - JavaScript
the static reflect.deleteproperty() method allows to delete properties.
... description the reflect.deleteproperty method allows you to delete a property on an object.
Reflect.get() - JavaScript
the static reflect.get() method works like getting a property from an object (target[propertykey]) as a function.
... description the reflect.get method allows you to get a property on an object.
Reflect.getPrototypeOf() - JavaScript
the static reflect.getprototypeof() method is almost the same method as object.getprototypeof().
... description the reflect.getprototypeof method returns the prototype (i.e.
Reflect.ownKeys() - JavaScript
the static reflect.ownkeys() method returns an array of the target object's own property keys.
... description the reflect.ownkeys method returns an array of the target object's own property keys.
Reflect.set() - JavaScript
the static reflect.set() method works like setting a property on an object.
... description the reflect.set method allows you to set a property on an object.
Reflect.setPrototypeOf() - JavaScript
the static reflect.setprototypeof() method is the same method as object.setprototypeof(), except for its return type.
... description the reflect.setprototypeof method changes the prototype (i.e.
RegExp.prototype.compile() - JavaScript
the deprecated compile() method is used to (re-)compile a regular expression during execution of a script.
... description the compile method is deprecated.
RegExp.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... this method is usually called internally by javascript and not explicitly in web code.
Set.prototype.add() - JavaScript
the add() method appends a new element with a specified value to the end of a set object.
... examples using the add method var myset = new set(); myset.add(1); myset.add(5).add('some text'); // chainable console.log(myset); // set [1, 5, "some text"] specifications specification ecmascript (ecma-262)the definition of 'set.prototype.add' in that specification.
Set.prototype.clear() - JavaScript
the clear() method removes all elements from a set object.
... examples using the clear method var myset = new set(); myset.add(1); myset.add('foo'); myset.size; // 2 myset.has('foo'); // true myset.clear(); myset.size; // 0 myset.has('bar') // false specifications specification ecmascript (ecma-262)the definition of 'set.prototype.clear' in that specification.
Set.prototype.delete() - JavaScript
the delete() method removes the specified element from a set object.
... examples using the delete() method const myset = new set(); myset.add('foo'); myset.delete('bar'); // returns false.
Set.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified value exists in a set object or not.
... examples using the has method var myset = new set(); myset.add('foo'); myset.has('foo'); // returns true myset.has('bar'); // returns false var set1 = new set(); var obj1 = {'key1': 1}; set1.add(obj1); set1.has(obj1); // returns true set1.has({'key1': 1}); // returns false because they are different object references set1.add({'key1': 1}); // now set1 contains 2 entries specifications specification ...
Set.prototype.values() - JavaScript
the values() method returns a new iterator object that contains the values for each element in the set object in insertion order.
... the keys() method is an alias for this method (for similarity with map objects); it behaves exactly the same and returns values of set elements.
SharedArrayBuffer.prototype.slice() - JavaScript
the sharedarraybuffer.prototype.slice() method returns a new sharedarraybuffer whose contents are a copy of this sharedarraybuffer's bytes from begin, inclusive, up to end, exclusive.
...this method has the same algorithm as array.prototype.slice().
String.prototype.charCodeAt() - JavaScript
the charcodeat() method returns an integer between 0 and 65535 representing the utf-16 code unit at the given index.
... backward compatibility: in historic versions (like javascript 1.2) the charcodeat() method returns a number indicating the iso-latin-1 codeset value of the character at the given index.
String.prototype.concat() - JavaScript
the concat() method concatenates the string arguments to the calling string and returns a new string.
... performance it is strongly recommended that the assignment operators (+, +=) are used instead of the concat() method.
String.prototype.fontcolor() - JavaScript
the fontcolor() method creates a <font> html element that causes a string to be displayed in the specified font color.
... examples using fontcolor() the following example uses the fontcolor() method to change the color of a string by producing a string with the html <font> tag.
String.prototype.fontsize() - JavaScript
the fontsize() method creates a <font> html element that causes a string to be displayed in the specified font size.
... examples using fontsize() the following example uses string methods to change the size of a string: var worldstring = 'hello, world'; console.log(worldstring.small()); // <small>hello, world</small> console.log(worldstring.big()); // <big>hello, world</big> console.log(worldstring.fontsize(7)); // <font size="7">hello, world</fontsize> with the element.style object you can get the element's style attribute and manipulate it more generically, for ex...
String.prototype.lastIndexOf() - JavaScript
the lastindexof() method returns the index within the calling string object of the last occurrence of the specified value, searching backwards from fromindex.
... case-sensitivity the lastindexof() method is case sensitive.
String.prototype.normalize() - JavaScript
the normalize() method returns the unicode normalization form of the string.
... let string1 = '\u00f1'; // ñ let string2 = '\u006e\u0303'; // ñ console.log(string1 === string2); // false console.log(string1.length); // 1 console.log(string2.length); // 2 the normalize() method helps solve this problem by converting a string into a normalized form common for all sequences of code points that represent the same characters.
String.prototype.search() - JavaScript
the search() method executes a search for a match between a regular expression and this string object.
...(if you only want to know if it exists, use the similar test() method on the regexp prototype, which returns a boolean.) for more information (but slower execution) use match() (similar to the regular expression exec() method).
String.prototype.split() - JavaScript
the split() method divides a string into an ordered list of substrings, puts these substrings into an array, and returns the array.
... the division is done by searching for a pattern; where the pattern is provided as the first parameter in the method's call.
String.prototype.substr() - JavaScript
the substr() method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards.
...lowing code: // only run when the substr() function is broken if ('ab'.substr(-1) != 'b') { /** * get the substring of a string * @param {integer} start where to start the substring * @param {integer} length how many characters to return * @return {string} */ string.prototype.substr = function(substr) { return function(start, length) { // call the original method return substr.call(this, // did we get a negative start, calculate how much it is from the beginning of the string // adjust the start parameter for negative value start < 0 ?
String.prototype.toLocaleLowerCase() - JavaScript
the tolocalelowercase() method returns the calling string value converted to lower case, according to any locale-specific case mappings.
... description the tolocalelowercase() method returns the value of the string converted to lower case according to any locale-specific case mappings.
String.prototype.toLocaleUpperCase() - JavaScript
the tolocaleuppercase() method returns the calling string value converted to upper case, according to any locale-specific case mappings.
... description the tolocaleuppercase() method returns the value of the string converted to upper case according to any locale-specific case mappings.
String.prototype.toLowerCase() - JavaScript
the tolowercase() method returns the calling string value converted to lower case.
... description the tolowercase() method returns the value of the string converted to lower case.
String.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... this method is usually called internally by javascript and not explicitly in web code.
String.prototype.trim() - JavaScript
the trim() method removes whitespace from both ends of a string.
... description the trim() method returns the string stripped of whitespace from both ends.
Symbol.matchAll - JavaScript
this function is called by the string.prototype.matchall() method.
...the following two examples return same result: 'abc'.matchall(/a/); /a/[symbol.matchall]('abc'); this method exists for customizing match behavior within regexp subclasses.
Symbol.replace - JavaScript
the symbol.replace well-known symbol specifies the method that replaces matched substrings of a string.
... this function is called by the string.prototype.replace() method.
Symbol.search - JavaScript
the symbol.search well-known symbol specifies the method that returns the index within a string that matches the regular expression.
... this function is called by the string.prototype.search() method.
Symbol.split - JavaScript
the symbol.split well-known symbol specifies the method that splits a string at the indices that match a regular expression.
... this function is called by the string.prototype.split() method.
Symbol.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... this method is usually called internally by javascript.
TypedArray.prototype.copyWithin() - JavaScript
the copywithin() method copies the sequence of array elements within the array to the position starting at target.
...this method has the same algorithm as array.prototype.copywithin.
TypedArray.prototype.includes() - JavaScript
the includes() method determines whether a typed array includes a certain element, returning true or false as appropriate.
... this method has the same algorithm as array.prototype.includes().
TypedArray.of() - JavaScript
the typedarray.of() method creates a new typed array from a variable number of arguments.
... this method is nearly the same as array.of().
TypedArray.prototype.reverse() - JavaScript
the reverse() method reverses a typed array in place.
...this method has the same algorithm as array.prototype.reverse().
TypedArray.prototype.subarray() - JavaScript
the subarray() method returns a new typedarray on the same arraybuffer store and with the same element types as for this typedarray object.
... examples using the subarray method var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] var sub = uint8.subarray(0,4); console.log(sub); // uint8array [ 1, 2, 3, 0 ] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.subarray' in that specification.
TypedArray.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the typed array.
...this method has the same algorithm as array.prototype.tolocalestring() and, as the typed array elements are numbers, the same algorithm as number.prototype.tolocalestring() applies for each element.
Uint16Array() constructor - JavaScript
object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
...once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Uint32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Uint8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
Uint8ClampedArray() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
... object when called with an object argument, a new typed array is created as if by the typedarray.from() method.
WeakMap.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakmap object, but is no longer part of ecmascript and its implementations.
... syntax wm.clear(); examples using the clear method var wm = new weakmap(); var obj = {}; wm.set(obj, 'foo'); wm.set(window, 'bar'); wm.has(obj); // true wm.has(window); // true wm.clear(); wm.has(obj) // false wm.has(window) // false specifications not part of any standard.
WeakMap.prototype.delete() - JavaScript
the delete() method removes the specified element from a weakmap object.
... examples using the delete method var wm = new weakmap(); wm.set(window, 'foo'); wm.delete(window); // returns true.
WeakMap.prototype.get() - JavaScript
the get() method returns a specified element from a weakmap object.
... examples using the get method var wm = new weakmap(); wm.set(window, 'foo'); wm.get(window); // returns "foo".
WeakMap.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified key exists in the weakmap object or not.
... examples using the has method var wm = new weakmap(); wm.set(window, 'foo'); wm.has(window); // returns true wm.has('baz'); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.has' in that specification.
WeakMap.prototype.set() - JavaScript
the set() method adds a new element with a specified key and value to a weakmap object.
... examples using the set method var wm = new weakmap(); var obj = {}; // add new elements to the weakmap wm.set(obj, 'foo').set(window, 'bar'); // chainable // update an element in the weakmap wm.set(obj, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.set' in that specification.
WeakRef - JavaScript
instance methods weakref.prototype.deref() returns the weakref object's target object, or undefined if the target object has been reclaimed.
... notes on weakrefs some notes on weakrefs: if your code has just created a weakref for a target object, or has gotten a target object from a weakref's deref method, that target object will not be reclaimed until the end of the current javascript job (including any promise reaction jobs that run at the end of a script job).
WeakSet.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakset object, but is no longer part of ecmascript and its implementations.
... syntax ws.clear(); examples using the clear method var ws = new weakset(); ws.add(window); ws.has(window); // true ws.clear(); ws.has(window); // false specifications not part of any standard.
WeakSet.prototype.delete() - JavaScript
the delete() method removes the specified element from a weakset object.
... examples using the delete method var ws = new weakset(); var obj = {}; ws.add(window); ws.delete(obj); // returns false.
WeakSet.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an object exists in a weakset or not.
... examples using the has method var ws = new weakset(); var obj = {}; ws.add(window); myset.has(window); // returns true myset.has(obj); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.has' in that specification.
WebAssembly.Memory - JavaScript
instance methods memory.prototype.grow() increases the size of the memory instance by a specified number of webassembly pages (each one is 64kb in size).
... the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above.
WebAssembly.Module.exports() - JavaScript
examples using exports the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
...when the module is received, we create an instance from it using the webassembly.instantiate() method, invoke an exported function from inside it, then show how we can return information on the available exports on a module using webassembly.module.exports.
WebAssembly.Module - JavaScript
examples sending a compiled module to a worker the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends the resulting module instance to a worker using postmessage().
...when the module is received, we create an instance from it using the webassembly.instantiate() method and invoke an exported function from inside it.
WebAssembly.Table.prototype.get() - JavaScript
the get() prototype method of the webassembly.table() object retrieves a function reference stored at a given index.
... examples using get the following example (see table.html on github, and view it live also) compiles and instantiates the loaded table.wasm byte code using the webassembly.instantiatestreaming() method.
WebAssembly.Table - JavaScript
instance methods table.prototype.get() accessor function — gets the element stored at a given index.
... var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an import object that contains the table: var importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming() method.
eval() - JavaScript
dnesday","thursday","friday","saturday","sunday"][n%7 || 0]; } function runcodewithdatefunction(obj){ return function('"use strict";return (' + obj + ')')()( date ); } console.log(runcodewithdatefunction( "function(date){ return date(5) }" )) the code above may seem inefficiently slow because of the triple nested function, but let's analyze the benefits of the above efficient method: it allows the code in the string passed to runcodewithdatefunction() to be minified.
...instead, use the property accessors, which are much faster and safer: var obj = { a: 20, b: 30 }; var propname = getpropname(); // returns "a" or "b" var result = obj[ propname ]; // obj[ "a" ] is the same as obj.a you can even use this method to access descendant properties.
Standard built-in objects - JavaScript
this chapter documents all of javascript's standard, built-in objects, including their methods and properties.
...they have no properties or methods.
delete operator - JavaScript
this includes properties of built-in objects like math, array, object and properties that are created as non-configurable with methods like object.defineproperty().
...in the following example, trees[3] is assigned the value undefined, but the array element still exists: var trees = ['redwood', 'bay', 'cedar', 'oak', 'maple']; trees[3] = undefined; if (3 in trees) { // this is executed } if instead, you want to remove an array element by changing the contents of the array, use the splice() method.
for...in - JavaScript
objects created from built–in constructors like array and object have inherited non–enumerable properties from object.prototype and string.prototype, such as string's indexof() method or object's tostring() method.
...alternatively, if you know there won't be any outside code interference, you can extend built-in prototypes with a check method.
Authoring MathML - MathML
note that ua string sniffing is not the most reliable method and might break from version to version: var ua = navigator.useragent; var isgecko = ua.indexof("gecko") > -1 && ua.indexof("khtml") === -1 && ua.indexof('trident') === -1; var iswebkit = ua.indexof('applewebkit') > -1 && ua.indexof('chrome') === -1; mathematical fonts in order to get a good layout or to allow different style, it's important to have mathematical fonts available.
... 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.
Web audio codec guide - Web media technologies
they strip away audio frequencies that aren't used much, tolerate loss of precision in the decoded output, and use other methods to lose audio content, quality, and fidelity to produce smaller encoded media.
... aac has a number of profiles that define methods of compressing audio for specific use cases, including everything from high quality surround sound to low-fidelity audio for speech-only use.
Digital video concepts - Web media technologies
there are two primary methods used to represent rgb samples: using integer components and using floating-point components.
...this decoding operation must mirror the method used during encoding, which is represented by three numbers separated by colons (":").
CSS and JavaScript animation performance - Web Performance
the callback function of the method is called by the browser before the next repaint on each frame.
... in this section we'll walk you through a performance test, using firefox, to see what animation method seems better overall.
Web Performance
in this article we discuss the impact video, audio, and image content has on performance, and the methods to ensure that impact is as minimal as possible.
...in this article, we'll covers methods for getting your font files as small as possible with efficient file formats and sub setting.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
t the code that registers a new service worker, in the app.js file: note : we're using the es6 arrow functions syntax in the service worker implementation if('serviceworker' in navigator) { navigator.serviceworker.register('./pwa-examples/js13kpwa/sw.js'); }; if the service worker api is supported in the browser, it is registered against the site using the serviceworkercontainer.register() method.
... the fetchevent.respondwith method takes over control — this is the part that functions as a proxy server between the app and the network.
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
z-origin-x i id ideographic image-rendering in in2 intercept k k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes l lang lengthadjust letter-spacing lighting-color limitingconeangle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntransform patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolic...
...y refx refy rel rendering-intent repeatcount repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v ...
Getting started - SVG: Scalable Vector Graphics
svg files on the web can be displayed directly in the browser or embedded in html files via several methods: if the html is xhtml and is delivered as type application/xhtml+xml, the svg can be directly embedded in the xml source.
...with this method, replacement technologies can be implemented for browsers which normally can't process svg.
Transport Layer Security - Web security
in tls 1.2 and earlier, the negotiated cipher suite includes a set of cryptographic algorithms that together provide the negotiation of the shared secret, the means by which a server is authenticated, and the method that will be used to encrypt data.
... the cipher suite in tls 1.3 primarily governs the encryption of data, separate negotiation methods are used for key agreement and authentication.
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.
Interacting with page scripts - Archive of obsolete content
this means that you can't expose a function to a page script using cloneinto(), and if you clone an object into the page script scope, its methods will not be available to the page script.
self - Archive of obsolete content
methods the self object has four methods, which enable the content script to send messages to, and receive messages from, the main add-on code.
Testing the Add-on SDK - Archive of obsolete content
from mozilla-central repository with a checkout of the mozilla-central source code, one can always cd addon-sdk/source and use any of the methods described above, but in addtion to that there are a couple of mach commands available, and ofcourse there is the try server if you have access to that.
simple-storage - Archive of obsolete content
important: if you use this method, you must end your debugging session by quitting firefox normally, not by cancelling the shell command.
ui - Archive of obsolete content
from firefox 30 onwards, you can attach panels to toggle buttons, by passing the button into the panel's constructor or its show() method: frame a frame enables you to create an html iframe, using bundled html, css and javascript.
windows - Archive of obsolete content
ws").browserwindows; //print how many tabs the current window has console.log("the active window has " + windows.activewindow.tabs.length + " tabs."); // print the title of all browser windows for (let window of windows) { console.log(window.title); } // close the active window windows.activewindow.close(function() { console.log("the active window was closed"); }); methods activate() makes window active, which will focus that window and bring it to the foreground.
console/plain-text - Archive of obsolete content
all of its methods are inherited from console.jsm (resource://gre/modules/devtools/console.jsm).
net/xhr - Archive of obsolete content
this can probably be done most securely by white-listing the protocols that can be used in the url passed to the open() method, and limiting them to http:, https:, and possibly a special scheme that can be used to access the add-on's packaged, read-only resources.
places/bookmarks - Archive of obsolete content
events data the data event is emitted when a bookmark item that was passed into the save method has been saved to the platform.
test/utils - Archive of obsolete content
helper methods used in the commonjs unit testing suite.
util/collection - Archive of obsolete content
methods add(itemoritems) adds a single item or an array of items to the collection.
util/match-pattern - Archive of obsolete content
matchpattern methods test(url) tests a url against the match pattern.
Release notes - Archive of obsolete content
added a delete() method to sdk/request.
cfx - Archive of obsolete content
suppose your the following local.json is as follows: { "configs": { "ff40": ["-b", "/usr/bin/firefox-4.0"] } } you can run: cfx test --use-config=ff40 and it would be equivalent to: cfx test -a firefox -b /usr/bin/firefox-4.0 this method of defining configuration options can be used for all of the run, build, and test tools.
jpm - Archive of obsolete content
for example: jpm watchpost --post-url http://localhost:8888/ note that the logging level defined for the console is different when you use this method, compared to the logging level used when an add-on is run using jpm run.
Adding a Button to the Toolbar - Archive of obsolete content
to attach the panel, pass the button to the panel's show() method.
Getting started (cfx) - Archive of obsolete content
for example: while true ; do cfx xpi ; wget --post-file=codesy.xpi http://localhost:8888/ ; sleep 5 ; done note that the logging level defined for the console is different when you use this method, compared to the logging level used when an add-on is run using cfx run.
Modifying the Page Hosted by a Tab - Archive of obsolete content
to modify the page hosted by a particular tab, load one or more content scripts into it using attach() method of tab object.
Using XPCOM without chrome - Archive of obsolete content
below is an example, where we extend the xpcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged).
Dialogs and Prompts - Archive of obsolete content
nsipromptservice is an xpcom interface available to c++ and chrome javascript code (not to web pages' js), that provides methods for displaying a few simple types of dialogs.
Forms related code snippets - Archive of obsolete content
image preview before upload the filereader.prototype.readasdataurl() method can be useful, for example, to get a preview of an image before uploading it.[article] this example shows how to use it in this way.
Examples and demos from articles - Archive of obsolete content
[article] image preview before upload [html] the filereader.prototype.readasdataurl() method is useful, for example, to get a preview of an image before uploading it.
HTML to DOM - Archive of obsolete content
but, we still need to see how to execute the famous loaduri() method using our iframe: donkeybrowser.webnavigation.loaduri("http://developer.mozilla.org", components.interfaces.nsiwebnavigation, null, null, null); also, i recommend you take a look at the nsiwebnavigation interface.
JavaScript Debugger Service - Archive of obsolete content
ion here }, onscriptdestroyed: function(script) { // your function here } }; jsd.errorhook = { onerror: function(message, filename, lineno, colno, flags, errnum, exc) { // your function here } }; // triggered when jsd.errorhook[onerror] returns false jsd.debughook = { onexecute: function(frame, type, rv) { // your function here } }; jsd.enumeratescripts({ // the enumeratescript method will be called once for every script jsd knows about enumeratescript: function(script) { // your function here } }); a simple stack trace here, we will show how to implement a simple javascript stack trace using the jsd.
On page load - Archive of obsolete content
to attach to the unload event in above example you can use the "pagehide" event like this: appcontent.addeventlistener("pagehide", myextension.onpageunload, false); for appcontent and similarly for messagepane messagepane.addeventlistener("pagehide", myextension.onpageunload, false); and add your code to onpageunload method.
QuerySelector - Archive of obsolete content
alert($('#myid').id); (note that while using the firefox web console, the above functions are available automatically.) both xul and even xml can be easily made supportable (an alternative approach to the following would be to add chromewindow.prototype or window.prototype, accessing this.document.queryselector, or following the jquery style of chaining by returning 'this' within each prototype method of $()): htmldocument.prototype.$ = function (selector) { // only for html return this.queryselector(selector); }; example: <h1>test!</h1> <script> htmldocument.prototype.$ = function (selector) { return this.queryselector(selector); }; alert(document.$('h1')); // [object htmlheadingelement] </script> xuldocument.prototype.$ = function (selector) { // only for xul return this.query...
Tree - Archive of obsolete content
you can then use the event and some utility methods to find the <treecell>.
Custom about: URLs - Archive of obsolete content
services.io.newchannel was deprecated, and the signature of the newchannel method changed.
Enhanced Extension Installation - Archive of obsolete content
code in the extension system can quickly locate an install location for an item using the getinstalllocation method which basically reads this value from the datasource and retrieves the install location from the hash of registered install locations.
Extension Packaging - Archive of obsolete content
when using this method you must verify that the file system permissions for the directories, and files for the extension, are set properly.
How to convert an overlay extension to restartless - Archive of obsolete content
your localization handling should be unaffected by your transition to a restartless/extractionless add-on so long as you properly clear the chrome cache on add-on shutdown and load your properties files using the method listed above.
Interaction between privileged and non-privileged pages - Archive of obsolete content
in the following code sample 2 methods are combined: setting an extra attribute in the original event target element, and creating a new event message with a new event target element.
Jetpack Processes - Archive of obsolete content
handles have the following native methods and properties: invalidate() invalidates the handle.
Listening to events in Firefox extensions - Archive of obsolete content
this is created by the method mtabprogresslistener().
Multiple item extension packaging - Archive of obsolete content
installation installation can be performed using any of the existing methods used for installing extensions / themes.
Chapter 1: Introduction to Extensions - Archive of obsolete content
table 1: advanced customization methods for firefox customization method does it work for web sites?
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
so, in order to detect the first stage, you'll need to add an event listener using the addaddonlistener method.
The Essentials of an Extension - Archive of obsolete content
we call the getstring method of the bundle element and get the localized message to be displayed.
User Notifications and Alerts - Archive of obsolete content
the appendnotification method takes the message, id, image (32x32), level and buttons.
Overlay extensions - Archive of obsolete content
this methodology has largely been superseded by restartless extensions, and the add-on sdk, which is built on top of them.
Extensions support in SeaMonkey 2 - Archive of obsolete content
box id="browser-bottombox"> <something insertbefore="status-bar" /> </vbox> use the following technique to make your overlay work on both seamonkey 2 and firefox 3: <window id="main-window"> <vbox id="browser-bottombox" insertbefore="status-bar"> <something insertbefore="status-bar" /> </vbox> </window> thunderbird 3 gfolderdisplay api seamonkey 2.0 only supports a reduced set of methods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in various places.
Session store API - Archive of obsolete content
in order to properly restore your extension's state when a tab is restored, it needs to use the session store api's settabvalue() method to save any data it will need in order to restore its state, and then call gettabvalue() to retrieve the previous setting when the tab is restored.
Setting up an extension development environment - Archive of obsolete content
useful for testing debug symbols and the crash reporting system (firefox and thunderbird) javascript object examiner displays javascript object methods and properties for any available scope developer profile and devprefs sets up the development environment described above when installed (firefox and fennec) firefox extension proxy file extension files are normally installed in the user profile.
Supporting search suggestions in search plugins - Archive of obsolete content
in addition, the method you use to select suggestions is entirely up to you.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
despite some initial setbacks with those approaches due to our own unique scenarios, it wasn't long before i discovered a variation of one of their methods that worked for the wired news design.
chargingchange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
chargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
dischargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
levelchange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method.
List of Mozilla-Based Applications - Archive of obsolete content
qsos xul editor tool for the qsos method qsos stands for qualification and selection of opensource software qtrax music client based on songbird quickstaf gui client for software testing automation framework uses xulrunner qutecom phone software previously named openwengo redcar text editor seems to use xulrunner red hat directory server server product uses ns...
Defining Cross-Browser Tooltips - Archive of obsolete content
between these two passages, it is fairly clear that the proper method for defining a "tooltip" for an image (or, indeed, for any element) is to use the title attribute.
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
if you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http request we want to make and the url of the document to retrieve, and then call its send method to send the request.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
this method of packaging applies to older applications, like mozilla suite, firefox 1.0.
Download Manager improvements in Firefox 3 - Archive of obsolete content
note: these changes will require some modest revisions to code using the download manager; several methods have had minor changes.
Drag and Drop - Archive of obsolete content
the following properties and methods are available: candrop set this property to true if the element the mouse is currently over can accept the object currently being dragged to be dropped on it.
Embedding FAQ - Archive of obsolete content
how to customize document retrieval one method is to implement your own protocol method.
Content states and the style system - Archive of obsolete content
so the effect will be that of matching a node against the selectors: a a div the code that implements this is in the selectormatches method, which is passed the list of states that changed in the astatemask parameter.
Gecko Coding Help Wanted - Archive of obsolete content
here are some fixes that are straightforward; they just need some time and attention: decomtamination convert weird, ugly and inefficient method signatures to more natural c++ method signatures.
importUserCertificates - Archive of obsolete content
the importusercertificates() method is used to import newly issued certificates for the user.
Java in Firefox Extensions - Archive of obsolete content
var aclass = java.lang.class.forname("org.mozilla.developer.helloworld", true, cl); var astaticmethod = aclass.getmethod("getgreeting", []); var greeting = astaticmethod.invoke(null, []); alert(greeting); another, perhaps simpler approach is as follows: var myclass = loader.loadclass('com.example.myclass'); // use the same loader from above var myobj = myclass.newinstance(); var binval = myobj.mymethod(arg1, arg2); // pass whatever arguments you need (they'll be auto-converted to java form, tak...
Extenders - Archive of obsolete content
manifest chief mechanism for allowing advanced api use within your jetpack superpowers similar to libraries, superpowers are for adding deeper platform coupling for your jetpack sandboxes safely abstracts library interoperability issues so you don't have to worry about them future api interface method for including not yet finalized functionality in your jetpack ...
Me - Archive of obsolete content
ArchiveMozillaJetpackMetaMe
the namespace currently lives in the future and must be imported before it is used: jetpack.future.import("me"); methods onfirstrun(funcfunction)jetpack.me.onfirstrun() allows jetpacks to be notified after they are successfully installed.
Multimedia - Archive of obsolete content
audio interface for manipulating audio video interface for manipulating video music methods for interacting with music content ...
Jetpack Snippets - Archive of obsolete content
al jetpack scope jetpack.slidebar.append({ onready: function (slide) { // call out to a global function, passing the slidebar object exinitslidebar(slide); }, ...});function exinitslidebar(aslidebar) { // this variable will now be global slider = aslidebar;} // then, accessing the slidebar htmlvar tl = slider.contentdocument.getelementbyid("thumblist"); // or calling slidebar api methods or accessing propertiesslider.notify(); ...
Clipboard Test - Archive of obsolete content
jetpack.future.import("clipboard"); methods additional information can be found at clipboard api proposal ...
System - Archive of obsolete content
clipboard interactions with the os clipboard system information get information about the platform on which jetpack is running visual effects os-level visual effects abilities devices methods for accessing and controlling devices (ex.
Notifications - Archive of obsolete content
methods show(titlestring, [body as string] iconstring)draws a notification box.
Tabs - Archive of obsolete content
ArchiveMozillaJetpackUITabs
methods open(urlstring)opens a new tab in your browser with a defined url.
slideBar - Archive of obsolete content
creating a slidebar and adding options to implement a new slidebar within your jetpack code, use the method jetpack.slidebar.append(options) ...
slideBar - Archive of obsolete content
jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar instance.
statusBar - Archive of obsolete content
namespace: jetpack.statusbar methods copybackground embediframe append the append methods adds a new item to the statusbar.
Microsummary XML grammar reference - Archive of obsolete content
example the microsummary generator created in the creating a microsummary tutorial: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <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> namespace the namespace uri for microsummary generator xml documents is: http://www.mozilla.org/microsummaries/0.1 all ele...
Bundles - Archive of obsolete content
this is why the preferred method of launching is to use the "-webapp [webapp-id]" command line, which looks for the previously installed (unpacked) web application in the prism webapps/{webapp-id} folder.
Extensions - Archive of obsolete content
extensions are built using the same methods as any mozilla-based extension.
New Skin Notes - Archive of obsolete content
--beltzner any chance we can mobe the "main page" scrollbar to the actual "content area" of the page, so that the sidebar `stays` when in-use, and on dynamic pages (such as the preferences page) if you toggle between something that needs a verticle scrollbar and something that doesnt, you get screen-jitter; if this is not-feasable, perhaps some method to have a viewport scrollbar always appear for the vert direction.
Reading textual data - Archive of obsolete content
m // this assumes istream is the stream you want to read from var scriptablestream = components.classes["@mozilla.org/scriptableinputstream;1"] .createinstance(components.interfaces.nsiscriptableinputstream); scriptablestream.init(istream); var chunk = scriptablestream.read(4096); var text = converter.converttounicode(chunk); however, you must be aware that this method will not work for character encodings that have embedded null bytes, such as utf-16 or utf-32.
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.
SpiderMonkey coding conventions - Archive of obsolete content
but static native methods of js objects have lowercase, underscore-separated or intercaps names, e.g., str_indexof.
File object - Archive of obsolete content
file.input, file.output, file.error or a pipeline) methods file.open() opens the file, specifying file mode and type.
String Quick Reference - Archive of obsolete content
old way: use nsstring& and nscstring& void mymethod(const nsstring& input, nsstring& output); new way: use nsastring& and nsacstring& void mymethod(const nsastring& input, nsastring& output); substrings what: get direct references to string fragments why: avoid making multiple copies of the string old way: use a bunch of nsautostrings, and use left(), right() and mid() to grab a segment of a string: // get an 8-character string starting at the 4th position nsautostring leftside; str.left(leftside, 12...
Table Cellmap - Archive of obsolete content
and finally the line iterator methods which are used for arrow navigation through a table.
Abc Assembler Tests - Archive of obsolete content
htrue // expected pushnull pushnull lessequals // actual callpropvoid compare_stricteq 3 // use .try / .catch to catch typeerror // convert_o null .try { pushnull convert_o pop findproperty fail pushstring "convert_o null" pushstring "exception should have been thrown: typeerror: error #1009: cannot access a property or method of a null object reference." getlocal1 callpropvoid fail 3 jump finished_convert_o_null } .catch { getlocal0 pushscope setlocal2 // save typeerror findproperty compare_typeerror pushstring "convert_o null" // test name pushstring "typeerror: error #1009" // expected getlocal2 // actual callpropvoid...
Tamarin build documentation - Archive of obsolete content
this sdk/ndk *must* be used if you've cloned tamarin at changeset 5844:92ad3ca84a0b or later and will be using the cross-compile build method.
The Download Manager schema - Archive of obsolete content
this information is available using nsidownloadmanager methods to retrieve nsidownload objects for each download entry; however, if you feel like poking directly into the table, you can do so using the storage api.
URIs and URLs - Archive of obsolete content
the protocol handler provides scheme specific information and methods to create new uris of the schemes it supports.
Venkman Introduction - Archive of obsolete content
this is the same text you would get from the tosource method of the function prototype.
Writing textual data - Archive of obsolete content
nsiscriptableunicodeconverter has a simple method to do that: // first, get and initialize the converter var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); converter.charset = /* the charset you want to use.
Install script template - Archive of obsolete content
values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //initinstall block //the installation is initialized here -- if we fail here, cancel the installation // initinstall is quite an overloaded method, but i have invoked it here with three strings // which are globally defined err = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0) cancelinstall(err); } //addfiles to current browser block var pluginsfolder = getfolder("plugins"); //verify d...
File.windowsShortcut - Archive of obsolete content
file.windowsshortcut in this example, the windowsshortcut method is used to add a shortcut in the program directory ("program" is a keyword for the directory in which the program itself is installed, for example, c:\program files\netscape\netscape 6\" on windows) to windows software (misc.exe) that is installed in the "windows" directory.
Install.addDirectory - Archive of obsolete content
install.adddirectory the install object's adddirectory method queues an entire directory for installation once performinstall is called.
Install.addFile - Archive of obsolete content
install.addfile the install object's addfile method is the standard way to queue files for installation.
InstallTrigger.startSoftwareUpdate - Archive of obsolete content
installtrigger.startsoftwareupdate this is a very simple example of the installtrigger object's principal method, startsoftwareupdate, which takes a string representing the path to the xpi and installs that xpi on the local machine.
copy - Archive of obsolete content
method of file object syntax int copy( filespecobject source, filespecobject dest ) parameters the copy method has the following parameters: source a filespecobject object reprsenting the file to be copied.
dirGetParent - Archive of obsolete content
method of file object syntax filespecobject dirgetparent( filespecobject fileordir ); parameters the dirgetparent method has the following parameters: fileordir a filespecobject representing the pathname of the file or directory whose parent is being requested.
dirRemove - Archive of obsolete content
method of file object syntax int dirremove( filespecobject dirtoremove [, boolean recursive] ); parameters the dirremove method has the following parameters: dirtoremove a filespecobject representing the directory to be removed.
dirRename - Archive of obsolete content
method of file object syntax int dirrename( filespecobject directory, string newname ); parameters the dirrename method has the following parameters: directory a filespecobject representing the directory to be renamed.
diskSpaceAvailable - Archive of obsolete content
method of file object syntax double diskspaceavailable ( string nativefolderpath ); parameters the diskspaceavailable method has the following parameters: nativefolderpath a string representing the pathname of the partition, a file, or a directory on the partition whose space is being queried.
exists - Archive of obsolete content
method of file object syntax boolean exists( filespecobject target ) parameters the exists method has the following parameters: target a filespecobject representing the file or directory being tested for existence.
isDirectory - Archive of obsolete content
method of file object syntax boolean isdirectory ( filespecobject nativefolderpath ); parameters the isdirectory method has the following parameters: nativefolderpath a filespecobject representing the queried directory.
isFile - Archive of obsolete content
method of file object syntax boolean isfile (filespecobject nativefolderpath); parameters the isfile method has the following parameter: nativefolderpath a filespecobject representing the queried file object.
macAlias - Archive of obsolete content
method of file object syntax int macalias( filespecobject destdir, string filename, filespecobject aliasdir, string aliasname ); parameters the macalias method has the following parameters: destdir a filespecobject that represents the directory into which the program file will be installed.
modDate - Archive of obsolete content
method of file object syntax double moddate ( filespecobject nativefolderpath ); parameters the moddate method has the following parameters: nativefolderpath a filespecobject representing the queried file.
modDateChanged - Archive of obsolete content
method of file object syntax boolean moddatechanged (filespecobject asourcefolder, number anolddate); parameters the moddatechanged method has the following parameters: asourcefolder a filespecobject representing the file to be queried.
move - Archive of obsolete content
method of file object syntax int move( filespecobject source, filespecobject dest ); parameters the move method has the following parameters: source a filespecobject representing the source file.
remove - Archive of obsolete content
method of file object syntax int remove( filespecobject file ) parameters the remove method has the following parameters: file a filespecobject representing the file to be removed.
rename - Archive of obsolete content
method of file object syntax int rename( filespecobject file, string newname ) parameters the rename method has the following parameters: file a filespecobject representing the file to be renamed.
size - Archive of obsolete content
method of file object syntax int size (string nativefolderpath); parameters the size method has the following parameters: nativefolderpath the full pathname to the file.
windowsGetShortName - Archive of obsolete content
method of file object syntax string windowsgetshortname( object localdirspec ) parameters the windowsregisterserver method has the following parameter: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder.
windowsRegisterServer - Archive of obsolete content
method of file object syntax int windowsregisterserver( object localdirspec ) parameters the windowsregisterserver method has the following parameters: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder.
windowsShortcut - Archive of obsolete content
method of file object syntax int windowsshortcut( folderobject atarget, folderobject ashortcutpath, string adescription, folderobject aworkingpath, string aparams, folderobject aicon, number aiconid); parameters the windowsshortcut method has the following parameters: atarget a filespecobject representing the absolute path (including filename) to file that the shortcut will be created for.
File Object - Archive of obsolete content
overview the file object has methods for analyzing the file system and preparing it (as when new directories, program shortcuts, version comparisons, or deletions are required) for newly installed software packages.
init - Archive of obsolete content
method of installversion object syntax init ( int maj, int min, int rev, int bld ); init ( string version ); parameters the init method has the following parameters: maj the major version number.
toString - Archive of obsolete content
method of installversion object syntax string version = installversion.tostring ( initobj ); parameters the tostring method has the following parameter: initobj initobj is an installversion object whose init method has been called.
alert - Archive of obsolete content
method of install object syntax void alert ( string message ); parameters the message parameter is displayed as a string in the dialog box.
cancelInstall - Archive of obsolete content
method of install object syntax void cancelinstall() void cancelinstall( int errorcode ) parameters none.
Properties - Archive of obsolete content
for more details, see the corresponding code living in the getinstallplatform method of class nsinstall.
Return Codes - Archive of obsolete content
return codes the methods described in this chapter can return any of the following return codes.
deleteKey - Archive of obsolete content
method of winreg object syntax int deletekey ( string subkey); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
deleteValue - Archive of obsolete content
method of winreg object syntax int deletevalue ( string subkey, string valname); parameters the deletevalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
enumKeys - Archive of obsolete content
method of winreg object syntax string enumkeys ( string key, int subkeyindex ); parameters the enumkeys method has the following parameters: key the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
getValueNumber - Archive of obsolete content
method of winreg object syntax number getvaluenumber ( string subkey, string valname); parameters the getvaluestring method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
isKeyWritable - Archive of obsolete content
method of winreg object syntax boolean iskeywritable( string key); parameters the method has the following parameter: key a string representing the path to the key returns a boolean value: true if the key is writable; false if not.
keyExists - Archive of obsolete content
method of winreg object syntax boolean keyexists ( string key); parameters the method has the following parameter: key a string representing the path to the key returns boolean value description if the user does not have read access to the given key, this will also return false.
valueExists - Archive of obsolete content
method of winreg object syntax boolean valueexists ( string key, string value ); parameters the method has the following parameters: key a string representing the path to the key.
dlgtype - Archive of obsolete content
you can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function.
events - Archive of obsolete content
you can send a custom event by calling the updatecommands method of the command dispatcher.
homepage - Archive of obsolete content
you can switch to this home page using the gohome method.
onbeforeaccept - Archive of obsolete content
« xul reference home onbeforeaccept type: script code the code in this attribute is called when the ok button is pressed or the acceptdialog method is called.
panel.noautohide - Archive of obsolete content
if true, the panel will only be closed when the hidepopup method is called.
persistence - Archive of obsolete content
« xul reference home persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
pinned - Archive of obsolete content
the tabbrowser element's pintab and unpintab methods handle pinning and unpinning tabs.
popup.left - Archive of obsolete content
« xul reference home left type: integer overrides the horizontal position of the popup specified by the showpopup method.
popup.top - Archive of obsolete content
« xul reference home top type: integer overrides the vertical position of the popup specified by the showpopup method.
prefpane.selected - Archive of obsolete content
to change the selected pane, use the prefwindow's showpane method.
priority - Archive of obsolete content
should be one of the constants described in the notificationbox's appendnotification method.
rows - Archive of obsolete content
ArchiveMozillaXULAttributerows
to get the actual number of rows in the element, use the getrowcount method.
suppressonselect - Archive of obsolete content
« xul reference home suppressonselect type: boolean if this attribute is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods.
wait-cursor - Archive of obsolete content
in order to revert to the normal cursor state call the method removeattribute("wait-cursor") when the process effectively has ended otherwise the wait cursor might never disappear.
Building accessible custom components in XUL - Archive of obsolete content
when the user presses enter, we replace the currently focused xul label element with a xul textbox element, copy the initial value over to the textbox element, and call its focus and select methods to set focus to the textbox and select the entire value.
IO - Archive of obsolete content
ArchiveMozillaXULFileGuideIO
the returned value is still a nsifile object, however a number of methods may be used which are only of value for subdirectories.
addTabsProgressListener - Archive of obsolete content
the progress listener should be based on the nsiwebprogresslistener interface with an additional "browser" argument as the first argument of every method, which is the browser (not <tabbrowser> = gbrowser) where the event occurred.
swapDocShells - Archive of obsolete content
this method can be used to move browser between windows or tear off a browser into a new window.
addSession - Archive of obsolete content
this method returns the object passed in.
addTab - Archive of obsolete content
ArchiveMozillaXULMethodaddTab
firefox 3.6 note the second form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order.
advance - Archive of obsolete content
ArchiveMozillaXULMethodadvance
« xul reference home advance( pageid ) return type: no return value call this method to go to the next page.
appendCustomToolbar - Archive of obsolete content
the method returns the dom element for the created toolbar.
cancel - Archive of obsolete content
ArchiveMozillaXULMethodcancel
« xul reference home cancel() return type: no return value call this method to cancel and close the wizard.
decrease - Archive of obsolete content
« xul reference home method of: scale textbox decrease() return type: no return value decreases the value of the scale or number box by the increment.
decreasePage - Archive of obsolete content
« xul reference home method of: scale decreasepage() return type: no return value decreases the value of the scale by the pageincrement.
extra1 - Archive of obsolete content
ArchiveMozillaXULMethodextra1
« xul reference home extra1() return type: no return value call this method to simulate clicking the extra1 button.
extra2 - Archive of obsolete content
ArchiveMozillaXULMethodextra2
« xul reference home extra2() return type: no return value call this method to simulate clicking the extra2 button.
getBrowserIndexForDocument - Archive of obsolete content
« xul reference home getbrowserindexfordocument( document ) return type: integer returns the index of the browser for the specified document in the tabbrowser the method was invoked on.
getEditor - Archive of obsolete content
« xul reference home geteditor( window ) return type: nsieditor returns the editing interface for the editor which contains numerous methods for manipulating the document.
getElementsByAttributeNS - Archive of obsolete content
note that this method is only available on xul elements and is not part of the dom.
getHTMLEditor - Archive of obsolete content
« xul reference home gethtmleditor( window ) return type: nsihtmleditor returns the html editing interface for the editor which contains methods for manipulating an html document.
getNextItem - Archive of obsolete content
« xul reference home getnextitem( startitem, delta ) return type: element this method returns the item a given distance (delta) after the specified startitem, or null if no such item exists.
getPreviousItem - Archive of obsolete content
« xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists.
getSelectedItem - Archive of obsolete content
« xul reference home getselecteditem( index ) return type: element when multiple items are selected, you can retrieve each selected item using this method.
goTo - Archive of obsolete content
ArchiveMozillaXULMethodgoTo
« xul reference home goto( pageid ) return type: no return value this method is used to change which page is currently displayed, specified by the pageid argument.
hidePopup - Archive of obsolete content
« xul reference home method of: popup, menupopup, tooltip hidepopup() return type: no return value closes the popup immediately.
increase - Archive of obsolete content
« xul reference home method of: scale textbox increase() return type: no return value increases the value of the scale or number box by the increment.
increasePage - Archive of obsolete content
« xul reference home method of: scale increasepage() return type: no return value increases the value of the scale by the page increment.
insertItem - Archive of obsolete content
the method returns the dom element for the created item.
insertItemAt - Archive of obsolete content
« xul reference home insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position.
loadURI - Archive of obsolete content
ArchiveMozillaXULMethodloadURI
« xul reference home note: this is the xul method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js.
loadURIWithFlags - Archive of obsolete content
in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the url is loaded because of a meta tag refresh or redirect.
menulist.select - Archive of obsolete content
this method applies to editable menulists only.
onSearchComplete - Archive of obsolete content
you should not call this method yourself.
onTextEntered - Archive of obsolete content
you should not call this method yourself.
onTextReverted - Archive of obsolete content
you should not call this method yourself.
openWindow - Archive of obsolete content
if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window.
reload - Archive of obsolete content
ArchiveMozillaXULMethodreload
« xul reference home reload() return type: no return value reloads the document in the browser element on which you call this method.
removeAllTabsBut - Archive of obsolete content
if only one tab page is displayed, this method does nothing.
removeCurrentTab - Archive of obsolete content
if it is the only displayed tab, this method does nothing.
removeItemAt - Archive of obsolete content
the method returns the removed item.
removeTab - Archive of obsolete content
if only one tab is displayed, this method does nothing (unless the preference browser.tabs.closewindowwithlasttab is true, in which case the window containing the tab is closed).
rewind - Archive of obsolete content
ArchiveMozillaXULMethodrewind
« xul reference home rewind() return type: no return value call this method to go back a page.
selectItemRange - Archive of obsolete content
this method does nothing for single-selection list boxes.
startEditing - Archive of obsolete content
the tree view's nsitreeview.getcelltext() method is called to obtain the cell contents.
stop - Archive of obsolete content
ArchiveMozillaXULMethodstop
« xul reference home stop() return type: no return value equivalent to pressing the stop button, this method stops the currently loading document.
stopEditing - Archive of obsolete content
if the shouldaccept parameter is true, the cell's label is changed to the edited value (the tree view's nsitreeview.setcelltext() method is called to change the cell contents).
Node - Archive of obsolete content
ArchiveMozillaXULNode
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 ) ...
MenuButtons - Archive of obsolete content
the stoppropagation method is used to stop the bubbling effect so that the command event on the button does not get called as well.
MenuItems - Archive of obsolete content
in the example, this is done by using the removeattribute method.
boxObject - Archive of obsolete content
prior to gecko 1.9.1, you can retrieve the boxobject for non-xul elements using the document.getboxobjectfor method; the method was removed in gecko 1.9.1 because it was non-standard.
builder - Archive of obsolete content
to rebuild the content call the builder's rebuild method.
currentIndex - Archive of obsolete content
(all trees have seltype="multiple" by default.) to reliably change or determine a selection, instead use the nsitreeselection interface methods available via tree.view.selection.
currentPane - Archive of obsolete content
to change the current pane, use the showpane method.
currentURI - Archive of obsolete content
to change the url, use the loaduri method.
webNavigation - Archive of obsolete content
most of its methods are callable directly on the element itself, such as goback and goforward.
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.
chromeclass-toolbar - Archive of obsolete content
« xul reference home chromeclass-toolbar when this class is used, the toolbar will be hidden when a window is opened by setting the toolbar option to no in the window.open method.
Building Menus With Templates - Archive of obsolete content
there's nothing special about the way menus are handled -- the builder follows the same method for any type of content.
Building Trees - Archive of obsolete content
for cells in normal columns, you can use the value attribute to store some other value and you can use the view’s getcellvalue() method to retrieve it.
Multiple Queries - Archive of obsolete content
this method of using multiple queries allows different content to generated for each query.
Template Logging - Archive of obsolete content
the first debugging method involves logging all new results that apply to the template due to the data changing as well as logging results that are changed or removed.
XML Assignments - Archive of obsolete content
xpath provides syntax to retrieve this using the built-in string-length method.
The Joy of XUL - Archive of obsolete content
with xbl, developers can define new content for xul widgets, add additional event handlers to a xul widget, and add new interface properties and methods.
Things I've tried to do with XUL - Archive of obsolete content
an ugly workaround for this problem might include nesting an invisible html-element in order to access its "clientwidth" method: <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> ...
Complete - Archive of obsolete content
this extension only uses the xul method.
Anonymous Content - Archive of obsolete content
properties, methods and other aspects of xbl are still available whether the content is from xbl or whether the xul provides its own content.
Box Objects - Archive of obsolete content
the others have functions which are more easily accessible by methods mapped directly onto the element, since those types are generally only used with one particular element.
Creating a Window - Archive of obsolete content
opening a window in order to open a xul window, there are several methods that can be used.
Creating a Wizard - Archive of obsolete content
these methods will be called when the page is hidden or shown, regardless of which button was pressed (except when cancel is pressed -- you need to use onwizardcancel to check for this.) these three methods should provide enough flexibility to handle navigation as you need to.
Creating an Installer - Archive of obsolete content
it contains a number of methods which can be used to start an installation.
Keyboard Shortcuts - Archive of obsolete content
creating a keyboard shortcut xul provides methods in which you can define keyboard shortcuts.
Persistent Data - Archive of obsolete content
this method has the advantage that it works with mozilla user profiles, so that each user can have different settings.
Popup Menus - Archive of obsolete content
the second method is to use a tooltip element containing the content of a tooltip.
Stacks and Decks - Archive of obsolete content
this method has advantages over using text-shadow because you could completely style the shadow apart from the main text.
Tabboxes - Archive of obsolete content
xul provides a method to create such dialogs.
Templates - Archive of obsolete content
populating elements xul provides a method in which we create elements from data supplied by rdf, either from an rdf file or from an internal datasource.
Toolbars - Archive of obsolete content
xul has a method to create toolbars.
Tree Selection - Archive of obsolete content
you can use the methods of the selection object to retrieve the set of selected items or modify the selection.
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
naturally, having to implement a tree view with thirty or so properties and methods for every tree can be very cumbersome, especially for simple trees.
XBL Attribute Inheritance - Archive of obsolete content
if you need to map an attribute to the text content of the node, use "xbl:text" as the inner attribute, eg: <xul:description xbl:inherits="xbl:text=value"/> in the next section, we look at adding properties, methods and events to a binding.
XBL Inheritance - Archive of obsolete content
the child binding can add properties, methods and event handlers.
XUL Tutorial - Archive of obsolete content
jects rdf and templates introduction to rdf templates trees and templates rdf datasources advanced rules persistent data skins and locales adding style sheets styling a tree modifying the default skin creating a skin skinning xul files by hand localization property files bindings introduction to xbl anonymous content xbl attribute inheritance adding properties adding methods adding event handlers xbl inheritance creating reusable content using css and xbl xbl example specialized window types features of a window creating dialogs open and save dialogs creating a wizard more wizards overlays cross package overlays installation creating an installer install scripts additional install features this xul tutorial was originally created by neil dea...
Urlbar-icons - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons.
XUL element attributes - Archive of obsolete content
in order to revert to the normal cursor state call the method removeattribute("wait-cursor") when the process effectively has ended otherwise the wait cursor might never disappear.
XUL Reference - Archive of obsolete content
ck grid columns column rows row scrollbox action assign binding bindings conditions content member param query queryset rule template textnode triple where script commandset command broadcaster broadcasterset observes key keyset stringbundle stringbundleset arrowscrollbox dropmarker grippy scrollbar scrollcorner spinbuttons all attributes all properties all methods attributes defined for all xul elements style classes event handlers deprecated/defunct markup ...
XUL Template Primer - Bindings - Archive of obsolete content
the value of the object's variable will be computed by invoking the gettarget() method using the object's value as the asource argument, and the predicate's resource as the aproperty argument.
XUL accessibility guidelines - Archive of obsolete content
alerts are conveyed visually or audibly, or use a method other than the alert scripting function or the notificationbox element.
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.
XUL - Archive of obsolete content
xul reference xul elements, attributes, properties, methods, and event handlers.
Application Update - Archive of obsolete content
this article will hopefully explain how to update your xulrunner application using the same method that firefox, thunderbird, songbird, and chatzilla use.
Custom app bundles for Mac OS X - Archive of obsolete content
examples these example files are taken from a port of webrunner which was created to illustrate one method of mac os x application packaging.
Dialogs in XULRunner - Archive of obsolete content
log" description="example dialog"/> <groupbox flex="1"> <caption label="select favorite fruit"/> <radiogroup> <radio id="1" label="oranges because they are fruity"/> <radio id="2" selected="true" label="strawberries because of color"/> <radio id="3" label="bananna because it pre packaged"/> </radiogroup> </groupbox> </dialog> xul window elements have a special method to open dialogs, called window.opendialog().
Getting started with XULRunner - Archive of obsolete content
i am using the uncompressed method for now.
Make your xulrunner app match the system locale - Archive of obsolete content
the code described lives in the pybridge component's onstartup method which gets called automatically.
calIFileType - Archive of obsolete content
methods none.
Mozprocess - Archive of obsolete content
cwd=none, # working directory for cmd; defaults to none env={}, # environment to use for the process; defaults to os.environ ) exit_code = process.waitforfinish(timeout=60) # seconds see an example in https://github.com/mozilla/mozbase/b...profilepath.py processhandler may be subclassed to handle process timeouts (by overriding the ontimeout() method), process completion (by overriding onfinish()), and to process the command output (by overriding processoutputline()).
Gecko Compatibility Handbook - Archive of obsolete content
in addition, internet explorer 4 and netscape navigator 4 use completely different methods of embedding third-party software into the browser.
2006-11-03 - Archive of obsolete content
however, user wonder both storage method could exist in tb at the same time without crashing.
2006-11-10 - Archive of obsolete content
guenter has provided some sample code using the 'mailto:' method.
Extentsions FAQ - Archive of obsolete content
the person was missing a method call to getservice.
2006-09-29 - Archive of obsolete content
details can be located at layout confusion refactoring the nshtmlreflowstate(computeblockboxdata, initconstraints) and nsimageframe::getdesiredsize which uses ns_inrinsicsize, into the following method: /** * compute the size that a frame will occupy.
2006-12-08 - Archive of obsolete content
however, the c++ call that's supposed to be invoking the method on the javascript object is returning with 0x80004005 (ns_error_failure).
NPIdentifier - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary npidentifier is an opaque type used for method and property identifiers, such as strings or integers.
NPN_MemAlloc - Archive of obsolete content
you only need to use npn_memflush in situations where you cannot use npn_memalloc, for example, when calling system methods that allocate memory indirectly.
NPN_MemFlush - Archive of obsolete content
on the mac, you can use this method to free memory before calling memory-intensive system calls.
NPN_PostURL - Archive of obsolete content
for http urls only, the browser resolves this method as the http server method post, which transmits data to the server.
NPN_SetValue - Archive of obsolete content
normally, when the browser navigates away from the page containing the plugin, all plugin instances get an npp_destroy call, and if there are no more instances of the plugin active, the plugin calls its np_shutdown method and the plugin dll gets unloaded from memory.
NPN_Write - Archive of obsolete content
the browser makes a copy of the buffer if necessary, so the plug-in can free the buffer as the method returns, if desired.
NPObject - Archive of obsolete content
functions npn_createobject() npn_retainobject() npn_releaseobject() npn_invoke() npn_invokedefault() npn_evaluate() npn_getproperty() npn_setproperty() npn_removeproperty() npn_hasproperty() npn_hasmethod() npn_setexception() see also npclass ...
The First Install Problem - Archive of obsolete content
this document supplements the key parsing methodology suggested for installers.
Syndicating content with RSS - Archive of obsolete content
syndication (or web syndication) is a method which lets a web site make its content available for others to read, listen to, or watch.
Introduction to Public-Key Cryptography - Archive of obsolete content
the methods used to validate an identity vary depending on the policies of a given ca-just as the methods to validate other forms of identification vary depending on who is issuing the id and the purpose for which it will be used.
Threats - Archive of obsolete content
phishing is a method of a social engineering with the goal of obtaining sensitive data such as passwords, usernames, credit card numbers.
Building a Theme - Archive of obsolete content
extension and web authors are encouraged to use the installtrigger method to install xpis, as it provides the best experience to users.
Common Firefox theme issues and solutions - Archive of obsolete content
themes that use -moz-border-image and support both firefox 14 and newer as well as older versions of firefox need to use both the older and newer methodologies like the following example.
-ms-ime-align - Archive of obsolete content
the -ms-ime-align css property is a microsoft extension aligning the input method editor (ime) candidate window box relative to the element on which the ime composition is active.
CSS - Archive of obsolete content
ArchiveWebCSS
esthe -ms-hyphenate-limit-lines css property is a microsoft extension specifying the maximum number of consecutive lines in an element that may be ended with a hyphenated word.-ms-hyphenate-limit-zonethe -ms-hyphenate-limit-zone css property is a microsoft extension specifying the width of the hyphenation zone.-ms-ime-alignthe -ms-ime-align css property is a microsoft extension aligning the input method editor (ime) candidate window box relative to the element on which the ime composition is active.
Accessing XML children - Archive of obsolete content
list[1] = "green"; changes the xml document to read <foo> <bar baz="1">red</bar> <bar baz="2">green</bar> </foo> special types of nodes xml objects have methods for accessing xml lists of certain common types of nodes as well.
Introduction - Archive of obsolete content
what really happens with the {} notation is that the variables' tostring method is called, and the returned value is placed in the element.
Namespaces - Archive of obsolete content
namespace differs in its tostring method, and in that it has a prefix property instead of a localname property.
Iterator - Archive of obsolete content
methods iterator.prototype.next returns next item in the [property_name, property_value] format or property_name only.
Array.unobserve() - Archive of obsolete content
the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers.
Array comprehensions - Archive of obsolete content
2006, 2010, 2014]; [for (year of years) if (year > 2000) year]; // [2006, 2010, 2014] [for (year of years) if (year > 2000) if (year < 2010) year]; // [2006], the same as below: [for (year of years) if (year > 2000 && year < 2010) year]; // [2006] array comprehensions compared to map and filter an easy way to understand array comprehension syntax, is to compare it with the array map and filter methods: var numbers = [1, 2, 3]; numbers.map(function (i) { return i * i }); numbers.map(i => i * i); [for (i of numbers) i * i]; // all are [1, 4, 9] numbers.filter(function (i) { return i < 3 }); numbers.filter(i => i < 3); [for (i of numbers) if (i < 3) i]; // all are [1, 2] array comprehensions with two arrays using two for-of iterations to work with two arrays: var numbers = [1, 2, 3]; var ...
Enumerator - Archive of obsolete content
methods enumerator.atend returns a boolean value indicating if the enumerator is at the end of the collection.
GetObject - Archive of obsolete content
in the preceding example, you access properties and methods of the new object using the object variable myobject.
VBArray.getItem - Archive of obsolete content
the vbarray.getitem method returns the item at the specified location.
VBArray.toArray - Archive of obsolete content
the vbarray.toarray method returns a standard javascript array converted from a vbarray.
@cc_on - Archive of obsolete content
it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs because the capabilities of the compilers can be determined by using other methods.
@if - Archive of obsolete content
this is because the capabilities of the compilers can be determined by using other methods.
New in JavaScript 1.2 - Archive of obsolete content
arguments new properties function.arity new methods array.prototype.concat() array.prototype.slice() string.prototype.charcodeat() string.prototype.concat() string.fromcharcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import expo...
New in JavaScript 1.4 - Archive of obsolete content
new features in javascript 1.4 exception handling (throw and try...catch) in operator instanceof operator changed functionality in javascript 1.4 eval() changes (cannot be called indirectly and no longer a method of object) arguments not a property of functions deprecated function.arity in favor of function.length changes to liveconnect ...
New in JavaScript 1.6 - Archive of obsolete content
several new features were introduced: e4x, several new array methods, and array and string generics.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
arrow functions (firefox 22) generator function (firefox 26) yield (firefox 26) yield* (firefox 27) arguments[@@iterator] (firefox 46) other features binary and octal numeric literals (firefox 25) template strings (firefox 34) object initializer: shorthand property names (firefox 33) object initializer: computed property names (firefox 34) object initializer: shorthand method names (firefox 34) ...
New in JavaScript - Archive of obsolete content
includes ecmascript for xml (e4x), new array methods plus string and array generics.
Number.toInteger() - Archive of obsolete content
the number.tointeger() method used to evaluate the passed value and convert it to an integer, but its implementation has been removed.
Object.getNotifier() - Archive of obsolete content
the object.getnotifer() method was used to create an object that allows to synthetically trigger a change, but has been deprecated and removed in browsers.
Object.observe() - Archive of obsolete content
the object.observe() method was used for asynchronously observing the changes to an object.
Object.unobserve() - Archive of obsolete content
the object.unobserve() method was used to remove observers set by object.observe(), but has been deprecated and removed from browsers.
LiveConnect Reference - Archive of obsolete content
this section documents the java classes used for liveconnect, along with their constructors and methods.
java - Archive of obsolete content
you can automatically access it without using a constructor or calling a method.
netscape - Archive of obsolete content
you can automatically access it without using a constructor or calling a method.
sun - Archive of obsolete content
you can automatically access it without using a constructor or calling a method.
ParallelArray - Archive of obsolete content
methods map reduce scan scatter filter flatten partition get examples using map in parallel var p = new parallelarray([0, 1, 2, 3, 4]); var m = p.map(function (v) { return v + 1; }); ...
Window.importDialog() - Archive of obsolete content
summary because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog().
Mozilla XForms Specials - Archive of obsolete content
if you are wondering why we have this restriction, here is a simple example of why: <xforms:model> <xforms:instance src="http://intranetserver/addrbook.xml"/> <xforms:submission id="sub" action="http://megaspammer.com/gather" method="post"/> <xforms:send submission="sub" ev:event="xforms-ready"/> </xforms:model> this imaginary would fetch something that is only accessible for you (f.x.
Archived open Web documentation - Archive of obsolete content
you can opt in in html as follows: window.importdialog() because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog().
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
a fundamental mistake that many organizations make is to use proprietary methods, software, code, or standards.
Describing microformats in JavaScript - Archive of obsolete content
if it's virtual, the virtualgetter() method will be called to attempt to create the property if it doesn't exist.
Parsing microformats in JavaScript - Archive of obsolete content
methods datetimegetter() specifically retrieves a date from a microformat node.
Using the DOM File API in chrome code - Extensions
instead, use the nsifile::append() method as explained in the next section.
bootstrap.js - Extensions
the example below contains the required methods in vsdoc format.
2D collision detection - Game development
it's more complicated to implement than the above methods but is more powerful.
WebVR — Virtual Reality for the Web - Game development
get the devices to get information about devices connected to your computer, you can use the navigator.getvrdevices method: navigator.getvrdevices().then(function(devices) { for (var i = 0; i < devices.length; ++i) { if (devices[i] instanceof hmdvrdevice) { ghmd = devices[i]; break; } } if (ghmd) { for (var i = 0; i < devices.length; ++i) { if (devices[i] instanceof positionsensorvrdevice && devices[i].hardwareunitid === ghmd.hardwareunitid) { gpositionsensor = dev...
Desktop gamepad controls - Game development
then we can keep the track of the information about pressed buttons by using the gamepad.update() method, and react to the given information: update: function() { // ...
Unconventional controls - Game development
we next add these lines after all the event listeners for keyboard and mouse, but before the draw method: var todegrees = 1 / (math.pi / 180); var horizontaldegree = 0; var verticaldegree = 0; var degreethreshold = 30; var grabstrength = 0; right after that we use the leap's loop method to get the information held in the hand variable on every frame: leap.loop({ hand: function(hand) { horizontaldegree = math.round(hand.roll() * todegrees); verticaldegree = math.round(hand.pitc...
Crisp pixel art look with image-rendering - Game development
two downsides to this method are larger file sizes and compression artifacts.
Efficient animation for web games - Game development
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.
Finishing up - Game development
this produces a more efficient, smoother animation loop than the older setinterval() method.
Track the score and win - Game development
the font definition looks exactly like the one in css — you can set the size and font type in the font() method.
Bounce off the walls - Game development
add this line right after the existing game.physics.enable() method call: ball.body.collideworldbounds = true; now the ball will stop at the edge of the screen instead of disappearing, but it doesn't bounce.
Initialize the framework - Game development
the rendering method.
Player paddle and controls - Game development
to enable collision detection between the paddle and ball, add the collide() method to the update() function as shown: function update() { game.physics.arcade.collide(ball, paddle); } the first parameter is one of the objects we are interested in — the ball — and the second is the other one, the paddle.
Randomizing gameplay - Game development
it's a basic intro scratching the surface of the countless helpful methods that phaser provides.
Scaling - Game development
the phaser scale object there's a special scale object available in phaser with a few handy methods and properties available.
Win the game - Game development
var count_alive = 0; for (i = 0; i < bricks.children.length; i++) { if (bricks.children[i].alive == true) { count_alive++; } } if (count_alive == 0) { alert('you won the game, congratulations!'); location.reload(); } } we loop through the bricks in the group using bricks.children, checking for the aliveness of each with each brick's .alive() method.
API - MDN Web Docs Glossary: Definitions of Web-related terms
methods, properties, events, and urls) that a developer can use in their apps for interacting with components of a user's web browser, or other software/hardware on the user's computer, or third party websites and services.
ASCII - MDN Web Docs Glossary: Definitions of Web-related terms
ascii (american standard code for information interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form.
Abstraction - MDN Web Docs Glossary: Definitions of Web-related terms
example class implementabstraction { // method to set values of internal members set(x, y) { this.a = x; this.b = y; } display() { console.log('a = ' + this.a); console.log('b = ' + this.b); } } const obj = new implementabstraction(); obj.set(10, 20); obj.display(); // a = 10 // b = 20 learn more general knowledge abstraction on wikipedia ...
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
there is no guarantee that all attack methods have been discovered, but each algorithm is judged against known classes of attacks.
Cipher suite - MDN Web Docs Glossary: Definitions of Web-related terms
a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code.
Class - MDN Web Docs Glossary: Definitions of Web-related terms
class is a template definition of an object's properties and methods, the "blueprint" from which other more specific instances of the object are drawn.
Cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
therefore it also studies usage of cryptographic methods in context, cryptosystems.
Doctype - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge definition of the doctype in the html specification quirks mode and standards mode technical reference document.doctype, a javascript method that returns the doctype ...
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running.
Fallback alignment - MDN Web Docs Glossary: Definitions of Web-related terms
this is specified per alignment method, as detailed below.
Flex - MDN Web Docs Glossary: Definitions of Web-related terms
learn more property reference align-content align-items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Flexbox - MDN Web Docs Glossary: Definitions of Web-related terms
learn more property reference align-content align-items align-self flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set in a fetch headers object, or via xhr setrequestheader().
Grid Axis - MDN Web Docs Glossary: Definitions of Web-related terms
css grid layout is a two-dimensional layout method enabling the laying out of content in rows and columns.
Grid Cell - MDN Web Docs Glossary: Definitions of Web-related terms
if you do not place items using one of the grid placement methods, direct children of the grid container will be placed one into each individual grid cell by the auto-placement algorithm.
Guard - MDN Web Docs Glossary: Definitions of Web-related terms
guard is a feature of headers objects (as defined in the fetch spec, which affects whether methods such as set() and append() can change the header's contents.
Gutters - MDN Web Docs Glossary: Definitions of Web-related terms
margins, padding or the use of the space distribution properties in box alignment can all contribute to the visible gap – therefore the grid-gap properties should not be seen as equal to “the gutter size” unless you know that your design has not introduced any additional space with one of these methods.
HTTP/2 - MDN Web Docs Glossary: Definitions of Web-related terms
all the core concepts found in http 1.1, such as http methods, status codes, uris, and header fields, remain in place.
Inheritance - MDN Web Docs Glossary: Definitions of Web-related terms
as an app developer, you can choose which of the superclass's attributes and methods to keep and add your own, making class definition very flexible.
Parent object - MDN Web Docs Glossary: Definitions of Web-related terms
the object to which a given property or method belongs.
Parse - MDN Web Docs Glossary: Definitions of Web-related terms
javascript parsing is done during compile time or whenever the parser is invoked, such as during a call to a method.
Prototype-based programming - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based programming is a style of object-oriented programming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object.
Ruby - MDN Web Docs Glossary: Definitions of Web-related terms
ruby is also a method for annotating east asian text in html documents to provide pronunciation information; see the <ruby> element.
SEO - MDN Web Docs Glossary: Definitions of Web-related terms
seo methods fall into three broad classes: technical tag the content using semantic html.
Signature - MDN Web Docs Glossary: Definitions of Web-related terms
it may refer to: signature (functions) a function signature (or type signature, or method signature) defines input and output of functions or methods.
Transmission Control Protocol (TCP) - MDN Web Docs Glossary: Definitions of Web-related terms
tcp handshake the tcp three-way handshake, also called the tcp-handshake, three message handshake, and/or syn-syn-ack, is the method used by tcp to set up a tcp/ip connection over an ip-based network.
Type coercion - MDN Web Docs Glossary: Definitions of Web-related terms
to return this result, you'd have to explicitly convert the 5 to a number using the number() method: sum = number(value1) + value2; ...
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
webidl is the interface description language used to describe the data types, interfaces, methods, properties, and other components which make up a web application programming interface (api).
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
rtcdatachannel provides a method to set up a peer-to-peer data pathway between browsers.
XHR (XMLHttpRequest) - MDN Web Docs Glossary: Definitions of Web-related terms
its methods provide the ability to send network requests between the browser and a server.
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.
Array - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, arrays start at index zero and can be manipulated with various methods.
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
it compresses data using a combination of a modern variant of the lz77 algorithm, huffman coding, and second-order context modeling, providing a compression ratio comparable to the best currently available general-purpose compression methods.
JPEG - MDN Web Docs Glossary: Definitions of Web-related terms
jpeg (joint photographic experts group) is a commonly used method of lossy compression for digital images.
lossy compression - MDN Web Docs Glossary: Definitions of Web-related terms
lossy compression, or irreversible compression, is a data-compression method that uses inexact approximations and partial-data discarding to represent content.
Property (JavaScript) - MDN Web Docs Glossary: Definitions of Web-related terms
a property has a name (a string) and a value (primitive, method, or object reference).
Test your skills: CSS and JavaScript accessibility - Learn web development
explain what tools or methods you used to select the new values and test the code.
CSS and JavaScript accessibility best practices - Learn web development
t.innerhtml = ''; for(let i = 0; i < formitems.length; i++) { const testitem = formitems[i]; if(testitem.input.value === '') { errorfield.style.left = '360px'; createlink(testitem); } } if(errorlist.innerhtml !== '') { e.preventdefault(); } } note: in this example, we are hiding and showing the error message box using absolute positioning rather than another method such as visibility or display, because it doesn't interfere with the screen reader being able to read content from it.
Accessible multimedia - Learn web development
const rwdbtn = document.queryselector('.rwd'); const fwdbtn = document.queryselector('.fwd'); const timelabel = document.queryselector('.time'); next, we need to grab a reference to the video/audio player itself — add this line below the previous lines: const player = document.queryselector('video'); this holds a reference to a htmlmediaelement object, which has several useful properties and methods available on it that can be used to wire up functionality to our buttons.
Debugging CSS - Learn web development
taking a methodical approach, making a reduced test case, and explaining the issue to someone else will usually result in a fix being found.
Sizing items in CSS - Learn web development
when you move onto css layout, sizing will become very important in mastering the different layout methods, so it is worth understanding the concepts here before moving on.
Test your skills: floats - Learn web development
use the most up to date method available to cause the box background to extend to below the float as in the image.
Test Your Skills: Fundamental layout comprehension - Learn web development
in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Positioning - Learn web development
summary i'm sure you had fun playing with basic positioning; while it is not a method you would use for entire layouts, as you can see there are many tasks it is suited for.
Practical positioning examples - Learn web development
in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
What text editors are available? - Learn web development
the method varies based on your platform but it shouldn't be too hard: windows.
How do I start to design my website? - Learn web development
what we will present here is a simple method to handle what professionals call project ideation, project planning, and project management.
How do you upload your files to a web server? - Learn web development
other methods to upload files the ftp protocol is one well-known method for publishing a website, but not the only one.
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.
What is a URL? - Learn web development
a protocol is a set method for exchanging or transferring data around a computer network.
Advanced form styling - Learn web development
niceforms is a standalone javascript method that provides complete customization of web forms.
Basic native form controls - Learn web development
so for example when you click on the image at coordinate (123, 456) and it submits via the get method, you'll see the values appended to the url as follows: http://foo.com?pos.x=123&pos.y=456 this is a very convenient way to build a "hot map".
Example - Learn web development
a payment form html content <form method="post"> <h1>payment form</h1> <p>required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p> <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <label for="title_1"> <input type="radio" id="title_1" name="title" value="a"> ace </label> </li> <li> <label for="title_2"> <input type="radio" id="title_2" name="title" value="k" > king </label> </li> <li> <label for="title_3"> <input type="radio" id="title_3" name="title" value="q"> ...
Sending forms through JavaScript - Learn web development
the least complicated way of sending binary data is by using formdata's append() method, demonstrated above.
Example - Learn web development
a simple form html content <form action="/my-handling-form-page" method="post"> <div> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </div> <div> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </div> <div> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> css content form { /* just to center the form on the page */ margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: 1e...
Getting started with the Web - Learn web development
we outline a simple method you can follow to plan out your site's content and design.
Creating hyperlinks - Learn web development
read the get method to understand what url query notation is more commonly used for.
From object to iframe — other embedding technologies - Learn web development
plugins and these embedding methods are really a legacy technology, and we are mainly mentioning them in case you come across them in certain circumstances like intranets, or enterprise projects.
Video and audio content - Learn web development
restarting media playback at any time, you can reset the media to the beginning—including the process of selecting the best media source, if more than one is specified using <source> elements—by calling the element's load() method: const mediaelem = document.getelementbyid("my-media-element"); mediaelem.load(); detecting track addition and removal you can monitor the track lists within a media element to detect when tracks are added to or removed from the element's media.
HTML table advanced features and accessibility - Learn web development
</tbody> note: this method creates very precise associations between headers and data cells but it uses a lot more markup and does not leave any room for errors.
HTML table basics - Learn web development
LearnHTMLTablesBasics
html has a method of defining styling information for an entire column of data all in one place — the <col> and <colgroup> elements.
Introducing asynchronous JavaScript - Learn web development
an example of an async callback is the second parameter of the addeventlistener() method (as we saw in action above): btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); the first parameter is the type of event to be listened for, and the second parameter is a callback function that is invoked when the event is fired.
Asynchronous JavaScript - Learn web development
cooperative asynchronous javascript: timeouts and intervals here we look at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
Storing the information you need — Variables - Learn web development
troubleshooting javascript storing the information you need — variables basic math in javascript — numbers and operators handling text — strings in javascript useful string methods arrays assessment: silly story generator ...
What is JavaScript? - Learn web development
troubleshooting javascript storing the information you need — variables basic math in javascript — numbers and operators handling text — strings in javascript useful string methods arrays assessment: silly story generator ...
JavaScript First Steps - Learn web development
useful string methods now we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
Introducing JavaScript objects - Learn web development
in this article, we explore that difference, explain how prototype chains work, and look at how the prototype property can be used to add methods to existing constructors.
Measuring performance - Learn web development
a performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application.
Web performance - Learn web development
in this article we discuss the impact images have on performance, and the methods to reduce the number of bytes sent per image.
Properly configuring server MIME types - Learn web development
for a java servlet, you should have the line response.setcontenttype("text/html"); at the top of your doget or dopost method, where response is a reference to the httpservletresponse.
Introduction to the server side - Learn web development
the request includes a url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional information encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies.
Getting started with Ember - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Ember interactivity: Events, classes and state - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Ember resources and troubleshooting - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Routing in Ember - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Ember app structure and componentization - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Accessibility in React - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Getting started with React - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
React interactivity: Events and state - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Beginning our React todo list - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Starting our Svelte Todo list app - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Componentizing our Svelte app - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Deployment and next steps - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Getting started with Svelte - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Vue resources - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Styling Vue components with CSS - Learn web development
tting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, l...
Introduction to automated testing - Learn web development
each gulp task is written in the same basic format — gulp's task() method is run, and given two parameters — the name of the task, and a callback function containing the actual code to run to complete the task.
Strategies for carrying out testing - Learn web development
maybe we could use some javascript to implement a keyboard control for the toggle, or use some other method entirely?
Deploying our app - Learn web development
some deployment platforms will include a specific method for testing as part of their pipeline.
Accessibility API cross-reference
grid a composite widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys, e.g.
Accessibility information for UI designers and developers
see also: understanding sc 1.4.3: contrast the focus indicator users who navigate by keyboard (or other specialised input methods), rely on focus styles to see where they are on the page.
Software accessibility: Where are we today?
the basic concept is easy - dealing with information when you're blind is like seeing everything through a mail slot - sequentially and methodically.
Mozilla’s UAAG evaluation report
developers interested in this problem can look at the getalternatetext() method -- see the cvs history for suggestions.
Accessible Toolkit Checklist
eadonly, offscreen, focusable to avoid extra work, utilize implementing an msaa server mnemonics ability to define in xml for any widget with a text label (via attribute or a preceding char in label) automatically define mnemonics for all standard common dialogs (like yes/no confirmations and retry/exit error dialogs) support mnemonics in dialogs created via method calls layout engine - drawing underline under correct letter events - making keystrokes do the right thing msaa support, via iaccessible's get_acckeyboardshortcut support for ms windows settings when high contrast checkbox is set (in accessibility control panel, spi_gethighcontrast), or when user selects a "native" skin option in your software, then get all ...
Choosing the right memory allocator
these methods convert ns*string to nsimemory allocated, unowned [pruni]char* buffers.
Command line options
applications may be uninstalled per usual methods for your system.
Debugging on Mac OS X
target = frame.getthread().getprocess().gettarget() debugger = target.getdebugger() # delete our breakpoint (not actually necessary with `--one-shot true`): target.breakpointdelete(bp_loc.getbreakpoint().getid()) # for completeness, find and delete the dummy breakpoint (the breakpoint # lldb creates when it can't initially find the method to set the # breakpoint on): # bug workaround!
Adding APIs to the navigator object
each method below of adding new objects to the navigator object requires that the new object is a registered xpcom component.
The Firefox codebase: CSS Guidelines
avoid magic numbers; prefer automatic sizing or alignment methods.
Creating Custom Events That Can Pass Data
mozilla/content/events/src/nseventdispatcher.cpp note: in the mozilla 1.8.x branch this code is actually in mozilla/content/events/src/nseventlistenermanager.cpp this is quite an important file since this holds the createevent method which acts as a factory method dom events.
Gecko Logging
logging framework declaring a log module lazylogmodule defers the creation the backing logmodule in a thread-safe manner and is the preferred method to declare a log module.
Multiple Firefox profiles
the remaining profile assignment methods will remain the same.
Process scripts
if the above doesn't work try this: function contentmmfromcontentwindow_method2(acontentwindow) { return acontentwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidocshell) .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsicontentframemessagemanager); } ...
Firefox UI considerations for web developers
how an icon is selected the new tab page chooses icons to use for top sites by trying a series of methods until it obtains an icon to use: a global "top sites" list is checked.
HTMLIFrameElement.addNextPaintListener()
the addnextpaintlistener() method of the htmliframeelement is used to define a handler to listen for the next mozafterpaint event coming from the browser <iframe>.
HTMLIFrameElement.download()
the download() method of the htmliframeelement interface downloads a specified url, storing it at /sdcard/download.
HTMLIFrameElement.executeScript()
the executescript() method of the htmliframeelement interface allows a specified script to be executed against a page loaded in the browser <iframe>.
HTMLIFrameElement.getActive()
the getactive() method of the htmliframeelement indicates whether the current browser <iframe> is the currently active frame.
HTMLIFrameElement.getCanGoBack()
the getcangoback() method of the htmliframeelement interface is used to indicate whether it's possible to go back in the navigation history of the browser <iframe>.
HTMLIFrameElement.getCanGoForward()
the getcangoforward() method of the htmliframeelement is used to indicate whether it's possible to go forward in the navigation history of the browser <iframe>.
HTMLIFrameElement.getContentDimensions()
the getcontentdimensions() method of the htmliframeelement interface retrieves the x and y dimensions of the content window.
HTMLIFrameElement.getManifest()
the getmanifest() method of the htmliframeelement interface retrieves the manifest of an app loaded in the browser <iframe> and returns it as json.
HTMLIFrameElement.getScreenshot()
the getscreenshot() method of the htmliframeelement lets you request a screenshot of a content <iframe>, scaled to fit within a specified maximum width and height.
HTMLIFrameElement.getStructuredData()
the getstructureddata() method of the htmliframeelement interface retrieves any structured microdata (and hcard and hcalendar microformat data) contained in the html loaded in the browser <iframe> and returns it as json.
HTMLIFrameElement.getVisible()
the getvisible() method of the htmliframeelement is used to request the current visible state of the browser <iframe>.
mozbrowsercaretstatechanged
senddocommandmsg a method allowing you to issue a command via an anonymouse function, i.e.
mozbrowserclose
the mozbrowserclose event is fired when the content of a browser <iframe> calls the window.close() method.
mozbrowsercontextmenu
method a domstring representing the method of a form, in the case of a form context menu.
mozbrowserfindchange
the mozbrowserfindchange event is fired when a search method is invoked in the browser <iframe> content.
mozbrowseropenwindow
the mozbrowseropenwindow event is fired when a new window is required — usually when the content of a browser <iframe> successfully calls the window.open() method, or the user clicks on a link with an unknown target.
HTMLIFrameElement.mute()
MozillaGeckoChromeAPIBrowser APImute
the mute() method of the htmliframeelement mute any audio playing in the browser <iframe>.
HTMLIFrameElement.purgeHistory()
the purgehistory() method of the htmliframeelement interface is used to clear the browsing history associated with the browser <iframe>.
HTMLIFrameElement.reload()
the reload() method of the htmliframeelement interface is used to reload the content of the <iframe>.
HTMLIframeElement.removeNextPaintListener()
the removenextpaintlistener() method of the htmliframeelement interface is used to remove a handler previously set with the addnextpaintlistener method.
HTMLIFrameElement.sendMouseEvent()
the sendmouseevent() method of the htmliframeelement interface allows you to fake a mouse event and send it to the browser <iframe>'s content.
HTMLIFrameElement.setActive()
the setactive() method of the htmliframeelement sets the current <iframe> as the active frame, which has an effect on how it is prioritized by the process manager.
HTMLIFrameElement.setVolume()
the setvolume() method of the htmliframeelement sets the current volume of the browser <iframe>.
HTMLIFrameElement.stop()
MozillaGeckoChromeAPIBrowser APIstop
the stop() method of the htmliframeelement interface is used to stop loading the content of the <iframe>.
HTMLIFrameElement.unmute()
the unmute() method of the htmliframeelement unmutes any audio playing in the browser <iframe>.
HTMLIFrameElement.zoom()
MozillaGeckoChromeAPIBrowser APIzoom
the zoom() method of the htmliframeelement interface changes the zoom factor of the browser <iframe>'s content.
Chrome-only Events reference
mozbeforepaintgecko 2.0 adds a new method for performing javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.mozscrolledareachangedthe mozscrolledareachanged event is fired when the document view has been scrolled or resized.
Embedding the editor
nsieditorframe should contain methods for getting the editing session, and doing some generic editor-related stuff (probably common to html and plain text editing).
Geckoview-Junit Tests
tests can also be conditionally skipped using junit's assume or assumethat methods.
Getting from Content to Layout
the restyles accumulated in the restyletracker are dispensed with from various method on the presshell that involve reflow and flushing notifications.
How to get a stacktrace for a bug report
in these cases you will need to use one of the alternative methods listed below.
How to get a stacktrace with WinDbg
copying and pasting each line is the easiest method to avoid mistakes some commands start with a period (.) or a pipe character (|), which is required.
How to implement a custom autocomplete search component
t_registered; } return simpleautocompletesearchfactory; } you need to explicitly register the component by adding these lines into your chrome.manifest file: component {6224daa1-71x2-4d1a-ad90-01ca1c08e323} components/.js contract @mozilla.org/autocomplete/search;1?name=simple-autocomplete {6224daa1-71x2-4d1a-ad90-01ca1c08e323} you need to add the following method: getlabelat: function(index) { return this._results[index]; } to simpleautocompleteresult use this newly available component in a xul file like this: <textbox id="text1" type="autocomplete" autocompletesearch="simple-autocomplete" showcommentcolumn="true" autocompletesearchparam='[{"value":"mark","comment":"cool dude"},{"value":"mary","comment":"nice lady"},{"va...
How to Report a Hung Firefox
all os as long as you do not need to be in firerfox's safe mode, a user friendly method of crashing firefox is to install and use the addon crash me now!
IPDL Type Serialization
iter, &(aresult->j))) return false; for (int i = 0; i < 4; ++i) if (!readparam(amsg, aiter, &(aresult->k[i]))) return false; return true; } }; } // namespace ipc once you have a serializer for a type, you can serialize a collection of it (ex: an nstarray<examplestruct>) by simply declaring "using nstarray<examplestruct>;' in your ipdl file, then using it in a ipc method.
Implementing Download Resuming
if the download gets interrupted, necko will call the stream listener's onstoprequest method with a failure status.
TypeListener
method overview void ontypeadded(in addontype type) void ontyperemoved(in addontype type) methods ontypeadded() called when an add-on type has been added.
UpdateCheckListener
method overview void onupdatecheckcomplete(in updateinfo results[]) void onupdatecheckerror(in integer status) methods onupdatecheckcomplete() called when the update check completed successfully.
AsyncShutdown.jsm
methods overview void addblocker(string name, function|promise condition, optional function info) boolean removeblocker(function|promise condition) methods addblocker () register a blocker for the completion of a phase.
Widget Wrappers
group wrapper methods forwindow() a method to obtain a single window wrapper for a widget, in the window awindow passed as the only argument.
Examples
when newpromise is fulfilled, nothing happens, because no fulfillment callback is specified and the return value of the last then method is ignored.
Sqlite.jsm
callers should not attempt to use the connection after calling this method as the connection will be unusable.
Using JavaScript code modules
once this method has been called, references to the module will continue to work but any subsequent import of the module will reload it and give a new reference.
Webapps.jsm
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...
openLocationLastURL.jsm
using the openlocationlasturl object to get or set the value of the open location edit box, simply read the value of, or set the value of, the openlocationlasturl.value field: var url = openlocationlasturl.value; openlocationlasturl.value = "http://www.mozilla.org/"; to reset the value of the edit box to the default (which is an empty string), you can call the reset() method: method overview reset() methods reset the reset() method resets the saved url to the default, which is an empty string.
Localization content best practices
given the diversity of tools used by localization teams, this is the only reliable method to ensure that localizers update existing localizations.
Creating localizable web applications
it a safer method.
Mozilla Web Services Security Model
allow all services on a site to be accessed from any web page note that this is only a sensible thing to do if nothing on the site serves content based on cookies, http authentication, ip address / domain origin, or any other method of authentication.
mozilla::CondVar
#include "condvar.h" methods constructor condvar(mutex& amutex, const char* aname) initialize the condvar with its associated mutex and a name to reference it by.
mozilla::Monitor
methods enter() enter the monitor.
mozilla::MonitorAutoEnter
methods wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on the underlying monitor until it is notifyed.
mozilla::Mutex
#include <mozilla/mutex.h> methods constructor mutex(const char* aname) initialize the mutex with a name that can reference it.
mozilla::MutexAutoLock
methods none.
mozilla::MutexAutoUnlock
methods none.
GC and CC logs
to set the environment variable, find the buildbrowserenv method in the python file for the test suite you are interested in, and add something like this code to the file: browserenv["moz_cc_log_directory"] = os.environ["moz_upload_dir"] browserenv["moz_cc_log_shutdown"] = "1" analyzing gc and cc logs there are numerous scripts that analyze gc and cc logs on github.
JS::PerfMeasurement
static bool perfmeasurement::canmeasuresomething() this class method returns true if and only if some -- not necessarily all -- events can be measured by the current build of spidermonkey, running on the current os.
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.
Patches and pushes
//www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrguum/ft+uwaaow==</image> ***this tag is optional***<url type="application/x-suggestions+json" method="get" template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchterms}" />*** <url type="text/html" method="get" template="http://search.yahoo.com/search"> <param name="p" value="{searchterms}"/> <param name="ei" value="utf-8"/> <mozparam name="fr" condition="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> create...
Profile Manager
see http://kb.mozillazine.org/profile_manager#accessing_the_profile_manager for an alternative method of managing profiles.
Dynamic Library Linking
it also provides a method by which to condition symbols of statically linked code so that to other clients it appears as though they are dynamically loaded.
NSPR Error Handling
pr_invalid_method_error the preceding function is invalid for the type of file descriptor used.
PR_PushIOLayer
if the containers are allocated by some method other than pr_createiolayerstub, it may be required that the stack have the layers popped off (in reverse order that they were pushed) before calling pr_close.
PR_dtoa
description this function converts the specified floating point number to a string, using the method specified by mode.
NSS Code Coverage
- total blocks in file (there is no trivial method to get this number without tcov).
4.3.1 Release Notes
this default setting can also be changed within the application by using the following jss methods: sslserversocket.enablerenegotiation(int mode) sslsocket.enablerenegotiation(int mode) sslsocket.enablerenegotiationdefault(int mode) the mode of renegotiation that the peer must use can be set to the following: sslsocket.ssl_renegotiate_never - never renegotiate at all.
JSS Provider Notes
this method exports key material in plaintext and is therefore insecure.
Mozilla-JSS JCA Provider notes
this method exports key material in plaintext and is therefore insecure.
Using JSS
MozillaProjectsNSSJSSUsing JSS
initialize jss in your application before calling any jss methods, you must initialize jss by calling one of the cryptomanager.initialize methods.
NSS 3.12.4 release notes
new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75.
NSS Sample Code Sample_1_Hashing
l; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); ...
Hashing - sample 1
; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); ...
sample1
limit = i % 16; } } if (column != level) { newline(out); } } /* prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprintf(stderr, hash_names[htype].hashname); if (htype == (hash_algtotal - 2)) fprintf(stderr, " or "); else if (htype != (hash_algtotal - 1)) fprintf(stderr, ", "); } fprintf(stderr, " (case ignored)...
nss tech note5
see method1 and method2 ).
PKCS11 module installation
this article covers the two methods for installing pkcs #11 modules into firefox.
NSS tools : crlutil
implemented extensions the extensions defined for crl provide methods for associating additional attributes with crls of theirs entries.
sslerr.html
trying the same operation again might succeed." sec_error_pkcs11_device_error -8023 "a pkcs #11 module returned ckr_device_error, indicating that a problem has occurred with the token or slot." sec_error_bad_info_access_method -8022 "unknown information access method in certificate extension." sec_error_crl_import_failed -8021 "error attempting to import a crl." sec_error_unknown_pkcs11_error -8018 "unknown pkcs #11 error." (unknown error value mapping) ...
sslfnc.html
initializing multi-processing with a shared ssl server cache to start a multi-processing application, the initial parent process calls ssl_configmpserversidcache, and then creates child processes, by one of these methods: call fork and then exec (unix) call createprocess (win32) call pr_createprocess (both unix and win32) it is essential that the parent allow the child to inherit the file descriptors.
sslintro.html
a legal nspr socket is required to be passed to ssl_importfd, whether it is created with this function or by another method.
NSS Tools crlutil
implemented extensions the extensions defined for crl provide methods for associating additional attributes with crls of theirs entries.
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
implemented extensions the extensions defined for crl provide methods for associating additional attributes with crls of theirs entries.
Multithreading in Necko
as with the socket transport thread, the nsistreamlistener passed to a file transport's asyncread method can operate partially on the file transport's thread before proxying data to the main thread.
Rhino serialization
use the addexcludedname method of scriptableoutputstream to add new names.
Rhino shell
sync(function) creates a synchronized function (in the sense of a java synchronized method) from an existing function.
FOSS
http://code.google.com/p/gpsee/ - commonjs platform, native-language module interoperability methods, modules, etc.
JS::Add*Root
all the js::add*root methods are idempotent: multiple calls for the same address will add only one root.
JS::AutoIdArray
methods method description bool operator!() const return true if this has no owned array.
JS::AutoVectorRooter
syntax js::autovectorrooter(jscontext* cx); methods method description size_t length() const returns the length of the array.
JS::HandleValueArray
methods method description size_t length() const returns the length of the array.
JS::ToPrimitive
hint jstype the hint to pass to the toprimitive and @@toprimitive method when converting the object.
JSConvertOp
if you do not use the js_convertvalue method, you may omit support for other types.
JSExtendedClass
a c/c++ program can use a jsextendedclass with the js_initclass and js_newobject apis to create objects that have custom methods and properties implemented in c/c++.
JSExtendedClass.wrappedObject
the specific cases where this happens are: the default tostring method returns a string that contains the name of the wrapped object's class rather than the wrapper's class.
JSFUN_GLOBAL_PARENT
syntax jsfun_global_parent see also jsfun_bound_method ...
JSFreeOp
methods method description jsruntime *runtime() const returns a pointer to jsruntime passed to constructor.
JSNative
in particular, apis such as js_initclass and js_definefunctions create custom methods on javascript objects that are implemented as jsnative callbacks provided by the application, written in c/c++ code.
JSObject
an object inherits properties, including methods, from its prototype (which is another object).
JSPRINCIPALS_HOLD
if the reference count drops to 0, indicating that no one is using the object anymore, jsprincipals_drop also deallocates principals by calling its destroy method.
JSString
working with jsstring objects (add a list of links to methods here, maybe some text) ...
JS_Add*Root
all the js_add*root methods are idempotent: multiple calls for the same address will add only one root.
JS_CompileFunctionForPrincipals
see also mxr id search for js_compilefunctionforprincipals mxr id search for js_compileucfunctionforprincipals jsfun_bound_method jsfun_global_parent js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_decompilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_valuetofunction bug 938907 ...
JS_ConstructObject
a less-preferred short-term solution might be to use this reimplementation of the method, but note that this reimplementation is not guaranteed to continue working across spidermonkey releases.
JS_DefineProperties
ps const jspropertyspec * pointer to the first element of an array containing names, ids, flags, and getproperty and setproperty method for the properties to create.
JS_ForwardGetPropertyTo
onbehalfof is receiver in [[get]] internal method of proxy, defined in es2015 draft spec (rev 29, 9.5.8).
JS_GET_CLASS
the js_get_class abstracted away signature differences in the js_getclass method in threadsafe and non-threadsafe builds.
JS_GetArrayPrototype
note: this expression might have different values over time if the global array property is modified, but this method returns only the original value.
JS_GetFunctionCallback
note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls.
JS_GetFunctionPrototype
note: this expression might have different values over time if the global function property is modified, but this method returns only the original value.
JS_GetObjectPrototype
note: this expression might have different values over time if the global object property is modified, but this method returns only the original value.
JS_GetPrivate
getters, setters, and methods of custom classes should use js_getinstanceprivate instead to avoid this danger.
JS_GetProperty
if the property is found on a non-native object, get handler of proxy (only if the object is a proxy) or its jsobjectops.getproperty method is called.
JS_LooselyEqual
if the comparison attempt was successful, the method returns js_true and stores the result in *equal; otherwise it returns js_false.
JS_NewDependentString
the new string contains the same characters as if it were created with the javascript method str.substr(start, length).
JS_ParseJSON
the parsing rules applied by these methods are exactly those specified by ecmascript 5.
JS_SameValue
this method is infallible.
JS_SetBranchCallback
the engine does not execute finally blocks in this case; this is the same behavior as any native method or callback.
JS_SetCheckObjectAccessCallback
description js_setcheckobjectaccesscallback sets the runtime-wide check-object-access callback, which is used as the fallback jsclass.checkaccess method for all classes that leave the checkaccess field null.
JS_SetErrorReporter
you can work around this by using the js_setruntimeprivate and js_getruntimeprivate methods.
JS_SetOperationCallback
these methods/types are renamed to js_setinterruptcallback, js_getinterruptcallback, js_requestinterruptcallback and jsinterruptcallback in spidermonkey 30.
JS_StrictlyEqual
if the comparison attempt was successful, the method returns true and stores the result in *equal; otherwise it returns false.
JS_ValueToFunction
the object's jsobjectops.defaultvalue method is called with hint=jstype_function.) js_valuetofunction returns a pointer to the converted function.
JS_ValueToNumber
otherwise, the resulting object's tostring method, if any, is called.
jsid
a jsid is a javascript identifier for a property or method of an object.
SpiderMonkey 1.8.5
support for extended class methods (in particular, jsequalityop) has been removed.
SpiderMonkey 45
s_shutdown has moved from jsapi.h to js/initialization.h js_initreflect is now implicit js_addweakpointercallback is replaced with js_addweakpointerzonegroupcallback and js_addweakpointercompartmentcallback js_removeweakpointercallback is replaced with js_removeweakpointerzonegroupcallback and js_removeweakpointercompartmentcallback api changes javascript shell changes detail added/removed methods here...
Mozilla Projects
once midas is invoked, a few more methods of the document object become available.
Secure Development Guidelines
using the mozilla api mozilla c++ style strings are less prone to buffer overflows and 0-termination issues every string derived from the abstract base class nsastring common read-only methods length() isempty() equals() common methods for modifying the string assign() append() insert() truncate() checking return values often causes problems return value not handled certain cases not handled or interpreted incorrectly double meaning malloc() can return a pointer or null, but null by itself is a valid address checking return va...
Animated PNG graphics
MozillaTechAPNG
it utilizes the same bit depth, color type, compression method, filter method, interlace method, and palette (if any) as the default image.
Gecko object attributes
« at apis support page introduction you can obtain object attributes by nsiaccessible.getattributes() method.
History Service Design
in case the database has been created for the first time history service will create all tables, indexes and triggers, calling related inittables static methods of other dependant services.
The Publicity Stream API
publicizeactivity( <activity>, [ { [ onsuccess: <function> ], [ onerror: <function> ] } ]): applications should call this method when an user-initiated activity deemed attractive to potential consumers occurs.
XPCOM glue
MozillaTechXPCOMGlue
it allows developers to link only against the frozen xpcom method symbols and maintain compatibility with multiple versions of xpcom.
How to build an XPCOM component in JavaScript
implementation this example component will expose a single method, which returns the string "hello world!".
XPCOM changes in Gecko 2.0
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.
Setting up the Gecko SDK
lthing(); protected: /* additional members */ nsstring mname; }; #endif cspecialthing.cpp #include "cspecialthing.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspecialthing() { /* destructor code */ } /* attribute astring name; */ ns_imethodimp cspecialthing::getname(nsastring & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsastring & aname) { mname.assign(aname); return ns_ok; } /* long add (in long a, in long b); */ ns_imethodimp cspecialthing::add(print32 a, print32 b, print32 *_retval) { *_retval = a + b; return ns_ok; } this is generally your code.
Detailed XPCOM hashtable guide
use the put(), get(), and remove() methods to alter the table.
mozilla::services namespace
the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.
XPCOM guide
MozillaTechXPCOMGuide
mozilla::services namespacethe services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.receiving startup notificationssometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.xpcom array guidemozilla has many array classes because each array is optimized for a particular usage pattern.
Components.ID
syntax var interfaceid = [ new ] components.id(iid); parameters iid a string of the format '{00000000-0000-0000-0000-000000000000}' giving the interface id of the interface description components.id creates interface ids for use in implementing methods like queryinterface, getinterfaces, and other methods that take interface ids as parameters.
Components.manager
the scriptable methods on the nsicomponentmanager interface can be called directly on this object.
Components.utils.Sandbox
methods available on the sandbox object dump() - similar to window.dump().
Components.utils.getGlobalForObject
this method is used to determine the global object with which an object is associated.
Components.utils.schedulePreciseGC
this method lets scripts schedule a garbage collection cycle.
Using components
nterfacesbyid=[object nsxpccomponents_interfacesbyid] classesbyid=[object nsxpccomponents_classesbyid] stack=js frame :: scratchpad/4 :: cdump :: line 8 manager=[xpconnect wrapped nsicomponentmanager] id=[object nsxpccomponents_id] exception=[object nsxpccomponents_exception] reporterror=function reporterror() { [native code] } cancreatewrapper=function cancreatewrapper() { [native code] } cancallmethod=function cancallmethod() { [native code] } cangetproperty=function cangetproperty() { [native code] } cansetproperty=function cansetproperty() { [native code] } ...
XPConnect
wrappers what sorts of wrappers xpconnect generates and uses xpconnect security membranes tools xpcshell join the xpcom community choose your preferred method for joining the discussion: mailing list newsgroup rss feed irc: #developers (learn more)tools: javascript component wizard, visual c++ component wizard, visual c++ component wizard for visual studio 2010 ...
NS_GetMemoryManager
any code, intended to be used exclusively with mozilla 1.8 and above, may use ns_alloc, ns_realloc, and ns_free instead to access the xpcom memory manager's methods.
NS_InitXPCOM2
some of the possible errors are documented below: ns_error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before xpcom's static initialization code executes.
NS_InitXPCOM3
some of the possible errors are documented below: ns_error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before xpcom's static initialization code executes.
Folders
folders have a number of interesting attributes: parent subfolder server uri flags and methods getdatabase ( how to get a database of the messages in the folder.) updatefolder (gets new messages for that folder, if applicable, e.g., pop3 inboxes, imap folders, news folders, rss folders) ...
NS_POSTCONDITION
should be used to test conditions that are guaranteed to be produced by a method.
NS_PRECONDITION
should be used to test conditions that the caller of a method ought to ensure.
BeginReading
the length of the array is determined by the result of the length method.
BeginReading
the length of the array is determined by the result of the length method.
nsAutoRefTraits
when the handle to the resource is a pointer to t the specialization may be derived from nspointerreftraits<t>, so that only definitions of the release(t*) static method and possibly the addref(t*) static method need to be added.
nsCStringEncoding
the native filesystem charset applies to strings passed to the "native" method variants on nsifile and nsilocalfile.
IAccessibleApplication
method overview [propget] hresult appname([out] bstr name ); [propget] hresult appversion([out] bstr version ); [propget] hresult toolkitname([out] bstr name ); [propget] hresult toolkitversion([out] bstr version ); methods appname() returns the application name.
IAccessibleComponent
method overview [propget] hresult background([out] ia2color background ); [propget] hresult foreground([out] ia2color foreground ); [propget] hresult locationinparent([out] long x, [out] long y ); methods background() returns the background color of this object.
IAccessibleHypertext
method overview [propget] hresult hyperlink([in] long index, [out] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlinkindex([in] long charindex, [out] long hyperlinkindex ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the specified link.
IAccessibleImage
method overview [propget] hresult description([out] bstr description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods description() returns the localized description of the image.
IAccessibleRelation
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) method overview [propget] hresult localizedrelationtype([out] bstr localizedrelationtype ); [propget] hresult ntargets([out] long ntargets ); [propget] hresult relationtype([out] bstr relationtype ); [propget] hresult target([in] long targetindex, [out] iunknown target ); [propget] hresult targets([in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ntargets ); methods localizedrelationtype() returns a localized version of the relation type.
IJSDebugger
method overview [implicit_jscontext] void addclass(); methods addclass() defines the global debugger constructor.
amIInstallCallback
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void oninstallended(in astring aurl, in print32 astatus); methods oninstallended() called when an install completes or fails.
imgICache
method overview void clearcache(in boolean chrome); nsiproperties findentryproperties(in nsiuri uri); void removeentry(in nsiuri uri); methods clearcache() evict images from the cache.
mozIRepresentativeColorCallback
toolkit/components/places/mozicoloranalyzer.idlscriptable provides callback methods for mozicoloranalyzer 1.0 66 introduced gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) method overview void oncomplete(in boolean success, [optional] in unsigned long color); methods oncomplete() will be called when color analysis finishes.
mozIStorageCompletionCallback
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview void complete(); methods complete() called when an asynchronous storage routine has completed.
mozIStorageProgressHandler
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview boolean onprogress(in mozistorageconnection aconnection); methods onprogress() the onprogress() method is called periodically while an sqlite operation is ongoing.
mozIStorageResultSet
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview mozistoragerow getnextrow(); methods getnextrow() returns the next row from the result set.
mozIStorageRow
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: mozistoragevaluearray method overview nsivariant getresultbyindex(in unsigned long aindex); nsivariant getresultbyname(in autf8string aname); methods getresultbyindex() returns the value from a specific column in the row, using a zero-based index to identify the column.
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.
DoAction
« nsiaccessible page summary this method performs the accessible action at the given zero-based index.
GetAccessibleAbove
« nsiaccessible page summary this method returns an accessible node geometrically above this one.
GetAccessibleBelow
« nsiaccessible page summary this method returns an accessible node geometrically below this one.
GetAccessibleRelated
« nsiaccessible page summary this method returns an accessible related to this one by the given relation type.
GetAccessibleToLeft
« nsiaccessible page summary this method returns an accessible node geometrically to the left of this one.
GetAccessibleToRight
« nsiaccessible page summary this method returns an accessible node geometrically to the right of this one.
GetActionDescription
« nsiaccessible page summary this method retrieves the description (localized name) of the accessible action at the given zero-based index.
GetActionName
« nsiaccessible page summary this method retrieves the name of the accessible action at the given zero-based index.
GetBounds
« nsiaccessible page summary this method returns accessible's (x and y) coordinates relative to the screen and accessible's width and height.
GetChildAt
« nsiaccessible page summary this method returns nth accessible child using zero-based index.
GetChildAtPoint
« nsiaccessible page summary this method returns an accessible child which contains the coordinate at (x, y) in screen pixels.
GetKeyBindings
« nsiaccessible page summary this method provides array of localized string of global keyboard accelerator for the given action index supported by accessible.
GetRelation
« nsiaccessible page summary this method returns accessible relation for this accessible object by index.
GetRelations
« nsiaccessible page summary this method returns multiple accessible relations for this accessible object.
GetState
« nsiaccessible page summary this method retrieves states of the accessible.
GroupPosition
« nsiaccessible page summary this method returns grouping information.
SetSelected
« nsiaccessible page summary this method adds or remove this accessible to the current selection.
TakeFocus
« nsiaccessible page summary this method focuses this accessible node.
TakeSelection
« nsiaccessible page summary this method selects this accessible node only.
nsIAccessibleTreeCache
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview nsiaccessible getcachedtreeitemaccessible(in long arow, in nsitreecolumn acolumn); void invalidatecache(in long arow, in long acount); void treeviewchanged(); void treeviewinvalidated(in long astartrow, in long aendrow, in long astartcol, in long aendcol); methods getcachedtreeitemaccessible() returns the tree item from the cache for the cell in the specified row and colum...
nsIAsyncStreamCopier
inherits from: nsirequest last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void asynccopy(in nsirequestobserver aobserver, in nsisupports aobservercontext); void init(in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation.
nsIAuthPromptAdapterFactory
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiauthprompt2 createadapter(in nsiauthprompt aprompt); methods createadapter() wrap an object implementing nsiauthprompt so that it's usable via nsiauthprompt2.
nsIAutoCompleteObserver
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void onsearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); void onupdatesearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); methods onsearchresult() called when a search is complete and the results are ready.
nsIAutoCompleteSearch
method overview void startsearch(in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener); void stopsearch(); methods startsearch() search for a given string and notify a listener (either synchronously or asynchronously) of the result.
nsIBadCertListener2
method overview boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status.
nsIBlocklistPrompt
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 prompt([array, size_is(acount)] in nsivariant aaddons, [optional] in pruint32 acount); methods prompt() prompt the user about newly blocked addons.
nsICRLManager
inherits from: nsisupports last changed in gecko 1.7 method overview wstring computenextautoupdatetime(in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays); void deletecrl(in unsigned long crlindex); nsiarray getcrls(); void importcrl([array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( i...
nsICacheMetaDataVisitor
inherits from: nsisupports last changed in gecko 1.7 method overview boolean visitmetadataelement(in string key, in string value); methods visitmetadataelement() this method is called for each key/value pair in the meta data for a cache entry.
nsICancelable
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 cancel(in nsresult areason); methods cancel() call this method to request that this object abort whatever operation it may be performing.
nsICharsetResolver
inherits from: nsisupports last changed in gecko 1.7 method overview void notifyresolvedcharset(in acstring charset, in nsisupports closure); acstring requestcharset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notifyresolvedcharset() some implementations may request that they be notified when the charset is actually detected.
nsIChromeFrameMessageManager
1.0 66 introduced gecko 2.0 inherits from: nsiframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void loadframescript(in astring aurl, in boolean aallowdelayedload); void removedelayedframescript(in astring aurl); methods loadframescript() loads a script into the remote frame.
nsIClipboardCommands
inherits from: nsisupports last changed in gecko 1.7 method overview boolean cancopyimagecontents(); boolean cancopyimagelocation(); boolean cancopylinklocation(); boolean cancopyselection(); boolean cancutselection(); boolean canpaste(); void copyimagecontents(); void copyimagelocation(); void copylinklocation(); void copyselection(); void cutselection(); void paste(); void selectall(); void selectnone(); methods cancopyimagecontents() returns whether we can copy an...
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.
nsIClipboardOwner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void losingownership(in nsitransferable atransferable); methods losingownership() this method notifies the owner of the clipboard transferable that the transferable is being removed from the clipboard.
nsICollection
inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection.
nsICommandController
to create an instance, use: var commandcontroller = components.classes["@mozilla.org/embedcomp/base-command-controller;1"] .createinstance(components.interfaces.nsicommandcontroller); method overview void docommandwithparams(in string command, in nsicommandparams acommandparams); void getcommandstatewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsicommandparams object.
nsIConsoleListener
inherits from: nsisupports last changed in gecko 1.7 method overview void observe(in nsiconsolemessage amessage); methods observe() called by the nsiconsoleservice when a message is posted to the console.
nsIContentFrameMessageManager
methods void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the specified string to standard output.
nsIContentPrefObserver
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void oncontentprefremoved(in astring agroup, in astring aname); void oncontentprefset(in astring agroup, in astring aname, in nsivariant avalue); methods oncontentprefremoved() called when a content preference is removed.
nsIContentSniffer
method overview acstring getmimetypefromcontent(in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength); methods getmimetypefromcontent() given a chunk of data, determines a mime type.
nsICookieConsent
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void getconsent(); methods getconsent() gives a decision on what should be done with a cookie, based on a site's p3p policy and the user's preferences.
nsICookieStorage
last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store.
nsICurrentCharsetListener
to create an instance, use: var currentcharsetlistener = components.classes["@mozilla.org/intl/currentcharsetlistener;1"] .createinstance(components.interfaces.nsicurrentcharsetlistener); method overview void setcurrentcharset(in wstring charset); void setcurrentcomposercharset(in wstring charset); void setcurrentmailcharset(in wstring charset); methods setcurrentcharset() void setcurrentcharset( in wstring charset ); parameters charset setcurrentcomposercharset() void setcurrentcomposercharset( in wstring charset ); parameters charset setcurrentmailcharset() void s...
nsIDNSListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onlookupcomplete(in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlookupcomplete() called when an asynchronous host lookup completes.
nsIDNSRequest
inherits from: nsisupports last changed in gecko 1.7 method overview void cancel(); methods cancel() called to cancel a pending asynchronous dns request.
nsIDOMClientRect
the type of box is specified by the method that returns such an object.
nsIDOMEventGroup
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.
nsIDOMFile
this will likely change in the future, so avoid using any non-standard methods offered by this interface in order to ensure future compatibility.
nsIDOMFileException
the nsidomfileexception interface represents exceptions that can be raised by calls to the methods in the nsidomfile interface.
nsIDOMGeoPositionCallback
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeoposition position); methods handleevent() called when new position information is available.
nsIDOMGeoPositionErrorCallback
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.
nsIDOMGlobalPropertyInitializer
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.
nsIDOMHTMLAudioElement
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.
nsIDOMSerializer
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.
nsIDOMStorageList
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.
nsIDataSignatureVerifier
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean verifydata(in acstring adata, in acstring asignature, in acstring apublickey); methods verifydata() verifies that the data matches the data that was used to generate the signature.
nsIDebug
method overview void abort(in string afile, in long aline); void assertion(in string astr, in string aexpr, in string afile, in long aline); void break(in string afile, in long aline); void warning(in string astr, in string afile, in long aline); methods abort() requests the process to trigger a fatal abort.
nsIDeviceMotionListener
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void onmotionchange(in nsidevicemotiondata amotiondata); methods onmotionchange() called when new orientation or acceleration data is available.
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 ...
nsIDictionary
method overview boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void clear(); methods haskey() check if a given key is present in the dictionary.
nsIDirIndexListener
they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onindexavailable(in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex); void oninformationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods onindexavailable() called for each directory entry.
nsIDirectoryIterator
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in nsifilespec parent, in boolean resolvesymlink); boolean exist(); void next(); attributes attribute type description currentspec nsifilespec init() void init( in nsifilespec parent, in boolean resolvesymlink ); parameters parent resolvesymlink exist() boolean exists(); next() void next(); ...
getFile
if false, then the directory service will not cache the results of this method.
nsIDirectoryServiceProvider
method overview nsifile getfile(in string prop, out prbool persistent); methods getfile() the directory service calls this method when it gets the first request for a prop or on every request if the prop is not persistent.
getFiles
« xpcom api reference summary this method is called by the directory service to query an enumeration of file or directory locations.
nsIDirectoryServiceProvider2
inherits from: nsidirectoryserviceprovider last changed in gecko 0.9.6 method overview nsisimpleenumerator getfiles(in string prop); methods getfiles() the directory service calls this when it gets a request for a prop and the requested type is nsisimpleenumerator.
nsIDiskCacheStreamInternal
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 closeinternal(); methods closeinternal() we use this method internally to close nsdiskcacheoutputstream under the cache service lock.
nsIDispatchSupport
inherits from: nsisupports last changed in gecko 1.7 method overview void comvariant2jsval(in comvariantptr comvar, out jsval val); unsigned long gethostingflags(in string acontext); boolean isclassmarkedsafeforscripting(in nscidref cid, out boolean classexists); boolean isclasssafetohost(in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists); boolean isobjectsafeforscripting(in voidptr theobject, in nsiidref id); void jsval2comvariant(in jsval var, out comvariant comvar); methods comvariant2jsval() converts a com variant to a jsval.
nsIDownloadHistory
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adddownload(in nsiuri asource, [optional] in nsiuri areferrer, [optional] in prtime astarttime); methods adddownload() adds a download to history.
nsIDownloadObserver
inherits from: nsisupports last changed in gecko 1.7 method overview void ondownloadcomplete(in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed.
nsIDownloader
inherits from: nsistreamlistener last changed in gecko 1.7 method overview void init(in nsidownloadobserver observer, in nsifile downloadlocation); methods init() initialize this downloader.
nsIDroppedLinkHandler
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.
nsIEditorLogging
inherits from: nsisupports last changed in gecko 1.7 method overview void startlogging(in nsifile alogfile); void stoplogging(); methods startlogging() start logging.
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.
nsIEditorObserver
66 introduced gecko 1.0 obsolete gecko 18 inherits from: nsisupports last changed in gecko 1.7 method overview void editaction(); methods editaction() called after the editor completes a user action.
nsIExternalHelperAppService
to access this service, use: var externalhelperappservice = components.classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded fr...
nsIExternalURLHandlerService
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 nsihandlerinfo geturlhandlerinfofromos(in nsiuri aurl, out boolean afound); methods geturlhandlerinfofromos() given a url, looks up the handler info from the operating system.
nsIFTPEventSink
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onftpcontrollog(in boolean server, in string msg) methods onftpcontrollog allows a consumer to receive a log of the ftp control connection conversation.
nsIFeedResultListener
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 handleresult(in nsifeedresult result); methods handleresult() called when feed processing is complete.
nsIFrameMessageListener
method overview void receivemessage(); methods receivemessage() note: this method is for javascript only.
nsIFrameScriptLoader
methods void loadframescript(in astring aurl, in boolean aallowdelayedload, [optional] in boolean aruninglobalscope) void removedelayedframescript(in astring aurl); jsval getdelayedframescripts(); loadframescript() load a script in the remote frame.
nsIGSettingsCollection
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) method overview boolean getboolean(in autf8string key); long getint(in autf8string key); autf8string getstring(in autf8string key); void setboolean(in autf8string key, in boolean value); void setint(in autf8string key, in long value); void setstring(in autf8string key, in autf8string value); methods getboolean() boolean getboolean( in autf8string key ); parameters key return value getint() long getint( in autf8string key ); parameters key return value getstring() autf8string getstring( in autf8string key ); parameters ...
nsIGSettingsService
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) implemented by: @mozilla.org/gsettings-service;1 as a service: var gsettingsservice = components.classes["@mozilla.org/gsettings-service;1"] .createinstance(components.interfaces.nsigsettingsservice); method overview nsigsettingscollection getcollectionforschema(in autf8string schema); methods getcollectionforschema() nsigsettingscollection getcollectionforschema( in autf8string schema ); parameters schema return value ...
nsIGeolocationUpdate
method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered.
nsIGlobalHistory
66 introduced gecko 1.0 deprecated gecko 2.0 obsolete gecko 15.0 inherits from: nsisupports last changed in gecko 1.7 method overview void addpage(in string aurl); boolean isvisited(in string aurl); methods addpage() add a page to the history.
nsIGlobalHistory2
inherits from: nsisupports last changed in gecko 1.7 this interface replaces and deprecates nsiglobalhistory method overview void adduri(in nsiuri auri, in boolean aredirect, in boolean atoplevel, in nsiuri areferrer); boolean isvisited(in nsiuri auri); void setpagetitle(in nsiuri auri, in astring atitle); methods adduri() add a uri to global history.
nsIHTTPHeaderListener
method overview void newresponseheader(in string headername, in string headervalue); void statusline(in string line); methods newresponseheader() called for each http response header.
nsIHttpServer
if no specific port is * desired * @throws ns_error_already_initialized * if this server is already started * @throws ns_error_not_available * if the server is not started and cannot be started on the desired port * (perhaps because the port is already in use or because the process does * not have privileges to do so) * @note * behavior is undefined if this method is called after stop() has been * called on this but before the provided callback function has been * called.
nsIHttpUpgradeListener
method overview void ontransportavailable(in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout); methods ontransportavailable() called when an http protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer being used by http.
nsIINIParser
nsiutf8stringenumerator getkeys(in autf8string asection); nsiutf8stringenumerator getsections(); autf8string getstring(in autf8string asection, in autf8string akey); methods getkeys() returns an nsiutf8stringenumerator providing the keys available within the specified section of the ini file.
nsIINIParserFactory
method overview nsiiniparser createiniparser(in nsilocalfile ainifile); methods createiniparser() creates an ini parser, returning the nsiiniparser object that you can use to parse it.
nsIInProcessContentFrameMessageManager
1.0 66 introduced gecko 2.0 inherits from: nsicontentframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsicontent getownercontent(); violates the xpcom interface guidelines methods violates the xpcom interface guidelines getownercontent() nsicontent getownercontent(); parameters none.
nsIInterfaceRequestor
method overview void getinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); methods getinterface() retrieves the specified interface pointer.
nsIJetpackService
method overview nsijetpack createjetpack(); methods createjetpack() this method creates a new jetpack process and returns an nsijetpack interface that represents it.
nsILocale
inherits from: nsisupports last changed in gecko 1.0 method overview astring getcategory(in astring category); methods getcategory() retrieves a string with the current locale name.
nsILoginManagerIEMigrationHelper
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void migrateandaddlogin(in nsilogininfo alogin); methods migrateandaddlogin() takes a login provided from nsieprofilemigrator, migrates it to the current login manager format, and adds it to the list of stored logins.
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...
nsIMessageBroadcaster
methods void broadcastasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects); nsimessagelistenermanager getchildat(in unsigned long aindex); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager.
nsIMessageListener
methods void receivemessage(); receivemessage() this is for js only.
nsIMessageSender
methods void sendasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendasyncmessage() send messagename and obj to the "other side" of this message manager.
nsIMessageWakeupService
the method to call to instantiate the component (either "getservice" or "createinstance").
nsIMicrosummarySet
1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); nsisimpleenumerator enumerate(); void removeobserver(in nsimicrosummaryobserver observer); methods addobserver() add a microsummary observer to this microsummary set.
nsIMsgDBViewCommandUpdater
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports in thunderbird this is implemented for different windows in several different places: nsmsgdbviewcommandupdater (for the standalone message window) nsmsgdbviewcommandupdater (for the threadpane message window) nsmsgsearchcommandupdater (for search dialogs) method overview void updatecommandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes.
nsIMsgFilter
xception if the action is not label attribute nsmsglabelvalue label; junkscore attribute long junkscore; strvalue attribute autf8string strvalue; customid // action id if type is custom attribute acstring customid; customaction // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; methods addterm() void nsimsgfilter::addterm ( in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in acstring arbitraryheader ) getterm() void nsimsgfilter::getterm ( in long termindex, in nsmsgsearchattribvalue attrib, in nsmsgsearchopv...
nsIMsgFilterList
ly attribute boolean nsimsgfilterlist::shoulddownloadallheaders filtercount readonly attribute unsigned long nsimsgfilterlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filterindex ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter)...
nsIMsgSearchCustomTerm
readonly attribute boolean needsbody; methods getenabled /** * is this custom term enabled?
nsIMsgSearchTerm
attribute acstring customid; beginsgrouping attribute boolean beginsgrouping; endsgrouping attribute boolean endsgrouping; methods matchrfc822string boolean matchrfc822string(in string astring, in string charset, in boolean charsetoverride); matchrfc2047string boolean matchrfc2047string(in string astring, in string charset, in boolean charsetoverride); matchdate boolean matchdate(in prtime atime); matchstatus boolean matchstatus(in unsigned long astatus); matchpriority boolean matchpriority(in nsmsgpriorityvalu...
nsIMsgSendLater
to create an instance, use var msgsendlater = components.classes["@mozilla.org/messengercompose/sendlater;1"] .getservice(components.interfaces.nsimsgsendlater); method overview void sendunsentmessages(in nsimsgidentity identity); void removelistener(in nsimsgsendlaterlistener listener); void addlistener(in nsimsgsendlaterlistener listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods send...
nsINavHistoryBatchCallback
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void runbatched(in nsisupports auserdata); methods runbatched() void runbatched( in nsisupports auserdata ); parameters auserdata see also nsinavhistoryservice.runinbatchmode() nsinavbookmarksservice.runinbatchmode() ...
nsIProcessScriptLoader
methods void loadprocessscript(in astring aurl, in boolean aallowdelayedload) void removedelayedprocessscript(in astring aurl); jsval getdelayedprocessscripts(); loadprocessscript() load a script in the child process.
nsIPushService
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 pu...
nsIRandomGenerator
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.
nsIRequestObserver
inherits from: nsisupports last changed in gecko 1.0 method overview void onstartrequest(in nsirequest arequest, in nsisupports acontext); void onstoprequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatuscode); methods onstartrequest() called to signify the beginning of an asynchronous request.
nsISSLErrorListener
method overview boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error.
nsISSLSocketControl
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void proxystartssl(); void starttls(); attributes attribute type description forcehandshake boolean obsolete since gecko 1.9 notificationcallbacks nsiinterfacerequestor methods proxystartssl() starts an ssl proxy connection.
nsISelection3
method overview void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection.
nsISelectionImageService
inherits from: nsisupports last changed in gecko 1.7 method overview void getimage(in short selectionvalue, out imgicontainer container); void reset(); methods getimage() retrieve the image for alpha blending.
nsISocketProviderService
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 1.7 method overview nsisocketprovider getsocketprovider(in string sockettype); methods getsocketprovider() given a string representing a socket type, this method returns an nsisocketprovider representing that socket type.
nsIStringBundleOverride
method overview nsisimpleenumerator enumeratekeysinbundle(in autf8string url); astring getstringfromname(in autf8string url, in acstring key); methods enumeratekeysinbundle() get all override keys for a given string bundle.
nsISupportsWeakReference
inherits from: nsisupports last changed in gecko 1.7 method overview nsiweakreference getweakreference(); methods getweakreference() produces an appropriate instance of nsiweakreference.
nsISyncJPAKE
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 final(in acstring ab, in acstring agvb, in acstring arb, in acstring ahkdfinfo, out acstring aaes256key, out acstring ahmac256key); void round1(in acstring asignerid, out acstring agx1, out acstring agv1, out acstring ar1, out acstring agx2, out acstring agv2, out acstring ar2); void round2(in acstring apeerid, in acstring apin, in acstring agx3, in acstring agv3, in acstring ar3, in acstring agx4, in acstring agv4, in acstring ar4, out acstring aa, out acstring agva, out acstring ara); methods final() perform the fin...
nsISyncMessageSender
methods jsval sendsyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); jsval sendrpcmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval...
nsITextInputProcessorCallback
}, } method overview boolean onnotify(in nsitextinputprocessor atextinputprocessor, in nsitextinputprocessornotification anotification); methods onnotify() this is called when gecko requests or notifies something to ime.
nsIThreadPoolListener
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void onthreadcreated(); void onthreadshuttingdown(); methods onthreadcreated() called when a new thread is created by the thread pool.
nsITimerCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void notify(in nsitimer timer); methods notify() initialize a timer to fire after the given millisecond interval.
nsIToolkit
inherits from: nsisupports last changed in gecko 1.0 method overview void init(in prthread athread); methods init() initialize this toolkit with athread.
nsITransportEventSink
inherits from: nsisupports last changed in gecko 1.7 method overview void ontransportstatus(in nsitransport atransport, in nsresult astatus, in unsigned long long aprogress, in unsigned long long aprogressmax); methods ontransportstatus() transport status notification.
nsIUTF8ConverterService
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8.
nsIUpdateCheckListener
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 oncheckcomplete(in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void onerror(in nsixmlhttprequest request, in nsiupdate update); void onprogress(in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed.
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.
nsIUrlListManagerCallback
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 handleevent(in acstring value); methods handleevent() void handleevent( in acstring value ); parameters value ...
nsIUserCertPicker
inherits from: nsisupports last changed in gecko 1.7 method overview nsix509cert pickbyusage(in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled); methods pickbyusage() nsix509cert pickbyusage( in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled ); parameters ctx selectednickname certusage allowinvalid allowduplicatenicknames canceled return value ...
nsIVersionComparator
the service can be accessed directly via services.vc after loading services.jsm or with the following code: var versioncomparator = components.classes["@mozilla.org/xpcom/version-comparator;1"] .getservice(components.interfaces.nsiversioncomparator); method overview long compare(in acstring a, in acstring b); methods compare() compare two version strings.
nsIWeakReference
method overview void queryreferent( in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); methods queryreferent() this method queries an interface on the referent if it exists, and like nsisupports.queryinterface(), produces an owning reference to the desired interface.")}} it is designed to look and act exactly like (a proxied) nsisupports.queryinterface().
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.
nsIWebBrowserChromeFocus
inherits from: nsisupports last changed in gecko 1.7 method overview void focusnextelement(); void focusprevelement(); methods focusnextelement() set the focus at the next focusable element in the chrome.
nsIWebProgressListener2
last changed in gecko 1.9 (firefox 3) inherits from: nsiwebprogresslistener method overview void onprogresschange64(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress); boolean onrefreshattempted(in nsiwebprogress awebprogress, in nsiuri arefreshuri, in long amillis, in boolean asameuri); methods onprogresschange64() notification that the progress has changed for one of the requests associated with awebprogress.
nsIWebappsSupport
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void installapplication(in wstring title, in wstring uri, in wstring iconuri, in wstring icondata); boolean isapplicationinstalled(in wstring uri); methods installapplication() this method installs a web application.
nsIWifiListener
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void onchange([array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen); void onerror(in long error); methods onchange() called when the list of available access points changes.
nsIWifiMonitor
implemented by @mozilla.org/wifi/monitor;1 as a service: var wifimonitor = components.classes["@mozilla.org/wifi/monitor;1"] .getservice(components.interfaces.nsiwifimonitor); method overview void startwatching(in nsiwifilistener alistener); void stopwatching(in nsiwifilistener alistener); methods startwatching() starts listening for changes to the wifi access point list.
nsIWinAccessNode
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview voidptr querynativeinterface([const] in mscomiidref aiid); methods querynativeinterface() voidptr querynativeinterface( [const] in mscomiidref aiid ); parameters aiid return value ...
nsIWorkerFactory
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.
nsIWorkerMessagePort
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.
nsIWritablePropertyBag
1.0 66 introduced gecko 1.8 inherits from: nsipropertybag last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void deleteproperty(in astring name); void setproperty(in astring name, in nsivariant value); methods deleteproperty() delete a property with the given name.
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.
nsIXULBuilderListener
inherits from: nsisupports last changed in gecko 1.7 method overview void didrebuild(in nsixultemplatebuilder abuilder); void willrebuild(in nsixultemplatebuilder abuilder); methods didrebuild() called after a template builder has rebuilt its content.
nsPIPromptService
method overview void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl); methods dodialog() opens a dialog.
NS_CStringCopy
example /* attribute acstring value; */ ns_imethodimp mycomponent::getvalue(nsacstring& avalue) { return ns_cstringcopy(avalue, mvalue); } ns_imethodimp mycomponent::setvalue(const nsacstring& avalue) { return ns_cstringcopy(mvalue, avalue); } history this function was frozen in mozilla 1.7.
NS_StringCopy
example code /* attribute acstring value; */ ns_imethodimp mycomponent::getvalue(nsastring& avalue) { return ns_stringcopy(avalue, mvalue); } ns_imethodimp mycomponent::setvalue(const nsastring& avalue) { return ns_stringcopy(mvalue, avalue); } history this function was frozen for mozilla 1.7.
The Thread Manager
nsithreadeventfilter this interface is used by the nsithreadinternal.pusheventqueue() method in nsithreadinternal to allow event filtering.
Reference Manual
implementation details and debugging machinery although it is a class, nscomptr has no virtual methods, and therefore, no vtable or vptr.
Using the Gecko SDK
the abi of the component interfaces depends on the c++ abi of the host compiler (i.e., the vtable format and calling conventions of the virtual methods may vary from compiler to compiler).
nsCOMPtr versus RefPtr
the downside of this inheritance is that do_queryobject requires an extra virtual call to operator() in the helper method.
Events
saved searches, virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
MailNews fakeserver
a handler will contain the following methods: <caption> handler methods </caption> name arguments returns notes [command] rest of sent line server's response the name is normalized to be uppercase.
customDBHeaders Preference
depending on the release you use one, both, or none of the methods may work.
Using the Multiple Accounts API
assign the identity to the account with the addidentity() method.
Using popup notifications
you can use this to style the icon, like this: .popup-notification-icon[popupid="sample-popup"] { list-style-image: url("chrome://popupnotifications/skin/mozlogo.png"); } with this css in place, the result is the look we want: adding secondary options to provide options in the drop-down menu, add an array of notification actions to the call to the show() method, like this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ { label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } }, [ { label: "first secondary option", ...
Using tab-modal prompts
only the window.alert() method gets this by default; you get this by default.
XPI
xpi archives only support files stored uncompressed or compressed using the "deflate" method.
Using COM from js-ctypes
when used from c or js-ctypes, the order of the vtable methods should match the order of the c++ vtable.
Declaring and Using Callbacks
this can all be done in a single line of code, like so: var callback = ctypes.functiontype(...).ptr(function(...) {...}); note: the use of .ptr() here isn't a method call; we're accessing a property that dynamically creates a callable object, and then invoking the result.
Declaring and Calling Functions
functions are declared using the library object's declare() method.
Memory Management
this is not an exhaustive list, but will help you to understand memory management and how it affects your use of js-ctypes: a function or static data declared using the declare() method will hold that library alive.
ABI
method overview string tosource() string tostring() methods tosource() returns the string "ctypes.***_abi".
FunctionType
method overview methods inherited from ctype ctype array([n]) string tosource() string tostring() functiontype cdata functiontype cdata cannot be constructed.
js-ctypes reference
ctypes.arraytype(type, [length]) and the .array() method, which creates a new type describing an array of objects of an existing type.
PKCS #11 Netscape Trust Objects - Network Security Services
this is not a new design, but documentation of the method already in use.
Introduction to DOM Inspector - Firefox Developer Tools
when you inspect a web page with this method, a browser pane at the bottom of the dom inspector window will open up, displaying the web page.
Debugging service workers - Firefox Developer Tools
registration is done with a block of code along these lines, using the register() method: if('serviceworker' in navigator) { navigator.serviceworker .register('sw.js') .then(function() { console.log('service worker registered'); }); } if you get the path wrong, for example, you'll get an error in the web console giving you a hint as to what's wrong, which depends on what exactly is wrong with the code.
Set a logpoint - Firefox Developer Tools
it’s faster than changing the underlying source code itself to add calls to the console.log method.
Set an XHR breakpoint - Firefox Developer Tools
scopes a list of the values that are in scope in the function, method, or event handler where the break occurred.
UI Tour - Firefox Developer Tools
use it to jump directly to a function, class or method definition.
Debugger.Source - Firefox Developer Tools
convention for descriptions of properties and methods below, if the behavior of the property or method differs between the instance referring to javascript source or to a block of webassembly code, the text will be split into two sections, headed by “if the instance refers to javascript source” and “if the instance refers to webassembly code”, respectively.
Debugger-API - Firefox Developer Tools
also omitted is the debugger’s debugger.memory instance, which holds methods and accessors for observing the debuggee’s memory use.
Network request details - Firefox Developer Tools
edit and resend: enables an editing mode, where you can modify the method, url, request headers, or request body of the request.
Waterfall - Firefox Developer Tools
in the screenshot below, we've zoomed in on a js function that's caused a drop in the frame rate: the intensive javascript article shows how the waterfall can highlight responsiveness problems caused by long javascript functions, and how you can use asynchronous methods to keep the main thread responsive.
Console messages - Firefox Developer Tools
method the specific http request method.
about:debugging (before Firefox 68) - Firefox Developer Tools
the big advantages of this method, compared with installing an add-on from an xpi, are: you don't have to rebuild an xpi and reinstall when you change the add-on's code you can load an add-on without signing it and without needing to disable signing.
about:debugging - Firefox Developer Tools
the major advantages of this method, compared with installing an add-on from an xpi, are: you don't have to rebuild an xpi and reinstall when you change the add-on's code; you can load an add-on without signing it and without needing to disable signing.
AbortController.abort() - Web APIs
the abort() method of the abortcontroller interface aborts a dom request (e.g.
AbortController - Web APIs
methods abortcontroller.abort() aborts a dom request before it has completed.
AbortSignal: abort event - Web APIs
you can use the abort event in an addeventlistener method: 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 ...
AbortSignal - Web APIs
methods the abortsignal interface inherits methods from its parent interface, eventtarget.
AesGcmParams - Web APIs
section 8.2 of the specification outlines methods for constructing ivs.
Ambient Light Events - Web APIs
this event can be captured at the window object level by using the addeventlistener method (using the devicelight event name) or by attaching an event handler to the window.ondevicelight property.
AnalyserNode.getByteFrequencyData() - Web APIs
the getbytefrequencydata() method of the analysernode interface copies the current frequency data into a uint8array (unsigned byte array) passed into it.
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.
AnalyserNode.getFloatFrequencyData() - Web APIs
the getfloatfrequencydata() method of the analysernode interface copies the current frequency data into a float32array array passed into it.
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.
AnalyserNode - Web APIs
methods inherits methods from its parent, audionode.
Animation.commitStyles() - Web APIs
the commitstyles() method of the web animations api's animation interface commits the end styling state of an animation to the element being animated, even after that animation has been removed.
Animation.onfinish - Web APIs
the finish event occurs when the animation completes naturally, as well as when the animation.finish() method is called to immediately cause the animation to finish up.
Animation.persist() - Web APIs
WebAPIAnimationpersist
the persist() method of the web animations api's animation interface explicitly persists an animation, when it would otherwise be removed due to the browser's automatically removing filling animations behavior.
Animation.play() - Web APIs
WebAPIAnimationplay
the play() method of the web animations api's animation interface starts or resumes playing of an animation.
Animation.reverse() - Web APIs
WebAPIAnimationreverse
the animation.reverse() method of the animation interface reverses the playback direction, meaning the animation ends at its beginning.
Animation - Web APIs
WebAPIAnimation
methods animation.cancel() clears all keyframeeffects caused by this animation and aborts its playback.
AnimationEffect.getTiming() - Web APIs
the animationeffect.gettiming() method of the animationeffect interface returns an effecttiming object containing the timing properties for the animation effect.
AnimationEffect.updateTiming() - Web APIs
the updatetiming() method of the animationeffect interface updates the specified timing properties for an animation effect.
AnimationEffect - Web APIs
methods animationeffect.gettiming() returns the effecttiming object associated with the animation containing all the animation's timing values.
Attr.namespaceURI - Web APIs
WebAPIAttrnamespaceURI
you can create an attribute with the specified namespaceuri using the dom level 2 method element.setattributens.
AudioBuffer.copyFromChannel() - Web APIs
the copyfromchannel() method of the audiobuffer interface copies the audio sample data from the specified channel of the audiobuffer to a specified float32array.
AudioBuffer.copyToChannel() - Web APIs
the copytochannel() method of the audiobuffer interface copies the samples to the specified channel of the audiobuffer, from the source array.
AudioBuffer.getChannelData() - Web APIs
the getchanneldata() method of the audiobuffer interface returns a float32array containing the pcm data associated with the channel, defined by the channel parameter (with 0 representing the first channel).
AudioContext.createMediaElementSource() - Web APIs
the createmediaelementsource() method of the audiocontext interface is used to create a new mediaelementaudiosourcenode object, given an existing html <audio> or <video> element, the audio from which can then be played and manipulated.
AudioContext.createMediaStreamSource() - Web APIs
the createmediastreamsource() method of the audiocontext interface is used to create a new mediastreamaudiosourcenode object, given a media stream (say, from a mediadevices.getusermedia instance), the audio from which can then be played and manipulated.
AudioContext.createMediaStreamTrackSource() - Web APIs
the createmediastreamtracksource() method of the audiocontext interface creates and returns a mediastreamtrackaudiosourcenode which represents an audio source whose data comes from the specified mediastreamtrack.
AudioContext - Web APIs
methods also inherits methods from its parent interface, baseaudiocontext.
AudioDestinationNode - Web APIs
methods no specific method; inherits methods from its parent, audionode.
AudioParam.cancelAndHoldAtTime() - Web APIs
the cancelandholdattime() property of the audioparam interface cancels all scheduled future changes to the audioparam but holds its value at a given time until further changes are made using other methods.
AudioParam.exponentialRampToValueAtTime() - Web APIs
the exponentialramptovalueattime() method of the audioparam interface schedules a gradual exponential change in the value of the audioparam.
AudioParam.linearRampToValueAtTime() - Web APIs
the linearramptovalueattime() method of the audioparam interface schedules a gradual linear change in the value of the audioparam.
AudioParam.setValueCurveAtTime() - Web APIs
the setvaluecurveattime() method of the audioparam interface schedules the parameter's value to change following a curve defined by a list of values.
AudioParamDescriptor - Web APIs
under this name the audioparam will be available in the parameters property of the node, and under this name the audioworkletprocessor.process method will acquire the calculated values of this audioparam.
AudioParamMap - Web APIs
methods entries() ?
AudioScheduledSourceNode.onended - Web APIs
the ended event is only sent to a node configured to loop automatically when the node is stopped using its stop() method.
AudioScheduledSourceNode.start() - Web APIs
the start() method on audioscheduledsourcenode schedules a sound to begin playback at the specified time.
AudioTrack.enabled - Web APIs
the element's audio tracks are then scanned through using the javascript foreach() method (although the audiotracks property of a media element isn't actually a javascript array, it can be accessed like one for the most part).
AudioTrack.id - Web APIs
WebAPIAudioTrackid
this id can be used with the audiotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element.
AudioTrackList - Web APIs
methods this interface also inherits methods from its parent interface, eventtarget.
AudioWorkletGlobalScope.registerProcessor - Web APIs
the registerprocessor method of the audioworkletglobalscope interface registers a class constructor derived from audioworkletprocessor interface under a specified name.
AudioWorkletNode() - Web APIs
a processor with the provided name must first be registered using the audioworkletglobalscope.registerprocessor() method.
AudioWorkletNode.onprocessorerror - Web APIs
this occurs when the underlying audioworkletprocessor behind the node throws an exception in its constructor, the process method, or any user-defined class method.
AudioWorkletNode.parameters - Web APIs
they can be automated in the same way as with default audionodes, and their calculated values can be used in the process method of your audioworkletprocessor.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
under this name the audioparam will be available in the parameters property of the node, and under this name the audioworkletprocessor.process method will acquire the calculated values of this audioparam.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
bit 2, user verification (uv) - if set, authenticator verified the actual user, through a biometric, pin, or other authentication method.
AuthenticatorAssertionResponse - Web APIs
methods none.
AuthenticatorAttestationResponse - Web APIs
methods authenticatorattestationresponse.gettransports()secure context returns an array of strings describing which transport methods (e.g.
AuthenticatorResponse - Web APIs
methods none.
BaseAudioContext.createAnalyser() - Web APIs
the createanalyser() method of the baseaudiocontext interface creates an analysernode, which can be used to expose audio time and frequency data and create data visualisations.
BaseAudioContext.createBiquadFilter() - Web APIs
the createbiquadfilter() method of the baseaudiocontext interface creates a biquadfilternode, which represents a second order filter configurable as several different common filter types.
BaseAudioContext.createBufferSource() - Web APIs
the createbuffersource() method of the baseaudiocontext interface is used to create a new audiobuffersourcenode, which can be used to play audio data contained within an audiobuffer object.
BaseAudioContext.createConvolver() - Web APIs
the createconvolver() method of the baseaudiocontext interface creates a convolvernode, which is commonly used to apply reverb effects to your audio.
BaseAudioContext.createDelay() - Web APIs
the createdelay() method of the baseaudiocontext interface is used to create a delaynode, which is used to delay the incoming audio signal by a certain amount of time.
BaseAudioContext.createDynamicsCompressor() - Web APIs
the createdynamicscompressor() method of the baseaudiocontext interface is used to create a dynamicscompressornode, which can be used to apply compression to an audio signal.
BaseAudioContext.createGain() - Web APIs
the creategain() method of the baseaudiocontext interface creates a gainnode, which can be used to control the overall gain (or volume) of the audio graph.
BaseAudioContext.createIIRFilter() - Web APIs
the createiirfilter() method of the baseaudiocontext interface creates an iirfilternode, which represents a general infinite impulse response (iir) filter which can be configured to serve as various types of filter.
BaseAudioContext.createOscillator() - Web APIs
the createoscillator() method of the baseaudiocontext interface creates an oscillatornode, a source representing a periodic waveform.
BaseAudioContext.createPeriodicWave() - Web APIs
the createperiodicwave() method of the baseaudiocontext interface is used to create a periodicwave, which is used to define a periodic waveform that can be used to shape the output of an oscillatornode.
BaseAudioContext.createWaveShaper() - Web APIs
the createwaveshaper() method of the baseaudiocontext interface creates a waveshapernode, which represents a non-linear distortion.
BasicCardRequest.supportedNetworks - Web APIs
var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ...
BasicCardRequest.supportedTypes - Web APIs
var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ...
Battery Status API - Web APIs
the battery status api extends window.navigator with a navigator.getbattery() method returning a battery promise, which is resolved in a batterymanager object providing also some new events you can handle to monitor the battery status.
BeforeInstallPromptEvent.prompt() - Web APIs
the prompt() method of the beforeinstallpromptevent interface allows a developer to show the install prompt at a time of their own choosing.
BiquadFilterNode() - Web APIs
the biquadfilternode() constructor of the web audio api creates a new biquadfilternode object, which represents a simple low-order filter, and is created using the audiocontext.createbiquadfilter() method.
BlobEvent - Web APIs
WebAPIBlobEvent
methods no specific method; inherits methods from its parent event.
BluetoothAdvertisingData - Web APIs
methods none.
connectGATT() - Web APIs
the bluetoothdevice.connectgatt() method returns a promise that resolves to an instance of bluetoothgattremoteserver.
BluetoothDevice - Web APIs
methods bluetoothdevice.watchadvertisments() a promise that resolves to undefined or is rejected with an error if advetisments can’t shown for any reason.
BluetoothRemoteGATTCharacteristic.getDescriptor() - Web APIs
the bluetoothremotegattcharacteristic.getdescriptor() method returns a promise that resolves to the first bluetoothgattdescriptor for a given descriptor uuid.
BluetoothRemoteGATTCharacteristic.getDescriptors() - Web APIs
the bluetoothremotegattcharacteristic.getdescriptors() method returns a promise that resolves to an array of all bluetoothgattdescriptor objects for a given descriptor uuid.
BluetoothRemoteGATTCharacteristic.readValue() - Web APIs
the bluetoothremotegattcharacteristic.readvalue() method returns a promise that resolves to a dataview holding a duplicate of the value property if it is available and supported.
BluetoothRemoteGATTCharacteristic.startNotifications() - Web APIs
the bluetoothremotegattcharacteristic.startnotifications() method returns a promise to the bluetoothremotegattcharacteristic instance when there is an active notification on it.
BluetoothRemoteGATTCharacteristic.stopNotifications() - Web APIs
the bluetoothremotegattcharacteristic.stopnotifications() method returns a promise to the bluetoothremotegattcharacteristic instance when there is no longer an active notification on it.
BluetoothRemoteGATTCharacteristic.writeValue() - Web APIs
the bluetoothremotegattcharacteristic.writevalue() method sets the value property to the bytes contained in an arraybuffer and returns a promise.
BluetoothRemoteGATTCharacteristic - Web APIs
methods bluetoothremotegattcharacteristic.getdescriptor() returns a promise that resolves to the first bluetoothgattdescriptor for a given descriptor uuid.
readValue() - Web APIs
the bluetoothremotegattdescriptor.readvalue() method returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported.
writeValue() - Web APIs
the bluetoothremotegattdescriptor.writevalue() method sets the value property to the bytes contained in an arraybuffer and returns a promise.
BluetoothRemoteGATTDescriptor - Web APIs
methods bluetoothremotegattdescriptor.readvalue() returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported.
BluetoothRemoteGATTServer.connect() - Web APIs
the bluetoothremotegattserver.connect() method causes the script execution environment to connect to this.device.
BluetoothRemoteGATTServer.disconnect() - Web APIs
the bluetoothremotegattserver.disconnect() method causes the script execution environment to disconnect from this.device.
BluetoothRemoteGATTServer.getPrimaryService() - Web APIs
the bluetoothremotegattserver.getprimaryservice() method returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a specified bluetoothserviceuuid.
BluetoothRemoteGATTServer.getPrimaryServices() - Web APIs
the bluetoothremotegattserver.getprimaryservices() method returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a specified bluetoothserviceuuid.
BluetoothRemoteGATTServer - Web APIs
methods bluetoothremotegattserver.connect() causes the script execution environment to connect to this.device.
getCharacteristic() - Web APIs
the bluetoothgattservice.getcharacteristic() method returns a promise to an instance of bluetoothgattcharacteristic for a given universally unique identifier (uuid).
getCharacteristics() - Web APIs
the bluetoothgattservice.getcharacteristics() method returns a promise to a list of bluetoothgattcharacteristic instances for a given universally unique identifier (uuid).
getIncludedService() - Web APIs
the bluetoothgattservice.getincludedservice() method returns a promise to an instance of bluetoothgattservice for a given universally unique identifier (uuid).
getIncludedServices() - Web APIs
the bluetoothgattservice.getincludedservices() method returns a promise to an array of bluetoothgattservice instances for an optional universally unique identifier (uuid).
BluetoothRemoteGATTService - Web APIs
methods bluetoothremotegattservice.getcharacteristic() returns a promise to an instance of bluetoothgattcharacteristic for a given universally unique identifier (uuid).
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
the arraybuffer() method of the body mixin takes a response stream and reads it to completion.
Body.formData() - Web APIs
WebAPIBodyformData
the formdata() method of the body mixin takes a response stream and reads it to completion.
Body.json() - Web APIs
WebAPIBodyjson
the json() method of the body mixin takes a response stream and reads it to completion.
Body.text() - Web APIs
WebAPIBodytext
the text() method of the body mixin takes a response stream and reads it to completion.
Body - Web APIs
WebAPIBody
methods body.arraybuffer() takes a response stream and reads it to completion.
BroadcastChannel - Web APIs
methods this interface also inherits methods from its parent, eventtarget.
BudgetService - Web APIs
methods budgetservice.getcost() returns a promise that resolves to a double, indicating the worst-case background operation cost of the provided background operation.
BudgetState - Web APIs
methods none.
ByteLengthQueuingStrategy.size() - Web APIs
the size() method of the bytelengthqueuingstrategy interface returns the given chunk’s bytelength property.
ByteLengthQueuingStrategy - Web APIs
methods bytelengthqueuingstrategy.size() returns the given chunk’s bytelength property.
CDATASection - Web APIs
methods this interface has no specific methods and implements those of its parent text.
CSS numeric factory functions - Web APIs
the css numeric factory functions, such as css.em() and css.turn() are methods that return cssunitvalues with the value being the numeric argument and the unit being the name of the method used.
CSS.registerProperty() - Web APIs
the css.registerproperty() method registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
CSS.supports() - Web APIs
WebAPICSSsupports
the css.supports() method returns a boolean value indicating if the browser supports a given css feature, or not.
CSSConditionRule - Web APIs
methods the cssconditionrule derives from cssrule, cssgroupingrule and inherits all methods of these classes.
CSSCounterStyleRule - Web APIs
methods this interface doesn't implement any specific method but inherits methods from its parent cssrule.
CSSImageValue - Web APIs
methods none.
CSSKeywordValue - Web APIs
methods inherits methods from cssstylevalue.
CSSMathProduct - Web APIs
methods none.
CSSMathValue - Web APIs
event handlers no methods none.
CSSNumericValue.equals() - Web APIs
the equals() method of the cssnumericvalue interface returns a boolean indicating whether the passed value are strictly equal.
CSSNumericValue.parse() - Web APIs
the parse() method of the cssnumericvalue interface converts a value string into an object whose members are value and the units.
CSSNumericValue.type - Web APIs
the type() method of the cssnumericvalue interface returns the type of cssnumericvalue, one of angle, flex, frequency, length, resolution, percent, percenthint, or time.
CSSNumericValue - Web APIs
event handlers no methods cssnumericvalue.add adds a supplied number to the cssnumericvalue.
CSSPositionValue - Web APIs
methods none.
CSSPrimitiveValue.getCounterValue() - Web APIs
the getcountervalue() method of the cssprimitivevalue interface is used to get the counter value.
CSSPrimitiveValue.getRGBColorValue() - Web APIs
the getrgbcolorvalue() method of the cssprimitivevalue interface is used to get an rgb color value.
CSSPrimitiveValue.getRectValue() - Web APIs
the getrectvalue() method of the cssprimitivevalue interface is used to get a rect value.
CSSPrimitiveValue.getStringValue() - Web APIs
the getstringvalue() method of the cssprimitivevalue interface is used to get a string value.
CSSPrimitiveValue.setStringValue() - Web APIs
the setstringvalue() method of the cssprimitivevalue interface is used to set a string value.
CSSPseudoElement - Web APIs
methods csspseudoelement extends eventtarget, so it inherits the following methods: eventtarget.addeventlistener() registers an event handler of a specific event type on the pseudo-element.
CSSStyleDeclaration.getPropertyCSSValue() - Web APIs
the cssstyledeclaration.getpropertycssvalue() method interface returns a cssvalue containing the css value for a property.
CSSStyleDeclaration.getPropertyPriority() - Web APIs
the cssstyledeclaration.getpropertypriority() method interface returns a domstring that provides all explicitly set priorities on the css property.
CSSStyleDeclaration.getPropertyValue() - Web APIs
the cssstyledeclaration.getpropertyvalue() method interface returns a domstring containing the value of a specified css property.
CSSStyleDeclaration.removeProperty() - Web APIs
the cssstyledeclaration.removeproperty() method interface removes a property from a css style declaration object.
CSSStyleSheet.deleteRule() - Web APIs
the cssstylesheet method deleterule() removes a rule from the stylesheet object.
CSSStyleValue.parse() - Web APIs
the parse() method of the cssstylevalue interface sets a specific css property to the specified values and returns the first value as a cssstylevalue object.
CSSStyleValue.parseAll() - Web APIs
the parseall() method of the cssstylevalue interface sets all occurences of a specific css property to the specified value and returns an array of cssstylevalue objects, each containing one of the supplied values.
CSSStyleValue - Web APIs
cssimagevalue csskeywordvalue cssnumericvalue csspositionvalue csstransformvalue cssunparsedvalue methods cssstylevalue.parse() sets a specific css property to the specified values and returns the first value as a cssstylevalue object.
CSSUnitValue.CSSUnitValue() - Web APIs
examples the following shows a method of creating a csspositionvalue from individual cssunitvalue constructors.
CSSUnparsedValue.entries() - Web APIs
the cssunparsedvalue.entries() method returns an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
CSSUnparsedValue.forEach() - Web APIs
the cssunparsedvalue.foreach() method executes a provided function once for each element of the cssunparsedvalue.
CSSUnparsedValue.keys() - Web APIs
the cssunparsedvalue.keys() method returns a new array iterator object that contains the keys for each index in the array.
CSSUnparsedValue.values() - Web APIs
the cssunparsedvalue.values() method returns a new array iterator object that contains the values for each index in the cssunparsedvalue object.
CSSUnparsedValue - Web APIs
methods cssunparsedvalue.entries() returns an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
CSSValueList - Web APIs
methods cssvaluelist.item() this method is used to retrieve a cssvalue by ordinal index.
CSSVariableReferenceValue - Web APIs
methods none.
Managing screen orientation - Web APIs
the screen is locked using the screen.lockorientation() method and unlocked using the screen.unlockorientation().
CSS Painting API - Web APIs
examples to draw directly into an element's background using javascript in our css, we define a paint worklet using the registerpaint() function, tell the document to include the worklet using the paintworklet addmodule() method, then include the image we created using the css paint() function.
Cache.put() - Web APIs
WebAPICacheput
the put() method of the cache interface allows key/value pairs to be added to the current cache object.
CacheStorage.delete() - Web APIs
the delete() method of the cachestorage interface finds the cache object matching the cachename, and if found, deletes the cache object and returns a promise that resolves to true.
CacheStorage.has() - Web APIs
WebAPICacheStoragehas
the has() method of the cachestorage interface returns a promise that resolves to true if a cache object matches the cachename.
CacheStorage.open() - Web APIs
WebAPICacheStorageopen
the open() method of the cachestorage interface returns a promise that resolves to the cache object matching the cachename.
CanvasCaptureMediaStreamTrack - Web APIs
methods this interface inherits the methods of its parent, mediastreamtrack.
CanvasImageSource - Web APIs
canvasimagesource provides a mechanism for other interfaces to be used as image sources for some methods of the canvasdrawimage and canvasfillstrokestyles interfaces.
CanvasRenderingContext2D.bezierCurveTo() - Web APIs
the canvasrenderingcontext2d.beziercurveto() method of the canvas 2d api adds a cubic bézier curve to the current sub-path.
CanvasRenderingContext2D.drawWidgetAsOnScreen() - Web APIs
the non-standard and internal only canvasrenderingcontext2d.drawwidgetasonscreen() method of the canvas 2d api renders the root widget of a window into the canvas.
CanvasRenderingContext2D.getTransform() - Web APIs
the canvasrenderingcontext2d.gettransform() method of the canvas 2d api retrieves the current transformation matrix being applied to the context.
CanvasRenderingContext2D.lineCap - Web APIs
note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods.
CanvasRenderingContext2D.lineDashOffset - Web APIs
the canvasrenderingcontext2d.linedashoffset property of the canvas 2d api sets the line dash offset, or "phase." note: lines are drawn by calling the stroke() method.
CanvasRenderingContext2D.lineJoin - Web APIs
note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods.
CanvasRenderingContext2D.lineWidth - Web APIs
note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods.
CanvasRenderingContext2D.measureText() - Web APIs
the canvasrenderingcontext2d.measuretext() method returns a textmetrics object that contains information about the measured text (such as its width, for example).
CanvasRenderingContext2D.moveTo() - Web APIs
the canvasrenderingcontext2d.moveto() method of the canvas 2d api begins a new sub-path at the point specified by the given (x, y) coordinates.
CanvasRenderingContext2D.quadraticCurveTo() - Web APIs
the canvasrenderingcontext2d.quadraticcurveto() method of the canvas 2d api adds a quadratic bézier curve to the current sub-path.
CanvasRenderingContext2D.scale() - Web APIs
the canvasrenderingcontext2d.scale() method of the canvas 2d api adds a scaling transformation to the canvas units horizontally and/or vertically.
CanvasRenderingContext2D.strokeStyle - Web APIs
html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.strokestyle = 'blue'; ctx.strokerect(10, 10, 100, 100); result creating multiple stroke colors using loops in this example, we use two for loops and the arc() method to draw a grid of circles, each having a different stroke color.
CanvasRenderingContext2D.textAlign - Web APIs
the alignment is relative to the x value of the filltext() method.
Client.postMessage() - Web APIs
the postmessage() method of the client interface allows a service worker to send a message to a client (a window, worker, or sharedworker).
Clients.get() - Web APIs
WebAPIClientsget
the get() method of the clients interface gets a service worker client matching a given id and returns it in a promise.
Clients - Web APIs
WebAPIClients
methods clients.get() returns a promise for a client matching a given id.
Clipboard.write() - Web APIs
WebAPIClipboardwrite
the clipboard method write() writes arbitrary data, such as images, to the clipboard.
ClipboardEvent - Web APIs
methods no specific methods; inherits methods from its parent event.
Comment - Web APIs
WebAPIComment
methods this interface has no specific method, but inherits those of its parent, characterdata, and indirectly those of node.
CompositionEvent.data - Web APIs
the data read-only property of the compositionevent interface returns the characters generated by the input method that raised the event; its exact nature varies depending on the type of event that generated the compositionevent object.
CompositionEvent.initCompositionEvent() - Web APIs
the initcompositionevent() method of the compositionevent interface initializes the attributes of a compositionevent object instance.
console.assert() - Web APIs
WebAPIConsoleassert
the console.assert() method writes an error message to the console if the assertion is false.
console.clear() - Web APIs
WebAPIConsoleclear
the console.clear() method clears the console if the environment allows it.
console.count() - Web APIs
WebAPIConsolecount
the console.count() method logs the number of times that this particular call to count() has been called.
Console.countReset() - Web APIs
the console.countreset() method resets counter used with console.count().
console.debug() - Web APIs
WebAPIConsoledebug
the console method debug() outputs a message to the web console at the "debug" log level.
Console.dir() - Web APIs
WebAPIConsoledir
the console method dir() displays an interactive list of the properties of the specified javascript object.
Console.info() - Web APIs
WebAPIConsoleinfo
the console.info() method outputs an informational message to the web console.
console.log() - Web APIs
WebAPIConsolelog
the console method log() outputs a message to the web console.
Console.profileEnd() - Web APIs
the profileend method stops recording a profile previously started with console.profile().
ConvolverNode - Web APIs
methods no specific method; inherits methods from its parent, audionode.
CountQueuingStrategy.size() - Web APIs
the size() method of the countqueuingstrategy interface always returns 1, so that the total queue size is a count of the number of chunks in the queue.
CountQueuingStrategy - Web APIs
methods countqueuingstrategy.size() returns 1.
Credential - Web APIs
methods none.
Credential Management API - Web APIs
credentialscontainer exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
CryptoKeyPair - Web APIs
examples the examples for subtlecrypto methods often use cryptokeypair objects.
CustomElementRegistry.define() - Web APIs
the define() method of the customelementregistry interface defines a new custom element.
CustomElementRegistry.get() - Web APIs
the get() method of the customelementregistry interface returns the constructor for a previously-defined custom element.
CustomElementRegistry.upgrade() - Web APIs
the upgrade() method of the customelementregistry interface upgrades all shadow-containing custom elements in a node subtree, even before they are connected to the main document.
CustomElementRegistry.whenDefined() - Web APIs
the whendefined() method of the customelementregistry interface returns a promise that resolves when the named element is defined.
DOMConfiguration - Web APIs
ections", "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 - 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.
DOMImplementation.createDocument() - Web APIs
the domimplementation.createdocument() method creates and returns an xmldocument.
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().
DOMImplementation.createHTMLDocument() - Web APIs
the domimplementation.createhtmldocument() method creates a new html document.
DOMImplementationList - Web APIs
methods domimplementationlist.item() returns the pos item.
DOMLocator - Web APIs
methods this interface neither implements, nor inherits, any method.
DOMParser() - Web APIs
this object can be used to parse the text of a document using the parsefromstring() method.
DOMPoint.fromPoint() - Web APIs
the static dompoint method frompoint() creates and returns a new mutable dompoint object given a source point.
DOMPointInit.x - Web APIs
WebAPIDOMPointInitx
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.
DOMPointInit - Web APIs
it's used as an input parameter to the dompoint/dompointreadonly method frompoint().
DOMPointReadOnly.fromPoint() - Web APIs
the static dompointreadonly method frompoint() creates and returns a new dompointreadonly object given a source point.
DOMQuad - Web APIs
WebAPIDOMQuad
methods domquad.fromrect() returns a new domquad object based on the passed set of coordinates.
DOMRectReadOnly - Web APIs
static methods domrectreadonly.fromrect() creates a new domrect object with a given location and dimensions.
Binary strings - Web APIs
WebAPIDOMStringBinary
in the past, this had to be simulated by treating the raw data as a string and using the charcodeat() method to read the bytes from the data buffer (i.e., using binary strings).
DOMString - Web APIs
WebAPIDOMString
passing null to a method or parameter accepting a domstring typically stringifies to "null".
DOMStringList - Web APIs
methods domstringlist.item() returns a domstring.
DOMTokenList.add() - Web APIs
WebAPIDOMTokenListadd
the add() method of the domtokenlist interface adds the given token to the list.
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.
DOMTokenList.entries() - Web APIs
the domtokenlist.entries() method returns an iterator allowing you to go through all key/value pairs contained in this object.
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.
DOMTokenList.item() - Web APIs
WebAPIDOMTokenListitem
the item() method of the domtokenlist interface returns an item in the list by its index.
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.
DOMTokenList.remove() - Web APIs
the remove() method of the domtokenlist interface removes the specified tokens from the list.
DOMTokenList.toggle() - Web APIs
the toggle() method of the domtokenlist interface removes a given token from the list and returns false.
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.
DOMUserData - Web APIs
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.
DataTransferItemList.DataTransferItem() - Web APIs
the datatransferitem() getter method implements support for accessing items in the datatransferitemlist using array-style syntax (that is datatransferitem[index]).
DedicatedWorkerGlobalScope.onmessage - Web APIs
when a message is sent to the worker using the worker.postmessage method.
DelayNode.delayTime - Web APIs
delaytime is expressed in seconds, its minimal value is 0, and its maximum value is defined by the maxdelaytime argument of the audiocontext.createdelay() method that created it.
DeprecationReportBody - Web APIs
a deprecated api method) is used on a document being observed by a reportingobserver.
Using light sensors - Web APIs
10 ~ 50 lux : dim environment 100 ~ 1000 lux : normal > 10000 lux : bright it uses the addeventlistener method of the window object.
Document.caretRangeFromPoint() - Web APIs
the caretrangefrompoint() method of the document interface returns a range object for the document fragment under the specified coordinates.
Document.close() - Web APIs
WebAPIDocumentclose
the document.close() method finishes writing to a document, opened with document.open().
Document.createAttribute() - Web APIs
the document.createattribute() method creates a new attribute node, and returns it.
Document.createCDATASection() - Web APIs
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).
Document.createElementNS() - Web APIs
to create an element without specifying a namespace uri, use the createelement() method.
Document.createEntityReference() - Web APIs
prior to gecko 7.0 this method showed up as present, due to bug bug 9850, it always only returned null.
Document.createEvent() - Web APIs
many methods used with createevent, such as initcustomevent, are deprecated.
Document.createNSResolver() - Web APIs
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.
Document.createTextNode() - Web APIs
this method can be used to escape html characters.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
these are supported values for the resulttype parameter of the evaluate method: result type value description any_type 0 whatever type naturally results from the given expression.
Document.execCommand() - Web APIs
when an html document has been switched to designmode, its document object exposes an execcommand method to run commands that manipulate the current editable region, such as form inputs or contenteditable elements.
Document.exitFullscreen() - Web APIs
the document method exitfullscreen() requests that the element on this document which is currently being presented in full-screen mode be taken out of full-screen mode, restoring the previous state of the screen.
Document.exitPointerLock() - Web APIs
the exitpointerlock() method asynchronously releases a pointer lock previously requested through element.requestpointerlock.
Document.getAnimations() - Web APIs
the getanimations() method of the document interface returns an array of all animation objects currently in effect whose target elements are descendants of the document.
Document.hasStorageAccess() - Web APIs
the hasstorageaccess() method of the document interface returns a promise that resolves with a boolean value indicating whether the document has access to its first-party storage.
Document.images - Web APIs
WebAPIDocumentimages
usage notes you can use either javascript array notation or the item() method on the returned collection to access the items in the collection.
Document.location - Web APIs
WebAPIDocumentlocation
the document.location read-only property returns a location object, which contains information about the url of the document and provides methods for changing that url and loading another url.
Document.mozSetImageElement() - Web APIs
the document.mozsetimageelement() method changes the element being used as the css background for a background with a given background element id.
Document.popupNode - Web APIs
in these other cases, for example when calling the popup's showpopup method, you may wish to set the popupnode property directly beforehand.
Document.queryCommandState() - Web APIs
the querycommandstate() method will tell you if the current selection has a certain document.execcommand() command applied.
Document.queryCommandSupported() - Web APIs
the document.querycommandsupported() method reports whether or not the specified editor command is supported by the browser.
Document.querySelector() - Web APIs
the document method queryselector() returns the first element within the document that matches the specified selector, or group of selectors.
Document.registerElement() - Web APIs
the document.registerelement() method registers a new custom element in the browser and returns a constructor for the new element.
Document.releaseCapture() - Web APIs
the releasecapture() method releases mouse capture if it's currently enabled on an element within this document.
Document.requestStorageAccess() - Web APIs
the requeststorageaccess() method of the document interface returns a promise that resolves if the access to first-party storage was granted, and rejects if access was denied.
Document.tooltipNode - Web APIs
syntax document.tooltipnode; specification xul-specific method.
Document: wheel event - Web APIs
nt.deltay * -2; } else { // zoom out scale /= event.deltay * 2; } // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); document.onwheel = zoom; addeventlistener equivalent the event handler can also be set up using the addeventlistener() method: document.addeventlistener('wheel', zoom); specifications specification status comment ui eventsthe definition of 'wheel' in that specification.
Document.write() - Web APIs
WebAPIDocumentwrite
the document.write() method writes a string of text to a document stream opened by document.open().
DocumentFragment.querySelectorAll() - Web APIs
the documentfragment.queryselectorall() method returns a nodelist of elements within the documentfragment (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors.
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
currently this method is only implemented in firefox, and only available to chrome code.
DocumentOrShadowRoot.nodesFromPoint() - Web APIs
currently this method is only implemented in firefox, and only available to chrome code.
DocumentOrShadowRoot - Web APIs
methods documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node.
DocumentType - Web APIs
methods inherits methods from its parent, node, and implements the childnode interface.
Document Object Model (DOM) - Web APIs
dom methods allow programmatic access to the tree.
EXT_blend_minmax - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
EXT_disjoint_timer_query.beginQueryEXT() - Web APIs
the ext_disjoint_timer_query.beginqueryext() method of the webgl api starts a timer query.
EXT_disjoint_timer_query.createQueryEXT() - Web APIs
the ext_disjoint_timer_query.createqueryext() method of the webgl api creates and initializes webglquery objects, which track the time needed to fully complete a set of gl commands.
EXT_disjoint_timer_query.deleteQueryEXT() - Web APIs
the ext_disjoint_timer_query.deletequeryext() method of the webgl api deletes a given webglquery object.
EXT_disjoint_timer_query.endQueryEXT() - Web APIs
the ext_disjoint_timer_query.endqueryext() method of the webgl api ends a timer query.
EXT_disjoint_timer_query.getQueryEXT() - Web APIs
the ext_disjoint_timer_query.getqueryext() method of the webgl api returns information about a query target.
EXT_disjoint_timer_query.getQueryObjectEXT() - Web APIs
the ext_disjoint_timer_query.getqueryobjectext() method of the webgl api returns the state of a query object.
EXT_disjoint_timer_query.isQueryEXT() - Web APIs
the ext_disjoint_timer_query.isqueryext() method of the webgl api returns true if the passed object is a webglquery object.
EXT_disjoint_timer_query.queryCounterEXT() - Web APIs
the ext_disjoint_timer_query.querycounterext() method of the webgl api records the current time into the corresponding query object.
EXT_float_blend - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
EXT_frag_depth - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
EXT_shader_texture_lod - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
EXT_texture_compression_bptc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
EXT_texture_compression_rgtc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
EXT_texture_filter_anisotropic - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
Element.attachShadow() - Web APIs
the element.attachshadow() method attaches a shadow dom tree to the specified element and returns a reference to its shadowroot.
Element.attributes - Web APIs
it is a namednodemap, not an array, so it has no array methods and the attr nodes' indexes may differ among browsers.
Element.closest() - Web APIs
WebAPIElementclosest
the closest() method traverses the element and its parents (heading toward the document root) until it finds a node that matches the provided selector string.
Element: compositionend event - Web APIs
the compositionend event is fired when a text composition system such as an input method editor completes or cancels the current composition session.
Element: compositionstart event - Web APIs
the compositionstart event is fired when a text composition system such as an input method editor starts a new composition session.
Element: compositionupdate event - Web APIs
the compositionupdate event is fired when a new character is received in the context of a text composition session controlled by a text composition system such as an input method editor.
Element.computedStyleMap() - Web APIs
the computedstylemap() method of the element interface returns a stylepropertymapreadonly interface which provides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration.
Element: contextmenu event - Web APIs
any right-click event that is not disabled (by calling the event's preventdefault() method) will result in a contextmenu event being fired at the targeted element.
Element.createShadowRoot() - Web APIs
this method has been deprecated in favor of attachshadow().
Element.currentStyle - Web APIs
element.currentstyle is a proprietary property which is similar to the standardized window.getcomputedstyle() method.
Element.getAttribute() - Web APIs
the getattribute() method of the element interface returns the value of a specified attribute on the element.
Element.getAttributeNames() - Web APIs
the getattributenames() method of the element interface returns the attribute names of the element as an array of strings.
Element.getAttributeNode() - 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) getattributens g...
Element.getBoundingClientRect() - Web APIs
the element.getboundingclientrect() method returns the size of an element and its position relative to the viewport.
Element.getElementsByTagName() - Web APIs
the element.getelementsbytagname() method returns a live htmlcollection of elements with the given tag name.
Element.getElementsByTagNameNS() - Web APIs
the element.getelementsbytagnamens() method returns a live htmlcollection of elements with the given tag name belonging to the given namespace.
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) getattributens g...
Element.hasAttributes() - Web APIs
the hasattributes() method of the element interface returns a boolean indicating whether the current element has any attributes or not.
Element.hasPointerCapture() - Web APIs
the haspointercapture() method of the element interface sets whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer id.
Element.insertAdjacentElement() - Web APIs
the insertadjacentelement() method of the element interface inserts a given element node at a given position relative to the element it is invoked upon.
Element.matches() - Web APIs
WebAPIElementmatches
the matches() method checks to see if the element would be selected by the provided selectorstring -- in other words -- checks if the element "is" the selector.
Element.name - Web APIs
WebAPIElementname
name can be used in the document.getelementsbyname() method, a form and with the form elements collection.
Element.namespaceURI - Web APIs
you can create an element with the specified namespaceuri using the dom level 2 method document.createelementns.
Element.requestPointerLock() - Web APIs
the element.requestpointerlock() method lets you asynchronously ask for the pointer to be locked on the given element.
Element.scroll() - Web APIs
WebAPIElementscroll
the scroll() method of the element interface scrolls the element to a particular set of coordinates inside a given element.
Element.scrollBy() - Web APIs
WebAPIElementscrollBy
the scrollby() method of the element interface scrolls an element by the given amount.
Element.scrollIntoView() - Web APIs
the element interface's scrollintoview() method scrolls the element's parent container such that the element on which scrollintoview() is called is visible to the user syntax element.scrollintoview(); element.scrollintoview(aligntotop); // boolean parameter element.scrollintoview(scrollintoviewoptions); // object parameter parameters aligntotop optional is a boolean value: if true, the top of the element will be aligned to the top of the visible area of the scrollable ancestor.
Element.scrollTo() - Web APIs
WebAPIElementscrollTo
the scrollto() method of the element interface scrolls to a particular set of coordinates inside a given element.
Element.setAttribute() - 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) getattributens g...
Element.setAttributeNodeNS() - 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) getattributens g...
Element.setCapture() - Web APIs
call this method during the handling of a mousedown event to retarget all mouse events to this element until the mouse button is released or document.releasecapture() is called.
Element: wheel event - Web APIs
} function zoom(event) { event.preventdefault(); scale += event.deltay * -0.01; // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); el.onwheel = zoom; addeventlistener equivalent the event handler can also be set up using the addeventlistener() method: el.addeventlistener('wheel', zoom); specifications specification status comment ui eventsthe definition of 'wheel' in that specification.
ElementCSSInlineStyle.style - Web APIs
the following code snippet demonstrates the difference between the values obtained using the element's style property and that obtained using the getcomputedstyle() method: <!doctype html> <html> <body style="font-weight:bold;"> <div style="color:red" id="myelement">..</div> </body> </html> var element = document.getelementbyid("myelement"); var out = ""; var elementstyle = element.style; var computedstyle = window.getcomputedstyle(element, null); for (prop in elementstyle) { if (elementstyle.hasownproperty(prop)) { out += " " + prop + " = '" + e...
ElementCSSInlineStyle - Web APIs
when getting, it returns a cssstyledeclaration object that contains a list of all styles properties for that element with values assigned for the attributes that are defined in the element's inline style attribute.methodsthis interface has no methods.
ErrorEvent - Web APIs
methods inherits methods from its parent event.
Event.composedPath() - Web APIs
the composedpath() method of the event interface returns the event’s path which is an array of the objects on which listeners will be invoked.
Event.defaultPrevented - Web APIs
note: you should use this instead of the non-standard, deprecated getpreventdefault() method (see bug 691151).
Event.preventDefault() - Web APIs
the event interface's preventdefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
Event.stopImmediatePropagation() - Web APIs
the stopimmediatepropagation() method of the event interface prevents other listeners of the same event from being called.
EventListener.handleEvent() - Web APIs
the eventlistener method handleevent() method is called by the user agent when an event is sent to the eventlistener, in order to handle events that occur on an observed eventtarget.
EventListener - Web APIs
methods this interface doesn't inherit any methods.
EventTarget.removeEventListener() - Web APIs
the eventtarget.removeeventlistener() method removes from the eventtarget an event listener previously registered with eventtarget.addeventlistener().
ExtendableEvent - Web APIs
methods inherits methods from its parent, event.
ExtendableMessageEvent - Web APIs
methods inherits methods from its parent, extendableevent.
FeaturePolicy.allowsFeature() - Web APIs
the allowsfeature() method of the featurepolicy interface enables introspection of individual directives of the feature policy it is run on.
FeaturePolicy.features() - Web APIs
the features() method of the featurepolicy interface returns a list of names of all features supported by the user agent.
FeaturePolicy.getAllowlistForFeature() - Web APIs
the getallowlistforfeature() method of the featurepolicy allows query of the allow list for a specific feature for the current feature policy.
FeaturePolicy - Web APIs
featurepolicy methods featurepolicy.allowsfeature returns a boolean that indicates whether or not a particular feature is enabled in the specified context.
FederatedCredential - Web APIs
methods none.
FetchEvent.clientId - Web APIs
the clients.get() method could then be passed this id to retrieve the associated client.
File.getAsDataURL() - Web APIs
WebAPIFilegetAsDataURL
note: this method is obsolete; you should use the filereader method readasdataurl() instead.
File - Web APIs
WebAPIFile
instance methods the file interface doesn't define any methods, but inherits methods from the blob interface: blob.prototype.slice([start[, end[, contenttype]]]) returns a new blob object containing the data in the specified range of bytes of the source blob.
FileError - Web APIs
WebAPIFileError
error callbacks are not optional for your sanity although error callbacks are optional, you should include them in the arguments of the methods for the sake of the sanity of your users.
FileReader.abort() - Web APIs
WebAPIFileReaderabort
the abort method aborts the read operation.
FileReader.readAsDataURL() - Web APIs
the readasdataurl method is used to read the contents of the specified blob or file.
FileRequest - Web APIs
methods none.
FileSystemDirectoryReader - Web APIs
methods readentries() returns an array containing some number of the directory's entries.
FileSystemEntry.copyTo() - Web APIs
the filesystementry interface's method copyto() copies the file specified by the entry to a new location on the file system.
FileSystemEntry.getMetadata() - Web APIs
} the filesystementry interface's method getmetadata() obtains a metadata object with information about the file system entry, such as its modification date and time and its size.
FileSystemEntry.moveTo() - Web APIs
the filesystementry interface's method moveto() moves the file specified by the entry to a new location on the file system, or renames the file if the destination directory is the same as the source.
FileSystemEntry.remove() - Web APIs
the filesystementry interface's method remove() deletes the file or directory from the file system.
FileSystemEntry.toURL() - Web APIs
the filesystementry interface's method tourl() creates and returns a string containing a url which can be used to identify the file system entry.
File and Directory Entries API - Web APIs
filesystemflags defines a set of values which are used when specifying option flags when calling certain methods in the file and directory entries api.
FontFace.load - Web APIs
WebAPIFontFaceload
the load() method of the fontface interface loads a font based on current object's constructor-passed requirements, including a location or source buffer, and returns a promise that resolves with the current fontface object.
FontFace - Web APIs
WebAPIFontFace
methods this interface doesn't inherit any method.
FontFaceSet.check() - Web APIs
WebAPIFontFaceSetcheck
the check() method of the fontfaceset returns whether all fonts in the given font list have been loaded and are available.
FontFaceSet.load() - Web APIs
WebAPIFontFaceSetload
the load() method of the fontfaceset forces all the fonts given in parameters to be loaded.
FontFaceSet - Web APIs
methods fontfaceset.add() adds a font to the font set.
Frame Timing API - Web APIs
this method returns a list of "frame" performanceentry objects.
Gamepad - Web APIs
WebAPIGamepad
a gamepad object can be returned in one of two ways: via the gamepad property of the gamepadconnected and gamepaddisconnected events, or by grabbing any position in the array returned by the navigator.getgamepads() method.
GamepadHapticActuator.pulse() - Web APIs
the pulse() method of the gamepadhapticactuator interface makes the hardware pulse at a certain intensity for a specified duration.
GamepadHapticActuator - Web APIs
methods gamepadhapticactuator.pulse() read only makes the hardware pulse at a certain intensity for a specified duration.
Geolocation.getCurrentPosition() - Web APIs
the geolocation.getcurrentposition() method is used to get the current position of the device.
Geolocation.watchPosition() - Web APIs
the geolocation method watchposition() method is used to register a handler function that will be called automatically each time the position of the device changes.
GeolocationCoordinates - Web APIs
methods the geolocationcoordinates interface neither implements, nor inherits any method.
GeolocationPosition - Web APIs
methods the geolocationposition interface neither implements, nor inherits any methods.
GeolocationPositionError - Web APIs
methods the geolocationpositionerror interface neither implements nor inherits any method.
GeometryUtils - Web APIs
methods geometryutils.getboxquads() returns a list of domquad objects representing the css fragments of the node.
GlobalEventHandlers.onanimationcancel - Web APIs
function handlecancelevent(event) { log("animation canceled", event); }; then we add a method to handle toggle display between "flex" and "none" and establish it as the handler for a click event on the "hide/show" the box button: document.getelementbyid('togglebox').addeventlistener('click', function() { if (box.style.display == "none") { box.style.display = "flex"; document.getelementbyid("togglebox").innerhtml = "hide the box"; } else { box.style.display = "none"; d...
GlobalEventHandlers.onauxclick - Web APIs
you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible.
GlobalEventHandlers.oncancel - Web APIs
you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible.
GlobalEventHandlers.onclick - Web APIs
you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible.
GlobalEventHandlers.onclose - Web APIs
you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible.
GlobalEventHandlers.oncontextmenu - Web APIs
you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible.
GlobalEventHandlers.ondblclick - Web APIs
you may prefer to use the eventtarget.addeventlistener() method instead, since it's more flexible.
GlobalEventHandlers.onemptied - Web APIs
the emptied event is fired when the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
GlobalEventHandlers.oninvalid - Web APIs
the validity of submittable elements is checked before submitting their owner form, or after the checkvalidity() method of the element or its owner form is called.
GlobalEventHandlers.onscroll - Web APIs
for greater flexibility, you can pass a scroll event to the eventtarget.addeventlistener() method instead.
GlobalEventHandlers - Web APIs
methods this interface defines no methods.
Audio() - Web APIs
usage notes you can also use other element-creation methods, such as the document object's createelement() method, to construct a new htmlaudioelement.
HTMLBRElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLBaseFontElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLBodyElement - Web APIs
methods no specific methods; inherits methods from its parent, htmlelement, and from windoweventhandlers.
HTMLCanvasElement.toBlob() - Web APIs
the htmlcanvaselement.toblob() method creates a blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent.
HTMLCanvasElement.toDataURL() - Web APIs
the htmlcanvaselement.todataurl() method returns a data uri containing a representation of the image in the format specified by the type parameter (defaults to png).
HTMLCanvasElement.transferControlToOffscreen() - Web APIs
the htmlcanvaselement.transfercontroltooffscreen() method transfers control to an offscreencanvas object, either on the main thread or on a worker.
HTMLContentElement.getDistributedNodes() - Web APIs
the htmlcontentelement.getdistributednodes() method returns a static nodelist of the distributed nodes associated with this <content> element.
HTMLContentElement - Web APIs
methods this interface inherits the methods of htmlelement.
HTMLDListElement - Web APIs
methods no specific methods; inherits methods from its parent, htmlelement.
HTMLDataElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLDataListElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLDetailsElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLDivElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLDocument - Web APIs
the htmldocument interface, which may be accessed through the window.htmldocument property, extends the window.htmldocument property to include methods and properties that are specific to html documents.
HTMLElement.click() - Web APIs
WebAPIHTMLElementclick
the htmlelement.click() method simulates a mouse click on an element.
HTMLEmbedElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLFontElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLFormControlsCollection.namedItem() - Web APIs
the htmlformcontrolscollection.nameditem() method returns the radionodelist or the element in the collection whose name or id match the specified name, or null if no node matches.
HTMLFormElement.reportValidity() - Web APIs
the htmlformelement.reportvalidity() method returns true if the element's child controls satisfy their validation constraints.
HTMLFormElement: submit event - Web APIs
the event is not sent to the form when calling the form.submit() method directly.
HTMLFrameSetElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement and from windoweventhandlers.
HTMLHRElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLHyperlinkElementUtils.toString() - Web APIs
the htmlhyperlinkelementutils.tostring() stringifier method returns a usvstring containing the whole url.
HTMLIFrameElement.setNfcFocus() - Web APIs
the setnfcfocus() method of the htmliframeelement interface sets whether an <iframe> can receive an nfc event.
HTMLImageElement.naturalWidth - Web APIs
the corresponding naturalheight method returns the natural height of the image.
HTMLImageElement.sizes - Web APIs
: 16px "open sans", verdana, arial, helvetica, sans-serif; } article img { display: block; max-width: 100%; border: 1px solid #888; box-shadow: 0 0.5em 0.3em #888; margin-bottom: 1.25em; } javascript the javascript code handles the two buttons that let you toggle the third width option between 40em and 50em; this is done by handling the click event, using the javascript string object method replace() to replace the relevant portion of the sizes string.
HTMLInputElement: invalid event - Web APIs
the validity of submittable elements is checked before submitting their owner <form>, or after the checkvalidity() method of the element or its owner <form> is called.
HTMLInputElement.select() - Web APIs
the htmlinputelement.select() method selects all the text in a <textarea> element or in an <input> element that includes a text field.
HTMLInputElement.setRangeText() - Web APIs
the htmlinputelement.setrangetext() method replaces a range of text in an <input> or <textarea> element with a new string.
HTMLIsIndexElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLMediaElement.audioTracks - Web APIs
the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method.
HTMLMediaElement.canPlayType() - Web APIs
the htmlmediaelement method canplaytype() reports how likely it is that the current browser will be able to play media of a given mime type.
HTMLMediaElement.currentTime - Web APIs
if the media is not yet playing, the value of currenttime indicates the time position within the media at which playback will begin once the play() method is called.
HTMLMediaElement: emptied event - Web APIs
the emptied event is fired when the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
HTMLMediaElement.fastSeek() - Web APIs
the htmlmediaelement.fastseek() method quickly seeks the media to the new time with precision tradeoff.
HTMLMediaElement.pause() - Web APIs
the htmlmediaelement.pause() method will pause playback of the media, if the media is already in a paused state this method will have no effect.
HTMLMediaElement.setSinkId() - Web APIs
the htmlmediaelement.setsinkid() method sets the id of the audio device to use for output and returns a promise.
HTMLMediaElement.videoTracks - Web APIs
the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method.
HTMLMenuElement - Web APIs
="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmenuelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesthis interface has no properties, but inherits properties from: htmlelementmethodsthis interface has no methods, but inherits methods from: htmlelement specifications specification status comment html living standardthe definition of 'htmlmenuelement' in that specification.
HTMLMenuItemElement - Web APIs
" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmenuitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesthis interface has no properties, but inherits properties from: htmlelementmethodsthis interface has no methods, but inherits methods from: htmlelement specifications specification status comment html 5.1the definition of 'htmlmenuitemelement' in that specification.
HTMLModElement - Web APIs
the htmlmodelement interface provides special properties (beyond the regular methods and properties available through the htmlelement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>.
HTMLOListElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLObjectElement.checkValidity - Web APIs
the checkvalidity() method of the htmlobjectelement interface returns a boolean that always is true, because object objects are never candidates for constraint validation.
HTMLElement.blur() - Web APIs
the htmlelement.blur() method removes keyboard focus from the current element.
HTMLOrForeignElement - Web APIs
write access to all the custom data attributes (data-*) set on the element.nonce the nonce property of the htmlorforeignelement interface returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed.tabindexthe tabindex property of the htmlorforeignelement interface represents the tab order of the current element.methodsblur()the htmlelement.blur() method removes keyboard focus from the current element.focus()the htmlelement.focus() method sets focus on the specified element, if it can be focused.
HTMLParagraphElement - Web APIs
methods no specific methods, inherits methods from its parent, htmlelement.
HTMLParamElement - Web APIs
methods no specific methods, inherits methods from its parent, htmlelement.
HTMLSelectElement.checkValidity() - Web APIs
the htmlselectelement.checkvalidity() method checks whether the element has any constraints and whether it satisfies them.
HTMLSelectElement.form - Web APIs
syntax edit aform = aselectelement.form.selectname; example html <form action="http://www.google.com/search" method="get"> <label>google: <input type="search" name="q"></label> <input type="submit" value="search..."> </form> javascript a property available on all form elements, "type" returns the type of the calling form element.
HTMLSelectElement.item() - Web APIs
the htmlselectelement.item() method returns the element corresponding to the htmloptionelement whose position in the options list corresponds to the index given in the parameter, or null if there are none.
HTMLSelectElement.namedItem() - Web APIs
the htmlselectelement.nameditem() method returns the htmloptionelement corresponding to the htmloptionelement whose name or id match the specified name, or null if no option matches.
HTMLSelectElement.setCustomValidity() - Web APIs
the htmlselectelement.setcustomvalidity() method sets the custom validity message for the selection element to the specified message.
HTMLShadowElement.getDistributedNodes() - Web APIs
the htmlshadowelement.getdistributednodes() method returns a static nodelist of the distributed nodes associated with this <shadow> element.
HTMLShadowElement - Web APIs
methods this interface inherits the methods of htmlelement.
HTMLSlotElement - Web APIs
methods htmlslotelement.assignednodes() returns a sequence of the nodes assigned to this slot, and if the flatten option is set to true, the assigned nodes of any other slots that are descendants of this slot.
HTMLStyleElement.type - Web APIs
for gecko, the type is most often given as "text/css." from the w3c spec on css: "the expectation is that binding-specific casting methods can be used to cast down from an instance of the cssrule interface to the specific derived interface implied by the type." syntax string = style.type; example if (newstyle.type != "text/css"){ // not supported!
HTMLTableCaptionElement - Web APIs
methods no specific method; inherits properties from its parent, htmlelement.
HTMLTableColElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLTableElement.deleteRow() - Web APIs
the htmltableelement.deleterow() method removes a specific row (<tr>) from a given <table>.
HTMLTableElement.deleteTFoot() - Web APIs
the htmltableelement.deletetfoot() method removes the <tfoot> element from a given <table>.
HTMLTableElement.insertRow() - Web APIs
the htmltableelement.insertrow() method inserts a new row (<tr>) in a given <table>, and returns a reference to the new row.
HTMLTableElement.rows - Web APIs
example myrows = mytable.rows; firstrow = mytable.rows[0]; lastrow = mytable.rows.item(mytable.rows.length-1); this demonstrates how you can use both array syntax (line 2) and the htmlcollection.item() method (line 3) to obtain individual rows in the table.
HTMLTableRowElement.insertCell() - Web APIs
the htmltablerowelement.insertcell() method inserts a new cell (<td>) into a table row (<tr>) and returns a reference to the cell.
HTMLTemplateElement - Web APIs
methods this interface inherits the methods of htmlelement.
HTMLTimeElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLTrackElement: cuechange event - Web APIs
bubbles no cancelable no interface event event handler oncuechange examples on the texttrack you can set up a listener for the cuechange event on a texttrack using the addeventlistener() method: track.addeventlistener('cuechange', function () { let cues = track.activecues; // array of current cues }); or you can just set the oncuechange event handler property: track.oncuechange = function () { let cues = track.activecues; // array of current cues } on the track element the underlying texttrack, indicated by the track property, receives a cuechange event every time the current...
HTMLTrackElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLUListElement - Web APIs
methods no specific method; inherits methods from its parent, htmlelement.
HTMLVideoElement.getVideoPlaybackQuality() - Web APIs
the htmlvideoelement method getvideoplaybackquality() creates and returns a videoplaybackquality object containing metrics including how many frames have been lost.
onMSVideoFormatChanged - Web APIs
syntax value description event property object.onmsvideoformatchanged = handler; attachevent method object.attachevent("onmsvideoformatchanged", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also htmlvideoelement microsoft api extensions ...
onMSVideoFrameStepCompleted - Web APIs
syntax value description event property object.onmsvideoframestepcompleted = handler; attachevent method object.attachevent("onmsvideoframestepcompleted", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also htmlvideoelement microsoft api extensions ...
onMSVideoOptimalLayoutChanged - Web APIs
syntax value description event property object.onmsvideooptimallayoutchanged = handler; attachevent method object.attachevent("onmsvideooptimallayoutchanged", handler) addeventlistener method object.addeventlistener("", handler, usecapture) synchronous no bubbles no cancelable no see also msislayoutoptimalforplayback htmlvideoelement microsoft api extensions ...
File drag and drop - Web APIs
in the following drop handler, if the browser supports datatransferitemlist interface, the getasfile() method is used to access each file; otherwise the datatransfer interface's files property is used to access each file.
HashChangeEvent - Web APIs
methods this interface has no methods of its own, but inherits the methods of its parent, event.
Headers.append() - Web APIs
WebAPIHeadersappend
the append() method of the headers interface appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist.
IDBCursor - Web APIs
WebAPIIDBCursor
methods idbcursor.advance() sets the number of times a cursor should move its position forward.
IDBCursorWithValue - Web APIs
s/web/api/idbcursorwithvalue" target="_top"><rect x="131" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbcursorwithvalue</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} methods inherits methods from its parent interface, idbcursor.
IDBIndex - Web APIs
WebAPIIDBIndex
methods inherits from: eventtarget idbindex.count() returns an idbrequest object, and in a separate thread, returns the number of records within a key range.
FileHandle.getFile() - Web APIs
summary the getfile method allows to retrieve a read-only snapshot of the handled file in the form of a file object.
FileHandle.onabort - Web APIs
these events occur when the associated locked file has been aborted with the lockedfile.abort() method.
FileHandle.open() - Web APIs
summary the open method returns a lockedfile object that allows to safely write in the file.
IDBObjectStore - Web APIs
methods idbobjectstore.add() returns an idbrequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store.
IDBTransaction.commit() - Web APIs
the commit() method of the idbtransaction interface commits the transaction if it is called on an active transaction.
IDBTransaction.error - Web APIs
this property is null if the transaction is not finished, is finished and successfully committed, or was aborted with the idbtransaction.abort method.
IDBTransaction.onabort - Web APIs
the onabort event handler of the idbtransaction interface handles the abort event, fired, when the current transaction is aborted via the idbtransaction.abort method.
IdleDeadline.didTimeout - Web APIs
if didtimeout is true, the idledeadline object's timeremaining() method will return approximately 0.
ImageBitmap.close() - Web APIs
WebAPIImageBitmapclose
the imagebitmap.close() method disposes of all graphical resources associated with an imagebitmap.
ImageBitmapRenderingContext - Web APIs
methods imagebitmaprenderingcontext.transferfromimagebitmap() displays the given imagebitmap in the canvas associated with this rendering context.
ImageCapture.getPhotoCapabilities() - Web APIs
the getphotocapabilities() method of the imagecapture interface returns a promise that resolves with a photocapabilities object containing the ranges of available configuration options.
ImageCapture.getPhotoSettings() - Web APIs
the getphotosettings() method of the imagecapture interface returns a promise that resolves with a photosettings object containing the current photo configuration settings.
ImageCapture.grabFrame() - Web APIs
the grabframe() method of the imagecapture interface takes a snapshot of the live video in a mediastreamtrack and returns a promise that resolves with a imagebitmap containing the snapshot.
ImageCapture.takePhoto() - Web APIs
the takephoto() method of the imagecapture interface takes a single exposure using the video capture device sourcing a mediastreamtrack and returns a promise that resolves with a blob containing the data.
ImageData - Web APIs
WebAPIImageData
it is created using the imagedata() constructor or creator methods on the canvasrenderingcontext2d object associated with a canvas: createimagedata() and getimagedata().
Basic concepts - Web APIs
old browsers implemented the now deprecated and removed idbdatabase.setversion() method.
IndexedDB API - Web APIs
this method returns an idbrequest object; asynchronous operations communicate to the calling application by firing events on idbrequest objects.
InputDeviceCapabilities - Web APIs
methods none.
InputEvent.dataTransfer - Web APIs
examples in the following simple example we've set up an event listener on the input event so that when any content is pasted into the contenteditable <p> element, its html source is retrieved via the inputevent.datatransfer.getdata() method and reported in the paragraph below the input.
InputEvent - Web APIs
methods this interface inherits methods from its parents, uievent and event.
InstallEvent - Web APIs
methods inherits methods from its parent, extendableevent.
IntersectionObserver.IntersectionObserver() - Web APIs
call its observe() method to begin watching for the visibility changes on a given target.
IntersectionObserver.disconnect() - Web APIs
the intersectionobserver method disconnect() stops watching all of its target elements for visibility changes.
IntersectionObserver.observe() - Web APIs
the intersectionobserver method observe() adds an element to the set of target elements being watched by the intersectionobserver.
IntersectionObserver - Web APIs
methods intersectionobserver.disconnect() stops the intersectionobserver object from observing any target.
IntersectionObserverEntry - Web APIs
methods this interface has no methods.
Keyboard.getLayoutMap() - Web APIs
the getlayoutmap() method of the keyboard interface returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys.
Keyboard.unlock() - Web APIs
WebAPIKeyboardunlock
the unlock() method of the keyboard interface unlocks all keys captured by the keyboard.lock() method and returns synchronously.
KeyboardEvent.code - Web APIs
function refresh() { let x = position.x - (shipsize.width/2); let y = position.y - (shipsize.height/2); let transform = "translate(" + x + " " + y + ") rotate(" + angle + " 15 15) "; spaceship.setattribute("transform", transform); } finally, the addeventlistener() method is used to start listening for keydown events, acting on each key by updating the ship position and rotation angle, then calling refresh() to draw the ship at its new position and angle.
KeyboardEvent.getModifierState() - Web APIs
the keyboardevent.getmodifierstate() method returns the current state of the specified modifier key: true if the modifier is active (that is the modifier key is pressed or locked), otherwise, false.
KeyboardLayoutMap.forEach() - Web APIs
the foreach() method of the keyboardlayoutmap interface executes a provided function once for each element of the map.
KeyboardLayoutMap.get() - Web APIs
the get() method of the keyboardlayoutmap interface returns the element with the given key.
KeyboardLayoutMap.has() - Web APIs
the has() method of the keyboardlayoutmap interface returns a boolean indicating whether the object has an element with the specified key.
KeyboardLayoutMap - Web APIs
methods keyboardlayoutmap.foreach() read only executes a provided function once for each element of keyboardlayoutmap.
KeyframeEffect.getKeyframes() - Web APIs
the getkeyframes() method of a keyframeeffect returns an array of the computed keyframes that make up this animation along with their computed offsets.
KeyframeEffect - Web APIs
methods this interface inherits some of its methods from its parent, animationeffect.
LargestContentfulPaint - Web APIs
methods largestcontentfulpaint.tojson() returns the above properties as json.
LayoutShift - Web APIs
methods layoutshift.tojson() converts the properties to json.
LinkStyle - Web APIs
WebAPILinkStyle
methods this interface implements no method.
Location: reload() - Web APIs
WebAPILocationreload
the location.reload() method reloads the current url, like the refresh button.
Location: toString() - Web APIs
WebAPILocationtoString
the tostring() stringifier method of the location interface returns a usvstring containing the whole url.
LockManager.query() - Web APIs
WebAPILockManagerquery
the query() method of the lockmanager interface returns a promise which resolves with an object containing information about held and pending locks.
LockedFile.abort() - Web APIs
WebAPILockedFileabort
summary the abort method is used to release the lock on the lockedfile object, making it inactive: its active property is set to false and all ongoing operations are canceled.
LockedFile.active - Web APIs
WebAPILockedFileactive
typically, a lockedfile object becomes inactive when the lockedfile.abort() method is called or if an error occurs.
LockedFile.append() - Web APIs
WebAPILockedFileappend
summary the append method is used to write some data at the end of the file.
LockedFile.getMetadata() - Web APIs
summary the getmetadata method allows to retrieve some metadata about the locked file.
LockedFile.onabort - Web APIs
these events occur when the locked file has been aborted with the lockedfile.abort() method.
LockedFile.write() - Web APIs
WebAPILockedFilewrite
summary the write method is used to write some data within the file.
MIDIAccess - Web APIs
the midiaccess interface of the web midi api provides methods for listing midi input and output devices, and obtaining access to those devices.
MSGraphicsTrust - Web APIs
this proprietary method is specific to internet explorer and microsoft edge.
MathMLElement - Web APIs
properties this interface has no properties, but inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement methods this interface has no methods, but inherits methods from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement examples mathml <math xmlns="http://www.w3.org/1998/math/mathml"> <msqrt> <mi>x</mi> </msqrt> </math> javascript document.queryselector('msqrt').constructor.name; // mathmlelement specifications specification status comment mathmlelement interface ...
MediaCapabilitiesInfo - Web APIs
the interface of the promise returned by the the mediacapabilities's encodinginfo() and decodinginfo() methods returning whether the media configuration tested is supported, smooth, and powerefficient.
MediaCapabilities - Web APIs
methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient.
MediaCapabilitiesInfo - Web APIs
the mediacapabilitiesinfo interface of the media capabilities api is made available when the promise returned by the mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() methods of the mediacapabilities interface fulfills, providing information as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient.
MediaDeviceInfo - Web APIs
methods none.
MediaDevices: devicechange event - Web APIs
bubbles no cancelable no interface event event handler ondevicechange example you can use the devicechange event in an addeventlistener method: navigator.mediadevices.addeventlistener('devicechange', function(event) { updatedevicelist(); }); or use the ondevicechange event handler property: navigator.mediadevices.ondevicechange = function(event) { updatedevicelist(); } specifications specification status media capture and streamsthe definition of 'devicechange' in that specification.
MediaDevices.enumerateDevices() - Web APIs
the mediadevices method enumeratedevices() requests a list of the available media input and output devices, such as microphones, cameras, headsets, and so forth.
MediaDevices.getSupportedConstraints() - Web APIs
the getsupportedconstraints() method of the mediadevices interface returns an object based on the mediatracksupportedconstraints dictionary, whose member fields each specify one of the constrainable properties the user agent understands.
MediaDevices.ondevicechange - Web APIs
this method is called any time we want to fetch the current list of media devices and then update the displayed lists of audo and video devices using that information.
MediaDevices - Web APIs
methods inherits methods from its parent interface, eventtarget.
MediaElementAudioSourceNode.mediaElement - Web APIs
this stream was specified when the node was first created, either using the mediaelementaudiosourcenode() constructor or the audiocontext.createmediaelementsource() method.
MediaError - Web APIs
methods this interface doesn't implement or inherit any methods, and has none of its own.
MediaKeyMessageEvent - Web APIs
methods inherits methods from its parent, event.
close() - Web APIs
the mediakeysession.close() method notifies that the current media session is no longer needed, and that the content decryption module should release any resources associated with this object and close it.
generateRequest() - Web APIs
the mediakeysession.generaterequest() method returns a promise after generating a media request based on initialization data.
load() - Web APIs
the mediakeysession.load() method returns a promise that resolves to a boolean value after loading data for a specified session object.
remove() - Web APIs
the mediakeysession.remove() method returns a promise after removing any session data associated with the current object.
update() - Web APIs
the mediakeysession.update() method loads messages and licenses to the cdm, and then returns a promise .
MediaKeySession - Web APIs
methods mediakeysession.close() returns a promise after notifying the current media session is no longer needed and that the cdm should release any resources associated with this object and close it.
MediaKeyStatusMap - Web APIs
methods mediakeystatusmap.entries() read only returns a new iterator object containing an array of [key, value] for each element in the status map, in insertion order.
createMediaKeys() - Web APIs
the mediakeysystemaccess.createmediakeys() method returns a promise that resolves to a new mediakeys object.
getConfiguration() - Web APIs
the mediakeysystemaccess.getconfiguration() method returns a mediakeysystemconfiguration object with the supported combination of configuration options.
createSession() - Web APIs
the mediakeys.createsession() method returns a new mediakeysession object, which represents a context for message exchange with a content decryption module (cdm).
setServerCertificate() - Web APIs
the mediakeys.setservercertificate() method a promise to a server certificate to be used to encrypt messages to the license server.
MediaKeys - Web APIs
WebAPIMediaKeys
methods mediakeys.createsession() returns a new mediakeysession object, which represents a context for message exchange with a content decryption module (cdm).
MediaPositionState.duration - Web APIs
the mediapositionstate dictionary's duration property is used when calling the mediasession method setpositionstate() to provide the user agent with the overall total duration in seconds of the media currently being performed.
MediaPositionState.playbackRate - Web APIs
the mediapositionstate dictionary's playbackrate property is used when calling the mediasession method setpositionstate() to tell the user agent the rate at which media is currently being played.
MediaPositionState.position - Web APIs
the mediapositionstate dictionary's position property is used when calling the mediasession method setpositionstate() to provide the user agent with the current playback position, in seconds, of the currently-playing media.
MediaQueryList.addListener() - Web APIs
the addlistener() method of the mediaquerylist interface adds a listener to the mediaquerylistener that will run a custom callback function in response to the media query status changing.
MediaQueryList.removeListener() - Web APIs
the removelistener() method of the mediaquerylist interface removes a listener from the mediaquerylistener.
MediaQueryListEvent - Web APIs
methods the mediaquerylistevent interface inherits methods from its parent interface, event.
MediaRecorder.isTypeSupported - Web APIs
the mediarecorder.istypesupported() static method returns a boolean which is true if the mime type specified is one the user agent should be able to successfully record.
MediaRecorder.onerror - Web APIs
these errors may occur either directly because of a call to a mediarecorder method, or indirectly due to a problem arising during the recording process.
MediaRecorder.onpause - Web APIs
the pause event is thrown as a result of the mediarecorder.pause() method being invoked.
MediaRecorder.onresume - Web APIs
the resume event is thrown as a result of the mediarecorder.resume() method being invoked.
MediaRecorder.onstart - Web APIs
the start event is thrown as a result of the mediarecorder.start() method being invoked.
MediaRecorder.onstop - Web APIs
the stop event is thrown either as a result of the mediarecorder.stop() method being invoked, or when the media stream being captured ends.
MediaRecorderErrorEvent.error - Web APIs
the descriptions here are generic ones; you'll find more specific ones to various scenarios in which they may occur in the corresponding method references.
MediaRecorderErrorEvent - Web APIs
methods inherits methods from its parent interface, event.
Media Session action types - Web APIs
to support an action on a media session, such as seeking, pausing, or changing tracks, you need to call the mediasession interface's setactionhandler() method to establish a handler for that action.
MediaSessionActionDetails - Web APIs
this property can be used to indicate that you should use the shortest possible method to seek the media.
MediaSource.addSourceBuffer() - Web APIs
the addsourcebuffer() method of the mediasource interface creates a new sourcebuffer of the given mime type and adds it to the mediasource's sourcebuffers list.
MediaSource.clearLiveSeekableRange() - Web APIs
the clearliveseekablerange() method of the mediasource interface clears a seekable range previously set with a call to setliveseekablerange().
MediaSource.endOfStream() - Web APIs
the endofstream() method of the mediasource interface signals the end of the stream.
MediaSource.isTypeSupported() - Web APIs
the mediasource.istypesupported() static method returns a boolean value which is true if the given mime type is likely to be supported by the current user agent.
MediaSource.removeSourceBuffer() - Web APIs
the removesourcebuffer() method of the mediasource interface removes the given sourcebuffer from the sourcebuffers list associated with this mediasource object.
MediaSource.setLiveSeekableRange() - Web APIs
the setliveseekablerange() method of the mediasource interface sets the range that the user can seek to in the media element.
MediaStream.clone() - Web APIs
WebAPIMediaStreamclone
the clone() method of the mediastream interface creates a duplicate of the mediastream.
MediaStream.getAudioTracks() - Web APIs
the getaudiotracks() method of the mediastream interface returns a sequence that represents all the mediastreamtrack objects in this stream's track set where mediastreamtrack.kind is audio.
MediaStream.getTracks() - Web APIs
the gettracks() method of the mediastream interface returns a sequence that represents all the mediastreamtrack objects in this stream's track set, regardless of mediastreamtrack.kind.
MediaStream.getVideoTracks() - Web APIs
the getvideotracks() method of the mediastream interface returns a sequence of mediastreamtrack objects representing the video tracks in this stream.
MediaStream - Web APIs
methods this interface inherits methods from its parent, eventtarget.
MediaStreamAudioSourceNode() - Web APIs
note: another way to create a mediastreamaudiosourcenode is to call theaudiocontext.createmediastreamsource() method, specifying the stream from which you want to obtain audio.
MediaStreamAudioSourceNode.mediaStream - Web APIs
this stream was specified when the node was first created, either using the mediastreamaudiosourcenode() constructor or the audiocontext.createmediastreamsource() method.
MediaStreamAudioSourceOptions - Web APIs
it is not needed when using the audiocontext.createmediastreamsource() method.
MediaStreamTrack.applyConstraints() - Web APIs
the applyconstraints() method of the mediastreamtrack interface applies a set of constraints to the track; these constraints let the web site or app establish ideal values and acceptable ranges of values for the constrainable properties of the track, such as frame rate, dimensions, echo cancelation, and so forth.
MediaStreamTrack.clone() - Web APIs
the clone() method of the mediastreamtrack interface creates a duplicate of the mediastreamtrack.
MediaStreamTrack.getCapabilities() - Web APIs
the getcapabilities() method of the mediastreamtrack interface returns a mediatrackcapabilities object which specifies the values or range of values which each constrainable property, based upon the platform and user agent.
MediaStreamTrack.getConstraints() - Web APIs
the getconstraints() method of the mediastreamtrack interface returns a mediatrackconstraints object containing the set of constraints most recently established for the track using a prior call to applyconstraints().
MediaStreamTrack.getSettings() - Web APIs
the getsettings() method of the mediastreamtrack interface returns a mediatracksettings object containing the current values of each of the constrainable properties for the current mediastreamtrack.
MediaStreamTrack - Web APIs
methods mediastreamtrack.applyconstraints() lets the application specify the ideal and/or ranges of acceptable values for any number of the available constrainable properties of the mediastreamtrack.
MediaStreamTrackAudioSourceNode() - Web APIs
another way to create a mediastreamtrackaudiosourcenode is to call theaudiocontext.createmediastreamtracksource() method, specifying the mediastreamtrack from which you want to obtain audio.
MediaStreamTrackAudioSourceOptions - Web APIs
it isn't needed when using the audiocontext.createmediastreamtracksource() method.
Recording a media element - Web APIs
then, in line 8, we arrange for preview.capturestream() to call preview.mozcapturestream() so that our code will work on firefox, on which the mediarecorder.capturestream() method is prefixed.
MediaStream Recording API - Web APIs
"; a.href = url; a.download = "test.webm"; a.click(); window.url.revokeobjecturl(url); } // demo: to download after 9sec settimeout(event => { console.log("stopping"); mediarecorder.stop(); }, 9000); examining and controlling the recorder status you can also use the properties of the mediarecorder object to determine the state of the recording process, and its pause() and resume() methods to pause and resume recording of the source media.
MediaTrackSupportedConstraints.cursor - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia().
MediaTrackSupportedConstraints.displaySurface - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia().
MediaTrackSupportedConstraints.frameRate - Web APIs
"not supported" with code to provide alternative methods for presenting the audiovisual information you want to share with the user or otherwise work with.
MediaTrackSupportedConstraints.logicalSurface - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia().
Media Session API - Web APIs
mediapositionstate used to contain information about the current playback position, playback speed, and overall media duration when calling the mediasession method setpositionstate() to establish the media's length, playback position, and playback speed.
Transcoding assets for Media Source Extensions - Web APIs
to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); // false mediasource.istypesupported('video/mp4'); // true mediasource.istypesupported('video/mp4; codecs="avc1.4d4028, mp4a.40.2"'); // true the string is the mime type of the container, optionally followed by a list of codecs.
Media Source API - Web APIs
returned by the htmlvideoelement.getvideoplaybackquality() method.
Media Capture and Streams API (Media Stream) - Web APIs
it provides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process.
MerchantValidationEvent.complete() - Web APIs
the merchantvalidationevent method complete() takes merchant-specific information previously received from the validationurl and uses it to validate the merchant.
MerchantValidationEvent.validationURL - Web APIs
this data should be passed into the complete() method to let the user agent complete the transaction.
MessageChannel.port1 - Web APIs
the handlemessage method is associated to the port1 to listen when the message arrives.
MessageChannel - Web APIs
when the iframe has loaded, we register an onmessage handler for messagechannel.port1 and transfer messagechannel.port2 to the iframe using the window.postmessage method along with a message.
MessagePort.close() - Web APIs
WebAPIMessagePortclose
the close() method of the messageport interface disconnects the port, so it is no longer active.
MessagePort: message event - Web APIs
this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; }); specifications specification status html living standard living standard ...
MessagePort: messageerror event - Web APIs
this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; myport.onmessageerror = (event) => { console.error(event.data); }; }); specifications specification status html livi...
MessagePort.postMessage() - Web APIs
the postmessage() method of the messageport interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
Metadata - Web APIs
WebAPIMetadata
this interface isn't available through the global scope; instead, you obtain a metadata object describing a filesystementry using the method filesystementry.getmetadata().
MimeTypeArray - Web APIs
methods mimetypearray.item() returns the mimetype object with the specified index.
MouseEvent.getModifierState() - Web APIs
the mouseevent.getmodifierstate() method returns the current state of the specified modifier key: true if the modifier is active (i.e., the modifier key is pressed or locked), otherwise, false.
MouseEvent.region - Web APIs
WebAPIMouseEventregion
example example of using the event.region combined with canvasrenderingcontext2d.addhitregion() method.
MutationObserver.MutationObserver() - Web APIs
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.
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.
MutationObserver - Web APIs
methods disconnect() stops the mutationobserver instance from receiving further notifications until and unless observe() is called again.
MutationObserverInit.attributeFilter - Web APIs
n.oldvalue, mutation.target.username); break; } break; } }); } var userlistelement = document.queryselector("#userlist"); var observer = new mutationobserver(callback); observer.observe(userlistelement, { attributefilter: [ "status", "username" ], attributeoldvalue: true, subtree: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects.
MutationObserverInit.attributeOldValue - Web APIs
+ " changed to " + mutation.target[mutation.attributename] + " (was " + mutation.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects.
MutationObserverInit.attributes - Web APIs
+ " changed to " + mutation.target[mutation.attributename] + " (was " + mutation.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects.
MutationObserverInit.characterData - Web APIs
so either pass directly a text node to the observe() method or you need to also set subtree: true.
MutationObserverInit - Web APIs
as such, it's primarily used as the type of the options parameter on the mutationobserver.observe() method.
MutationRecord - Web APIs
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.
NDEFReader - Web APIs
methods the ndefreader interface inherits the methods of eventtarget, its parent interface.
NDEFReadingEvent - Web APIs
methods inherits methods from its parent event.
NDEFRecord - Web APIs
methods ndefrecord.torecords() coverts ndefrecord.data to sequence of records.
NDEFWriter - Web APIs
methods ndefwriter.write() called to write ndef message to a tag (after ensuring hardware and ua compatibility and obtaining permission from the user) or get an error explaining why feature is not available.
NameList - Web APIs
WebAPINameList
properties namelist.length read only methods namelist.contains() returns a boolean.
NamedNodeMap.getNamedItem() - Web APIs
the getnameditem() method of the namednodemap interface returns the attr corresponding to the given name, or null if there is no corresponding attribute.
NamedNodeMap - Web APIs
methods this interface doesn't inherit any method.
Navigation Timing API - Web APIs
performancenavigationtiming provides methods and properties to store and retrieve metrics regarding the browser's document navigation events.
Navigator.battery - Web APIs
WebAPINavigatorbattery
the battery property has been removed in favor of the standard navigator.getbattery() method, which returns a battery promise.
Navigator.canShare() - Web APIs
the navigator.canshare() method of the web share api returns true if a call to navigator.share() would succeed.
Navigator.clipboard - Web APIs
use of the asynchronous clipboard read and write methods requires that the user grant the web site or app permission to access the clipboard.
Navigator.credentials - Web APIs
the credentials property of the navigator interface returns the credentialscontainer interface, which exposes methods to request credentials.
Navigator.geolocation - Web APIs
be aware that each browser has its own policies and methods for requesting this permission.
Navigator.getGamepads() - Web APIs
the navigator.getgamepads() method returns an array of gamepad objects, one for each gamepad connected to the device.
Navigator.locks - Web APIs
WebAPINavigatorlocks
the locks read-only property of the navigator interface returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object.
Navigator.mediaSession - Web APIs
in addition, the mediasession interface provides the setactionhandler() method, which lets you receive events when the user engages device controls such as either onscreen or physical play, pause, seek, and other similar controls.
Navigator.mozIsLocallyAvailable() - Web APIs
the navigator.mozislocallyavailable() method allows add-ons to determine whether or not a given resource is available.
Navigator.registerProtocolHandler() - Web APIs
the navigator method registerprotocolhandler() lets web sites register their ability to open or handle particular url schemes (aka protocols).
Navigator.share() - Web APIs
WebAPINavigatorshare
the navigator.share() method of the web share api invokes the native sharing mechanism of the device.
NavigatorConcurrentHardware - Web APIs
methods the navigatorconcurrenthardware mixin has no methods.
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.
NavigatorPlugins.mimeTypes - Web APIs
syntax var mimetypes[] = navigator.mimetypes; mimetypes is a mimetypearray object which has a length property as well as item(index) and nameditem(name) methods.
NavigatorPlugins.plugins - Web APIs
the returned value is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods.
NetworkInformation - Web APIs
methods this interface also inherits methods of its parent, eventtarget.
Network Information API - Web APIs
a real-world use case would likely use a switch statement or some other method to check all of the possible values of networkinformation.type.
Node.compareDocumentPosition() - Web APIs
the node.comparedocumentposition() method reports the position of the given node relative to another node in any document — not just the given node’s document.
Node.contains() - Web APIs
WebAPINodecontains
the node.contains() method returns a boolean value indicating whether a node is a descendant of a given node, i.e.
Node.getRootNode() - Web APIs
WebAPINodegetRootNode
the getrootnode() method of the node interface returns the context object's root, which optionally includes the shadow root if it is available.
Node.hasChildNodes() - Web APIs
the node.haschildnodes() method returns a boolean value indicating whether the given node has child nodes or not.
Node.isDefaultNamespace() - Web APIs
the node.isdefaultnamespace() method accepts a namespace uri as an argument and returns a boolean with a value of true if the namespace is the default namespace on the given node or false if not.
Node.isEqualNode() - Web APIs
WebAPINodeisEqualNode
the node.isequalnode() method tests whether two nodes are equal.
Node.isSameNode() - Web APIs
WebAPINodeisSameNode
the issamenode() method for node objects tests whether two nodes are the same (that is, whether they reference the same object).
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
you can create an element with the specified namespaceuri using the dom level 2 method document.createelementns and attributes with the method element.setattributens.
Node.normalize() - Web APIs
WebAPINodenormalize
the node.normalize() method puts the specified node and all of its sub-tree into a "normalized" form.
Node.replaceChild() - Web APIs
WebAPINodereplaceChild
the node.replacechild() method replaces a child node within the given (parent) node.
Node.rootNode - Web APIs
WebAPINoderootNode
important: for compatibility reasons, this property has been replaced by the node.getrootnode() method.
NodeIterator.expandEntityReferences - Web APIs
this takes precedence over the value of the nodeiterator.whattoshow method and the associated filter.
NodeList.entries() - Web APIs
WebAPINodeListentries
the nodelist.entries() method returns an iterator allowing to go through all key/value pairs contained in this object.
NodeList.prototype.forEach() - Web APIs
WebAPINodeListforEach
the foreach() method of the nodelist interface calls the callback given in parameter once for each value pair in the list, in insertion order.
NodeList.keys() - Web APIs
WebAPINodeListkeys
the nodelist.keys() method returns an iterator allowing to go through all keys contained in this object.
NodeList.values() - Web APIs
WebAPINodeListvalues
the nodelist.values() method returns an iterator allowing to go through all values contained in this object.
NonDocumentTypeChildNode.nextElementSibling - Web APIs
this method is now defined on the former.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
this method is now defined on the former.
Notation - Web APIs
WebAPINotation
inherits methods and properties from node.
NotificationEvent - Web APIs
methods inherits methods from its parent, extendableevent.
OES_fbo_render_mipmap - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
OES_vertex_array_object.bindVertexArrayOES() - Web APIs
the oes_vertex_array_object.bindvertexarrayoes() method of the webgl api binds a passed webglvertexarrayobject object to the buffer.
OES_vertex_array_object.createVertexArrayOES() - Web APIs
the oes_vertex_array_object.createvertexarrayoes() method of the webgl api creates and initializes a webglvertexarrayobject object that represents a vertex array object (vao) pointing to vertex array data and which provides names for different sets of vertex data.
OES_vertex_array_object.deleteVertexArrayOES() - Web APIs
the oes_vertex_array_object.deletevertexarrayoes() method of the webgl api deletes a given webglvertexarrayobject object.
OES_vertex_array_object.isVertexArrayOES() - Web APIs
the oes_vertex_array_object.isvertexarrayoes() method of the webgl api returns true if the passed object is a webglvertexarrayobject object.
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
the ovr_multiview2.framebuffertexturemultiviewovr() method of the webgl api attaches a multiview texture to a webglframebuffer.
OfflineAudioCompletionEvent - Web APIs
methods inherits methods from its parent, event.
OfflineAudioContext.resume() - Web APIs
the resume() method of the offlineaudiocontext interface resumes the progression of time in an audio context that has been suspended.
OfflineAudioContext.suspend() - Web APIs
the suspend() method of the offlineaudiocontext interface schedules a suspension of the time progression in the audio context at the specified time and returns a promise.
OffscreenCanvas.convertToBlob() - Web APIs
the offscreencanvas.converttoblob() method creates a blob object representing the image contained in the canvas.
OffscreenCanvas() - Web APIs
we then initialize a webgl context on it using the getcontext() method.
OffscreenCanvas.convertToBlob() - Web APIs
the offscreencanvas.converttoblob()method creates a blob object representing the image contained in the canvas.
OffscreenCanvas.getContext() - Web APIs
the offscreencanvas.getcontext() method returns a drawing context for an offscreen canvas, or null if the context identifier is not supported.
OffscreenCanvas.convertToBlob() - Web APIs
the offscreencanvas.converttoblob() method creates a blob object representing the image contained in the canvas.
OffscreenCanvas.transferToImageBitmap() - Web APIs
the offscreencanvas.transfertoimagebitmap() method creates an imagebitmap object from the most recently rendered image of the offscreencanvas.
OrientationSensor.populateMatrix() - Web APIs
the populatematrix method of the orientationsensor interface populates the given target matrix with the rotation matrix based on the latest sensor reading.
OscillatorNode.OscillatorNode() - Web APIs
if the default values of the properties are acceptable, you can optionally use the audiocontext.createoscillator() factory method instead.
OscillatorNode.setPeriodicWave() - Web APIs
the setperiodicwave() method of the oscillatornode interface is used to point to a periodicwave defining a periodic waveform that can be used to shape the oscillator's output, when type is custom.
OscillatorNode.start() - Web APIs
the start method of the oscillatornode interface specifies the exact time to start playing the tone.
OscillatorNode.stop() - Web APIs
the stop method of the oscillatornode interface specifies the time to stop playing the tone.
OscillatorNode.type - Web APIs
you never set type to custom manually; instead, use the setperiodicwave() method to provide the data representing the waveform.
OverconstrainedError - Web APIs
methods none.
ParentNode.childElementCount - Web APIs
this method is now defined on the latter.
ParentNode.children - Web APIs
you can access the individual child nodes in the collection by using either the item() method on the collection, or by using javascript array-style notation.
ParentNode.firstElementChild - Web APIs
this method is now defined on the latter.
ParentNode.lastElementChild - Web APIs
this method is now defined on the latter.
ParentNode.replaceChildren() - Web APIs
the parentnode.replacechildren() method replaces the existing children of a node with a specified new set of children.
PasswordCredential - Web APIs
<form id="form" method="post"> <input type="text" name="id" autocomplete="username" /> <input type="password" name="password" autocomplete="current-password" /> <input type="hidden" name="csrf_token" value="*****" /> </form> then, a reference to this form element, using it to create a passwordcredential object, and storing it in the browser's password system.
PasswordCredential.additionalData - Web APIs
navigator.credentials.get(options).then(function(creds) { if (creds.type == 'password') { var form = new formdata(); var csrf_token = document.queryselector('csrf_token').value; form.append('csrf_token', csrf_token); creds.additionaldata = form; fetch('https://www.example.com', { method: 'post', credentials: creds }); }; }); specifications specification status comment credential management level 1 working draft initial definition.
PasswordCredential - Web APIs
methods none.
PaymentRequest.abort() - Web APIs
the paymentrequest.abort() method of the paymentrequest interface causes the user agent to end the payment request and to remove any user interface that might be shown.
PaymentRequest.prototype.id - Web APIs
WebAPIPaymentRequestid
const details = { id: "super-store-order-123-12312", total: { label: "total due", amount: { currency: "usd", value: "65.00" }, }, }; const request = new paymentrequest(methoddata, details); console.log(request.id); // super-store-order-123-12312 the id is then also available in the paymentresponse returned from the show() method, but under the requestid attribute.
PaymentRequest.shippingOption - Web APIs
const request = new paymentrequest(methoddata, details, options); // async update to details request.onshippingaddresschange = ev => { ev.updatewith(checkshipping(request)); }; // sync update to the total request.onshippingoptionchange = ev => { const shippingoption = shippingoptions.find( option => option.id === request.id ); const newtotal = { currency: "usd", label: "total due", value: calculatenewtotal(shippin...
PaymentRequest: shippingaddresschange event - Web APIs
const paymentrequest = new paymentrequest(methoddata, details, options); paymentrequest.addeventlistener("shippingaddresschange", event => { let detailsupdate = checkaddress(paymentrequest.shippingaddress); event.updatewith(detailsupate); }, false); const checkaddress = theaddress => { let detailsupdate = {}; // check the address, return a paymentdetailsupdate object // with any changes or errors.
PaymentRequest: shippingoptionchange event - Web APIs
the revised total is submitted back to the payment request by calling the event's updatewith() method.
PaymentRequestEvent() - Web APIs
methoddata: an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.
PaymentRequestUpdateEvent.PaymentRequestUpdateEvent() - Web APIs
actual updates are made by passing options to the updatewith() method.
PaymentRequestUpdateEvent - Web APIs
methods in addition to methods inherited from the parent interface, event, paymentrequestupdateevent offers the following methods: paymentrequestupdateevent.updatewith() secure context if the event handler determines that information included in the payment request needs to be changed, or that new information needs to be added, it calls updatewith() with the information that needs to be replaced or...
PaymentResponse.shippingOption - Web APIs
it calls updatedetails() to toggle the shipping method between "standard" and "express".
performance.measure() - Web APIs
the measure() method creates a named timestamp in the browser's performance entry buffer between marks, the navigation start time, or the current time.
performance.now() - Web APIs
WebAPIPerformancenow
the performance.now() method returns a domhighrestimestamp, measured in milliseconds.
performance.toJSON() - Web APIs
the tojson() method of the performance interface is a standard serializer: it returns a json representation of the performance object's properties.
PerformanceEntry.entryType - Web APIs
function run_performanceentry() { // check for feature support before continuing if (performance.mark === undefined) { console.log("performance.mark not supported"); return; } // create a performance entry named "begin" via the mark() method performance.mark("begin"); // check the entrytype of all the "begin" entries var entriesnamedbegin = performance.getentriesbyname("begin"); for (var i=0; i < entriesnamedbegin.length; i++) { var typeofentry = entriesnamedbegin[i].entrytype; console.log("entry is type: " + typeofentry); } } specifications specification status comment performance ti...
PerformanceFrameTiming - Web APIs
methods this interface has no methods.
PerformanceMark - Web APIs
(a mark has no duration.) methods this interface has no methods.
PerformanceMeasure - Web APIs
methods this interface has no methods.
PerformanceNavigation.type - Web APIs
1 type_reload the page was accessed by clicking the reload button or via the location.reload() method.
PerformanceNavigationTiming.toJSON() - Web APIs
the tojson() method is a serializer - it returns a json representation of the performancenavigationtiming object.
PerformanceObserver() - Web APIs
the observer callback is invoked when performance entry events are recorded for the entry types that have been registered, via the observe() method.
PerformanceObserver - Web APIs
methods performanceobserver.observe() specifies the set of entry types to observe.
PerformancePaintTiming - Web APIs
methods this interface has no methods.
PerformanceResourceTiming.toJSON() - Web APIs
the tojson() method is a serializer that returns a json representation of the performanceresourcetiming object.
PerformanceResourceTiming - Web APIs
methods performanceresourcetiming.tojson() returns a domstring that is the json representation of the performanceresourcetiming object.
PerformanceServerTiming.toJSON - Web APIs
the tojson() method of the performanceservertiming interface returns a domstring that is the json representation of the performanceservertiming object.
PerformanceServerTiming - Web APIs
methods performanceservertiming.tojson() returns a domstring that is the json representation of the performanceservertiming object.
PerformanceTiming - Web APIs
methods the performancetiming interface doesn't inherit any methods.
Permissions.query() - Web APIs
WebAPIPermissionsquery
the permissions.query() method of the permissions interface returns the state of a user permission on the global scope.
Permissions - Web APIs
the permissions interface of the permissions api provides the core permission api functionality, such as methods for querying and revoking permissions methods permissions.query() returns the user permission status for a given api.
Plugin - Web APIs
WebAPIPlugin
methods plugin.item returns the mime type of a supported content type, given the index number into a list of supported types.
PointerEvent.getCoalescedEvents() - Web APIs
the getcoalescedevents() method of the pointerevent interface returns a sequence of all pointerevent instances that were coalesced into the dispatched pointermove event.
ProcessingInstruction - Web APIs
the processinginstruction interface inherits methods and properties from node.
PromiseRejectionEvent - Web APIs
methods this interface has no unique methods; inherits methods from its parent event.
Proximity Events - Web APIs
this event can be captured at the window object level by using the addeventlistener method (using the deviceproximity or userproximity event name) or by attaching an event handler to the window.ondeviceproximity or window.onuserproximity properties.
PublicKeyCredentialCreationOptions.extensions - Web APIs
uvm boolean user verification method.
PublicKeyCredentialCreationOptions - Web APIs
methods none.
PublicKeyCredentialRequestOptions.extensions - Web APIs
uvm boolean user verification method.
PublicKeyCredentialRequestOptions - Web APIs
methods none.
PushEvent - Web APIs
WebAPIPushEvent
methods inherits methods from its parent, extendableevent.
PushManager.getSubscription() - Web APIs
the pushmanager.getsubscription() method of the pushmanager interface retrieves an existing push subscription.
PushManager.hasPermission() - Web APIs
the pushmanager.haspermission() method of the pushmanager interface returns a promise that resolves to the pushpermissionstatus of the requesting webapp, which will be one of granted, denied, or default.
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.
PushManager.subscribe() - Web APIs
the subscribe() method of the pushmanager interface subscribes to a push service.
PushMessageData.arrayBuffer() - Web APIs
the arraybuffer()method of the pushmessagedata interface extracts push message data as an arraybuffer object.
PushMessageData.blob() - Web APIs
the blob()method of the pushmessagedata interface extracts push message data as a blob object.
PushMessageData.json() - Web APIs
the json()method of the pushmessagedata interface extracts push message data by parsing it as a json string and returning the result.
PushMessageData.text() - Web APIs
the text()method of the pushmessagedata interface extracts push message data as a plain text string.
PushRegistrationManager - Web APIs
methods pushregistrationmanager.register() returns a promise that resolves to a pushregistration with details of a new registration.
PushSubscription.toJSON() - Web APIs
the tojson() method of the pushsubscription interface is a standard serializer: it returns a json representation of the subscription properties, providing a useful shortcut.
PushSubscription.unsubscribe() - Web APIs
the unsubscribe() method of the pushsubscription interface returns a promise that resolves to a boolean when the current subscription is successfully unsubscribed.
PushSubscription - Web APIs
methods pushsubscription.getkey() returns an arraybuffer which contains the client's public key, which can then be sent to a server and used in encrypting push message data.
Push API - Web APIs
WebAPIPush API
pushmessagedata provides access to push data sent by a server, and includes methods to manipulate the received data.
RTCAnswerOptions - Web APIs
the createoffer() method's options parameter is of this type.
RTCConfiguration.certificates - Web APIs
the method by which a browser decides which certificate to use is implementation-dependent.
RTCConfiguration.iceServers - Web APIs
if the list of servers is changed while a connection is already active by calling the the rtcpeerconnection method setconfiguration(), no immediate effect occurs.
RTCConfiguration - Web APIs
it may be passed into the constructor when instantiating a connection, or used with the rtcpeerconnection.getconfiguration() and rtcpeerconnection.setconfiguration() methods, which allow inspecting and changing the configuration while a connection is established.
RTCDTMFSender.insertDTMF() - Web APIs
the insertdtmf() method on the rtcdtmfsender interface starts sending dtmf tones to the remote peer over the rtcpeerconnection.
RTCDTMFSender - Web APIs
methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the specified tones.
RTCDataChannel.bufferedAmount - Web APIs
the queue may build up as a result of calls to the send() method.
RTCDataChannel: message event - Web APIs
examples for a given rtcdatachannel, dc, created for a peer connection using its createdatachannel() method, this code sets up a handler for incoming messages and acts on them by adding the data contained within the message to the current document as a new <p> (paragraph) element.
RTCDataChannel.send() - Web APIs
the send() method of the rtcdatachannel interface sends data across the data channel to the remote peer.
RTCDataChannelEvent - Web APIs
constructorrtcdatachannelevent() the rtcdatachannelevent() constructor creates a new rtcdatachannelevent.propertiesalso inherits properties from: eventchannel read only the read-only property rtcdatachannelevent.channel returns the rtcdatachannel associated with the event.methodsthis interface has no methods, but inherits methods from: event examples in this example, the datachannel event handler is set up to save the data channel reference and set up handlers for the events which need to be monitored.
RTCDtlsTransport - Web APIs
xt></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesicetransport read only the read-only rtcdtlstransport property icetransport contains a reference to the underlying rtcicetransport.state read only the state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport state.methodsthis interface has no methods.
RTCErrorEvent - Web APIs
methods no additional methods are provided beyond any found on the parent interface, event.
RTCIceCandidate. toJSON() - Web APIs
the rtcicecandidate method tojson() converts the rtcicecandidate on which it's called into json in the form of an rtcicecandidateinit object.
RTCIceCandidate - Web APIs
methods tojson() given the rtcicecandidate's current configuration, tojson() returns a domstring containing a json representation of that configuration in the form of a rtcicecandidateinit object.
RTCIceCandidateInit - Web APIs
it's also used as the return value from the rtcicecandidate.tojson() method, and can be passed directly into rtcpeerconnection.addicecandidate() to add a candidate to the peer connection.
RTCIceCandidatePair.local - Web APIs
the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair().
RTCIceCandidatePair.remote - Web APIs
the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair().
RTCIceCandidatePairStats.availableIncomingBitrate - Web APIs
note: the returned value is computed using a method similar—but not identical—to the transport independent application specific maximum (tias) described in rfc 3890: 6.2.
RTCIceCandidatePairStats.availableOutgoingBitrate - Web APIs
note: the returned value is computed using a method similar—but not identical—to the transport independent application specific maximum (tias) described in rfc 3890: 6.2.
RTCIceCandidatePairStats - Web APIs
usage notes the currently-active ice candidate pair—if any—can be obtained by calling the rtcicetransport method getselectedcandidatepair(), which returns an rtcicecandidatepair object, or null if there isn't a pair selected.
RTCIceCredentialType - Web APIs
the webrtc api's rtcicecredentialtype enumerated string type defines the authentication method used to gain access to an ice server identified by an rtciceserver object.
RTCIceParameters - Web APIs
during ice negotiation, each peer's username fragment and password are recorded in an rtciceparameters object, which can be obtained from the rtcicetransport by calling its getlocalparameters() or getremoteparameters() method, depending on which end interests you.
RTCIceTransport: gatheringstatechange event - Web APIs
here, the addeventlistener() method is called to add a listener for gatheringstatechange events: pc.getsenders().foreach(sender => { sender.transport.icetransport.addeventlistener("gatheringstatechange", ev => { let transport = ev.target; if (transport.gatheringstate === "complete") { /* this transport has finished gathering candidates, but others may still be working on it */ } }, false); likewise, you can us...
RTCIceTransport.getLocalCandidates() - Web APIs
the rtcicetransport method getlocalcandidates() returns an array of rtcicecandidate objects, one for each of the candidates that have been gathered by the local device during the current ice agent session.
RTCIceTransport.getLocalParameters() - Web APIs
the rtcicetransport method getlocalparameters() returns an rtciceparameters object which provides information uniquely identifying the local peer for the duration of the ice session.
RTCIceTransport.getRemoteCandidates() - Web APIs
the rtcicetransport method getremotecandidates() returns an array which contains one rtcicecandidate for each of the candidates that have been received from the remote peer so far during the current ice gathering session.
RTCIceTransport.getRemoteParameters() - Web APIs
the rtcicetransport method getremoteparameters() returns an rtciceparameters object which provides information uniquely identifying the remote peer for the duration of the ice session.
RTCIceTransport.getSelectedCandidatePair() - Web APIs
the rtcicetransport method getselectedcandidatepair() returns an rtcicecandidatepair object containing the current best-choice pair of ice candidates describing the configuration of the endpoints of the transport.
RTCIceTransport.onselectedcandidatepairchange - Web APIs
the event handler can determine the current state by calling the transport's getselectedcandidatepair() method, which returns a rtcicecandidatepair whose rtcicecandidatepair.local and rtcicecandidatepair.global properties specify rtcicecandidate objects describing the local and remote candidates that are currently being used.
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
forward error correction uses an exclusive-or method to perform parity checks on the received data.
RTCInboundRtpStreamStats.pliCount - Web APIs
this is often achieved by methods such as increasing the compression, lowering resolution, or finding other ways to reduce the bit rate of the stream.
RTCOfferOptions - Web APIs
the rtcofferoptions dictionary is used to provide optional settings when creating an rtcpeerconnection offer with the createoffer() method.
RTCOutboundRtpStreamStats.pliCount - Web APIs
this is often achieved by methods such as increasing the compression or lowering resolution, although the mechanisms available to reduce the bit rate of the stream vary from codec to codec.
RTCPeerConnection.addTransceiver() - Web APIs
the rtcpeerconnection method addtransceiver() creates a new rtcrtptransceiver and adds it to the set of transceivers associated with the rtcpeerconnection.
RTCPeerConnection: addstream event - Web APIs
you can also use the addeventlistener() method to set an event listener: pc.addeventlistener("addstream", ev => doaddstream(ev.stream), false); ...
RTCPeerConnection.createAnswer() - Web APIs
the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection.
RTCPeerConnection.createDataChannel() - Web APIs
the createdatachannel() method on the rtcpeerconnection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted.
RTCPeerConnection.getDefaultIceServers() - Web APIs
the getdefaulticeservers() method of the rtcpeerconnection interface returns an array of objects based on the rtciceserver dictionary, which indicates what, if any, ice servers the browser will use by default if none are provided to the rtcpeerconnection in its rtcconfiguration.
RTCPeerConnection.getReceivers() - Web APIs
the rtcpeerconnection.getreceivers() method returns an array of rtcrtpreceiver objects, each of which represents one rtp receiver.
RTCPeerConnection.getStreamById() - Web APIs
the rtcpeerconnection.getstreambyid() method returns the mediastream with the given id that is associated with local or remote end of the connection.
RTCPeerConnection.getTransceivers() - Web APIs
the rtcpeerconnection interface's gettransceivers() method returns a list of the rtcrtptransceiver objects being used to send and receive data on the connection.
RTCPeerConnection.onicecandidate - Web APIs
this lets the ice agent perform negotiation with the remote peer without the browser itself needing to know any specifics about the technology being used for signaling; simply implement this method to use whatever messaging technology you choose to send the ice candidate to the remote peer.
RTCPeerConnectionIceErrorEvent - Web APIs
methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event.
RTCRtpParameters - Web APIs
to obtain the parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrtpcodecparameters objects describing the set of codecs from which the sender or receiver will choose.
RTCRtpReceiveParameters - Web APIs
the rtcrtpreceiveparameters dictionary, based upon the rtcrtpparameters dictionary, is returned by the the rtcrtpreceiver method getparameters().
RTCRtpReceiver.getCapabilities() static function - Web APIs
because the set of capabilities available tend to be stable for a length of time (people don't install and uninstall codecs and the like very often), the media capabilities can in whole or in part provide a cross-origin method for identifying a user.
RTCRtpReceiver.getContributingSources() - Web APIs
the getcontributingsources() method of the rtcrtpreceiver interface returns an array of rtcrtpcontributingsource instances, each corresponding to one csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds.
RTCRtpReceiver.getParameters() - Web APIs
the getparameters() method of the rtcrtpreceiver interface returns an rtcrtpreceiveparameters object describing the current configuration for the encoding and transmission of media on the receiver's track.
RTCRtpReceiver.getStats() - Web APIs
the rtcrtpreceiver method getstats() asynchronously requests an rtcstatsreport object which provides statistics about incoming traffic on the owning rtcpeerconnection, returning a promise whose fulfillment handler will be called once the results are available.
RTCRtpReceiver.getSynchronizationSources() - Web APIs
the getsynchronizationsources() method of the rtcrtpreceiver interface returns an array of rtcrtpcontributingsource instances, each corresponding to one ssrc (synchronization source) identifier received by the current rtcrtpreceiver in the last ten seconds.
RTCRtpSendParameters - Web APIs
the webrtc api's rtcrtpsendparameters dictionary is used to specify the parameters for an rtcrtpsender when calling its setparameters() method.
RTCRtpSender.getCapabilities() static function - Web APIs
because the set of capabilities available tend to be stable for a length of time (people don't install and uninstall codecs and the like very often), the media capabilities can in whole or in part provide a cross-origin method for identifying a user.
RTCRtpSender.getParameters() - Web APIs
the getparameters() method of the rtcrtpsender interface returns an rtcrtpsendparameters object describing the current configuration for the encoding and transmission of media on the sender's track.
RTCRtpSender.getStats() - Web APIs
the rtcrtpsender method getstats() asynchronously requests an rtcstatsreport object which provides statistics about outgoing traffic on the rtcpeerconnection which owns the sender, returning a promise which is fulfilled when the results are available.
RTCRtpSender.setParameters() - Web APIs
the setparameters() method of the rtcrtpsender interface applies changes the configuration of sender's track, which is the mediastreamtrack for which the rtcrtpsender is responsible.
RTCRtpStreamStats.pliCount - Web APIs
this is often achieved by methods such as increasing the compression, lowering resolution, or finding other ways to reduce the bit rate of the stream.
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.
RTCRtpTransceiver.direction - Web APIs
effect on offers and answers the value of direction is used by rtcpeerconnection.createoffer() or rtcpeerconnection.createanswer() in order to generate the sdp generated by each of those methods.
RTCRtpTransceiver.stopped - Web APIs
the transceiver is stopped if the stop() method has been called or if a change to either the local or the remote description has caused the transceiver to be stopped for some reason.
RTCRtpTransceiver - Web APIs
methods setcodecpreferences() a list of rtcrtpcodecparameters objects which override the default preferences used by the user agent for the transceiver's codecs.
RTCSessionDescription - Web APIs
methods the rtcsessiondescription doesn't inherit any methods.
RTCStatsReport - Web APIs
the rtcstatsreport interface provides a statistics report obtained by calling one of the rtcpeerconnection.getstats(), rtcrtpreceiver.getstats(), and rtcrtpsender.getstats() methods.
RadioNodeList - Web APIs
methods the radionodelist interface inherits the methods of nodelist.
Range() - Web APIs
WebAPIRangeRange
syntax range = new range() example in this example we create a new range with the range() constructor, and set its beginning and end positions using the range.setstartbefore() and range.setendafter() methods.
Range.cloneContents() - Web APIs
html attribute events are duplicated as they are for the dom core clonenode method.
Range.cloneRange() - Web APIs
WebAPIRangecloneRange
the range.clonerange() method returns a range object with boundary points identical to the cloned range.
Range.collapse() - Web APIs
WebAPIRangecollapse
the range.collapse() method collapses the range to one of its boundary points.
Range.collapsed - Web APIs
WebAPIRangecollapsed
to collapse a range, see the range.collapse() method.
Range.commonAncestorContainer - Web APIs
to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend().
Range.comparePoint() - Web APIs
the range.comparepoint() method returns -1, 0, or 1 depending on whether the referencenode is before, the same as, or after the range.
Range.createContextualFragment() - Web APIs
the range.createcontextualfragment() method returns a documentfragment by invoking the html fragment parsing algorithm or the xml fragment parsing algorithm with the start of the range (the parent of the selected node) as the context node.
Range.endContainer - Web APIs
to change the end position of a node, use the range.setend() method or a similar one.
Range.endOffset - Web APIs
WebAPIRangeendOffset
to change the endoffset of a range, use one of the range.setend methods.
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.insertNode() - Web APIs
WebAPIRangeinsertNode
the range.insertnode() method inserts a node at the start of the range.
Range.intersectsNode() - Web APIs
the range.intersectsnode() method returns a boolean indicating whether the given node intersects the range.
Range.isPointInRange() - Web APIs
the range.ispointinrange() method returns a boolean indicating whether the given point is in the range.
Range.selectNode() - Web APIs
WebAPIRangeselectNode
the range.selectnode() method sets the range to contain the node and its contents.
Range.selectNodeContents() - Web APIs
the range.selectnodecontents() method sets the range to contain the contents of a node.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
the range.setend() method sets the end position of a range to be located at the given offset into the specified node x.setting the end point above (higher in the document) than the start point will result in a collapsed range with the start and end points both set to the specified end position.
Range.setEndAfter() - Web APIs
WebAPIRangesetEndAfter
the range.setendafter() method sets the end position of a range relative to another node.
Range.setEndBefore() - Web APIs
the range.setendbefore() method sets the end position of a range relative to another node.
Range.setStartAfter() - Web APIs
the range.setstartafter() method sets the start position of a range relative to a node.
Range.setStartBefore() - Web APIs
the range.setstartbefore() method sets the start position of a range relative to another node.
Range.startContainer - Web APIs
to change the start position of a node, use one of the range.setstart() methods.
Range.startOffset - Web APIs
WebAPIRangestartOffset
to change the startoffset of a range, use the range.setstart method.
Range.toString() - Web APIs
WebAPIRangetoString
the range.tostring() method is a stringifier returning the text of the range.
ReadableByteStreamController.close() - Web APIs
the close() method of the readablebytestreamcontroller interface closes the associated stream.
ReadableByteStreamController.enqueue() - Web APIs
the enqueue() method of the readablebytestreamcontroller interface enqueues a given chunk in the associated stream.
ReadableByteStreamController.error() - Web APIs
the error() method of the readablebytestreamcontroller interface causes any future interactions with the associated stream to error.
ReadableByteStreamController - Web APIs
methods readablebytestreamcontroller.close() closes the associated stream.
ReadableStream.cancel() - Web APIs
the cancel() method of the readablestream interface cancels the associated stream.
ReadableStream.getReader() - Web APIs
the getreader() method of the readablestream interface creates a reader and locks the stream to it.
ReadableStream.tee() - Web APIs
the tee() method of the readablestream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new readablestream instances.
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
note: you generally wouldn't use this constructor manually; instead, you'd use the readablestream.getreader() method.
ReadableStreamBYOBReader.read() - Web APIs
the read() method of the readablestreambyobreader interface returns a promise providing access to the next chunk in the byte stream's internal queue.
ReadableStreamBYOBReader - Web APIs
methods readablestreambyobreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer.
ReadableStreamBYOBRequest.respond() - Web APIs
the error() method of the readablestreambyobrequest interface xxx syntax readablestreambyobrequestinstance.respond(byteswritten); parameters byteswritten xxx return value void.
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
the respondwithnewview() method of the readablestreambyobrequest interface xxx syntax readablestreambyobrequestinstance.respondwithnewview(view); parameters view xxx return value void.
ReadableStreamBYOBRequest - Web APIs
methods readablestreambyobrequest.respond() xxx readablestreambyobrequest.respondwithnewview() xxx examples tbd.
ReadableStreamDefaultController.close() - Web APIs
the close() method of the readablestreamdefaultcontroller interface closes the associated stream.
ReadableStreamDefaultController.enqueue() - Web APIs
the enqueue() method of the readablestreamdefaultcontroller interface enqueues a given chunk in the associated stream.
ReadableStreamDefaultController - Web APIs
methods readablestreamdefaultcontroller.close() closes the associated stream.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
note: you generally wouldn't use this constructor manually; instead, you'd use the readablestream.getreader() method.
ReadableStreamDefaultReader.read() - Web APIs
the read() method of the readablestreamdefaultreader interface returns a promise providing access to the next chunk in the stream's internal queue.
ReadableStreamDefaultReader - Web APIs
methods readablestreamdefaultreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer.
ReportingObserver.disconnect() - Web APIs
the disconnect() method of the reportingobserver interface stops a reporting observer that had previously started observing from collecting reports.
ReportingObserver.observe() - Web APIs
the observe() method of the reportingobserver interface instructs a reporting observer to start collecting reports in its report queue.
ReportingObserver.takeRecords() - Web APIs
the takerecords() method of the reportingobserver interface returns the current list of reports contained in the observer's report queue, and empties the queue.
Request.clone() - Web APIs
WebAPIRequestclone
the clone() method of the request interface creates a copy of the current request object.
Request.headers - Web APIs
WebAPIRequestheaders
then save the request headers in a variable: var myrequest = new request('flowers.jpg'); var myheaders = myrequest.headers; // headers {} to add a header to the headers object we use headers.append; we then create a new request along with a 2nd init parameter, passing headers in as an init option: var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', myinit); mycontenttype = myrequest.headers.get('content-type'); // returns 'image/jpeg' specifications specification status comment fetchthe definition of 'headers' in that specification.
Request.mode - Web APIs
WebAPIRequestmode
no-cors — prevents the method from being anything other than head, get or post, and the headers from being anything other than simple headers.
ResizeObserver.disconnect() - Web APIs
the disconnect() method of the resizeobserver interface unobserves all observed element or svgelement targets.
ResizeObserver.observe() - Web APIs
the observe() method of the resizeobserver interface starts observing the specified element or svgelement.
ResizeObserver.unobserve() - Web APIs
the unobserve() method of the resizeobserver interface ends the observing of a specified element or svgelement.
ResizeObserver - Web APIs
methods resizeobserver.disconnect() unobserves all observed element targets of a particular observer.
ResizeObserverEntry - Web APIs
methods none.
Resize Observer API - Web APIs
such a solution tends to only work for limited use cases, be bad for performance (continually calling the above methods would result in a big performance hit), and often won't work when the browser window size is not changed.
Response.clone() - Web APIs
WebAPIResponseclone
the clone() method of the response interface creates a clone of a response object, identical in every way, but stored in a different variable.
Response.redirect() - Web APIs
WebAPIResponseredirect
the redirect() method of the response interface returns a response resulting in a redirect to the specified url.
SVGAltGlyphDefElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGAltGlyphElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGAltGlyphItemElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGAnimateColorElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svganimationelement.
SVGAnimateElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svganimationelement.
SVGAnimateMotionElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svganimationelement.
SVGAnimateTransformElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svganimationelement.
SVGAnimatedString - Web APIs
methods the svganimatedstring interface do not provide any specific methods.
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.
SVGCircleElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svggeometryelement.
SVGColorProfileElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgurireference and svgrenderingintent.
SVGComponentTransferFunctionElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGDefsElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits properties from its parent, svggraphicselement.
SVGDescElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svggeometryelement.
SVGElement - Web APIs
methods this interface has no methods, but inherits methods from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance events listen to these events using addeventlistener() or by assigning an event listener to the equivalent on...
SVGEllipseElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggeometryelement.
SVGExternalResourcesRequired - Web APIs
methods this interface doesn't implement any specific methods.
SVGFEBlendElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes.
SVGFEColorMatrixElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement , and also implements methods of svgfilterprimitivestandardattributes.
SVGFEComponentTransferElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes.
SVGFECompositeElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEConvolveMatrixElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDiffuseLightingElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDisplacementMapElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDistantLightElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFEDropShadowElement - Web APIs
methods this interface also inherits methods of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEFloodElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement, and implements methods from svgfilterprimitivestandardattributes.
SVGFEFuncAElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncBElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncGElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncRElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEGaussianBlurElement - Web APIs
methods this interface also inherits methods of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEImageElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributesand svgurireference.
SVGFEMergeElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEMergeNodeElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFEMorphologyElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEOffsetElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEPointLightElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFESpecularLightingElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFESpotLightElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement.
SVGFETileElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFETurbulenceElement - Web APIs
methods this interface does not provide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFilterPrimitiveStandardAttributes - Web APIs
methods this interface does not provide any specific methods.
SVGFontElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement and implements methods from svgexternalresourcesrequired and svgstylable.
SVGFontFaceElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGFontFaceFormatElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGFontFaceNameElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGFontFaceSrcElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGFontFaceUriElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGGElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement.
SVGGeometryElement.isPointInFill() - Web APIs
the svggeometryelement.ispointinfill() method determines whether a given point is within the fill shape of an element.
SVGGeometryElement.isPointInStroke() - Web APIs
the svggeometryelement.ispointinstroke() method determines whether a given point is within the stroke shape of an element.
SVGGlyphElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGGlyphRefElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement and implements methods from svgurireference and svgstylable.
getBBox() - Web APIs
note: getbbox() must return the actual bounding box at the time the method was called—even in case the element has not yet been rendered.
SVGGraphicsElement - Web APIs
methods this interface also inherits methods from its parent, svgelement.
SVGHKernElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGImageElement.decode - Web APIs
the decode() method of the svgimageelement interface initiates asynchronous decoding of an image, returning a promise that resolves once the image data is ready for use.
SVGImageElement - Web APIs
methods this interface also inherits methods from its parent interface, svggraphicselement.
SVGLinearGradientElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggradientelement.
SVGMPathElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGMatrix - Web APIs
WebAPISVGMatrix
methods svgmatrix.multiply() performs matrix multiplication.
SVGMeshElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggeometryelement, and implements the methods of svgurireference.
SVGMetadataElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGMissingGlyphElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement and implements methods from svgstylable.
SVGNumber - Web APIs
WebAPISVGNumber
methods this interface doesn't provide any specific methods.
SVGPathElement.getPointAtLength() - Web APIs
the svgpathelement.getpointatlength() method returns the point at a given distance along the path.
SVGPatternElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements the ones from svgfittoviewbox and svgurireference.
SVGRadialGradientElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggradientelement.
SVGRect - Web APIs
WebAPISVGRect
methods this interface also inherits properties from its parent, domrectreadonly.
SVGRenderingIntent - Web APIs
methods this interface doesn't implement any specific methods.
SVGScriptElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGSetElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svganimationelement.
SVGSolidcolorElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGStopElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGStyleElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements methods from linkstyle.
SVGSwitchElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement.
SVGSymbolElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement, and implements methods from svgfittoviewbox.
SVGTRefElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgtextpositioningelement and implements properties from svgurireference.
SVGTSpanElement - Web APIs
methods this interface doesn't provide any specific methods.
SVGTextElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgtextpositioningelement.
SVGTextPositioningElement - Web APIs
methods this interface doesn't provide any specific methods, but inherits methods from its parent, svgtextcontentelement.
SVGTitleElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement.
SVGURIReference - Web APIs
methods this interface does not provide any specific methods.
SVGUnitTypes - Web APIs
methods this interface doesn't implement any specific methods.
SVGUseElement - Web APIs
methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement and implements methods from svgurireference.
SVGVKernElement - Web APIs
methods this interface has no methods but inherits methods from its parent, svgelement.
SVGZoomAndPan - Web APIs
methods this interface doesn't implement any specific methods.
ScreenOrientation - Web APIs
methods screenorientation.lock() locks the orientation of the containing document to its default orientation and returns a promise.
ScrollToOptions.behavior - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
ScrollToOptions.left - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
ScrollToOptions.top - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
Selection.addRange() - Web APIs
the selection.addrange() method adds a range to a selection.
Selection.collapseToEnd() - Web APIs
the selection.collapsetoend() method collapses the selection to the end of the last range in the selection.
Selection.collapseToStart() - Web APIs
the selection.collapsetostart() method collapses the selection to the start of the first range in the selection.
Selection.containsNode() - Web APIs
the selection.containsnode() method indicates whether a specfied node is part of the selection.
Selection.extend() - Web APIs
WebAPISelectionextend
the selection.extend() method moves the focus of the selection to a specified point.
Selection.getRangeAt() - Web APIs
the selection.getrangeat() method returns a range object representing one of the ranges currently selected.
Selection.isCollapsed - Web APIs
in that scenario, calling a selection object's getrangeat() method may return a range object which is collapsed.
Selection.removeAllRanges() - Web APIs
the selection.removeallranges() method removes all ranges from the selection, leaving the anchornode and focusnode properties equal to null and leaving nothing selected.
Selection.removeRange() - Web APIs
the selection.removerange() method removes a range from a selection.
Selection.selectAllChildren() - Web APIs
the selection.selectallchildren() method adds all the children of the specified node to the selection.
Selection.selectionLanguageChange() - Web APIs
selection.selectionlanguagechange() method is a gecko/firefox internal method that was exposed to web pages until firefox 29.
Sensor.start() - Web APIs
WebAPISensorstart
the start method activates one of the sensors based on sensor.
Sensor.stop() - Web APIs
WebAPISensorstop
the stop method of the sensor interface deactivates the current sensor.
Using server-sent events - Web APIs
the connection is terminated with the .close() method.
ServiceWorker - Web APIs
methods the serviceworker interface inherits methods from its parent, worker, with the exception of worker.terminate — this should not be accessible from service workers.
ServiceWorkerContainer.ready - Web APIs
example if ('serviceworker' in navigator) { navigator.serviceworker.ready .then(function(registration) { console.log('a service worker is active:', registration.active); // at this point, you can call methods that require an active // service worker, like registration.pushmanager.subscribe() }); } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkerregistration.ready' in that specification.
ServiceWorkerContainer.startMessages() - Web APIs
the startmessages() method of the serviceworkercontainer interface explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g.
ServiceWorkerGlobalScope: message event - Web APIs
controlled pages can use the serviceworker.postmessage() method to send messages to service workers.
ServiceWorkerGlobalScope: notificationclick event - Web APIs
bubbles no cancelable no interface notificationevent event handler onnotificationclick examples you can use the notificationclick event in an addeventlistener method: self.addeventlistener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.ur...
ServiceWorkerGlobalScope.onfetch - Web APIs
the onfetch property of the serviceworkerglobalscope interface is an event handler fired whenever a fetch event occurs (usually when the windoworworkerglobalscope.fetch() method is called.) syntax serviceworkerglobalscope.onfetch = function(fetchevent) { ...
ServiceWorkerMessageEvent - Web APIs
methods inherits methods from its parent, event.
ServiceWorkerRegistration.getNotifications() - Web APIs
the getnotifications() method of the serviceworkerregistration interface returns a list of the notifications in the order that they were created from the current origin via the current service worker registration.
ServiceWorkerRegistration.showNotification() - Web APIs
the shownotification() method of the serviceworkerregistration interface creates a notification on an active service worker.
ServiceWorkerRegistration.unregister() - Web APIs
the unregister() method of the serviceworkerregistration interface unregisters the service worker registration and returns a promise.
ServiceWorkerRegistration.update() - Web APIs
the update() method of the serviceworkerregistration interface attempts to update the service worker.
ShadowRoot - Web APIs
methods the shadowroot interface includes the following methods defined on the documentorshadowroot mixin.
SharedWorker.port - Web APIs
WebAPISharedWorkerport
multiple scripts can then access the worker through a messageport object accessed using the sharedworker.port property — the port is started using its start() method: var myworker = new sharedworker('worker.js'); myworker.port.start(); for a full example, see our basic shared worker example (run shared worker.) specifications specification status comment html living standardthe definition of 'abstractworker.onerror' in that specification.
SharedWorkerGlobalScope.onconnect - Web APIs
the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker.
Slottable - Web APIs
WebAPISlottable
methods none.
SourceBuffer.abort() - Web APIs
the abort() method of the sourcebuffer interface aborts the current segment and resets the segment parser.
SourceBuffer.appendBuffer() - Web APIs
the appendbuffer() method of the sourcebuffer interface appends media segment data from an arraybuffer or arraybufferview object to the sourcebuffer.
SourceBuffer.appendStream() - Web APIs
the appendstream() method of the sourcebuffer interface appends media segment data from a readablestream object to the sourcebuffer.
SourceBuffer.changeType() - Web APIs
the changetype() method of the sourcebuffer interface sets the mime type that future calls to appendbuffer() should expect the new media data to conform to.
SourceBufferList - Web APIs
methods inherits methods from its parent interface, eventtarget.
SpeechGrammarList.SpeechGrammarList() - Web APIs
examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property.
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.
SpeechGrammarList.addFromURI() - Web APIs
the addfromuri() method of the speechgrammarlist interface takes a grammar present at a specific uri and adds it to the speechgrammarlist as a new speechgrammar object.
SpeechRecognition.abort() - Web APIs
the abort() method of the web speech api stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a speechrecognitionresult.
SpeechRecognition: audioend event - Web APIs
bubbles no cancelable no interface event event handler onaudioend examples you can use the audioend event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('audioend', function() { console.log('audio capturing ended'); }); or use the onaudioend event handler property: recognition.onaudioend = function() { console.log('audio capturing ended'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition: audiostart event - Web APIs
bubbles no cancelable no interface event event handler onaudiostart examples you can use the audiostart event in an onaudiostart method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('audiostart', function() { console.log('audio capturing started'); }); or use the onaudiostart event handler property: recognition.onaudiostart = function() { console.log('audio capturing started'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition: end event - Web APIs
bubbles no cancelable no interface event event handler property onend examples you can use the end event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('end', function() { console.log('speech recognition service disconnected'); }); or use the onend event handler property: recognition.onend = function() { console.log('speech recognition service disconnected'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification...
SpeechRecognition: error event - Web APIs
bubbles no cancelable no interface speechrecognitionerrorevent event handler property onerror examples you can use the error event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('error', function(event) { console.log('speech recognition error detected: ' + event.error'); }); or use the onerror event handler property: recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error'); } specifications specification status comment web speech apithe definition...
SpeechRecognition: nomatch event - Web APIs
bubbles no cancelable no interface speechrecognitionevent event handler property onnomatch examples you can use the nomatch event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('nomatch', function() { console.log('speech not recognized'); }); or use the onnomatch event handler property: recognition.onnomatch = function() { console.log('speech not recognized'); } specifications specification status comment web speech apithe definitio...
SpeechRecognition: result event - Web APIs
you can use the result event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('result', function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; }); or use the onresult event handler property: recognition.onresult = function(event) { var color = event.results...
SpeechRecognition: soundend event - Web APIs
bubbles no cancelable no interface event event handler property onsoundend examples you can use the soundend event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('soundend', function(event) { console.log('sound has stopped being received'); }); or use the onsoundend event handler property: recognition.onsoundend = function(event) { console.log('sound has stopped being received'); } specifications specification status comment web speech apithe definition of 'speech recognition eve...
SpeechRecognition: soundstart event - Web APIs
bubbles no cancelable no interface event event handler property onsoundstart examples you can use the soundstart event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('soundstart', function() { console.log('some sound is being received'); }); or use the onsoundstart event handler property: recognition.onsoundstart = function() { console.log('some sound is being received'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that spec...
SpeechRecognition: speechend event - Web APIs
bubbles no cancelable no interface event event handler property onspeechend examples you can use the speechend event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('speechend', function() { console.log('speech has stopped being detected'); }); or use the onspeechend event handler property: recognition.onspeechend = function() { console.log('speech has stopped being detected'); } specifications specification status comment web speech apithe definition of 'speech recognition ...
SpeechRecognition: speechstart event - Web APIs
bubbles no cancelable no interface event event handler property onspeechstart examples you can use the speechstart event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('speechstart', function() { console.log('speech has been detected'); }); or use the onspeechstart event handler property: recognition.onspeechstart = function() { console.log('speech has been detected'); } specifications specification status comment web speech apithe definition of 'speech recognition even...
SpeechRecognition.start() - Web APIs
the start() method of the web speech api starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current speechrecognition.
SpeechRecognition: start event - Web APIs
bubbles no cancelable no interface event event handler property onstart examples you can use the start event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('start', function() { console.log('speech recognition service has started'); }); or use the onstart event handler property: recognition.onstart = function() { console.log('speech recognition service has started'); } specifications specification status comment ...
SpeechRecognition.stop() - Web APIs
the stop() method of the web speech api stops the speech recognition service from listening to incoming audio, and attempts to return a speechrecognitionresult using the audio captured so far.
SpeechRecognition - Web APIs
methods speechrecognition also inherits methods from its parent interface, eventtarget.
SpeechRecognitionResult - Web APIs
speechrecognitionresult.length read only returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) methods speechrecognitionresult.item a standard getter that allows speechrecognitionalternative objects within the result to be accessed via array syntax.
SpeechRecognitionResultList - Web APIs
methods speechrecognitionresultlist.item a standard getter that allows speechrecognitionresult objects in the list to be accessed via array syntax.
SpeechSynthesis.cancel() - Web APIs
the cancel() method of the speechsynthesis interface removes all utterances from the utterance queue.
SpeechSynthesis.onvoiceschanged - Web APIs
the onvoiceschanged property of the speechsynthesis interface represents an event handler that will run when the list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) this may occur when speech synthesis is being done on the server-side and the voices list is being determined asynchronously, or when client-side voices are installed/uninstalled while a speech synthesis application is running.
SpeechSynthesis.pause() - Web APIs
the pause() method of the speechsynthesis interface puts the speechsynthesis object into a paused state.
SpeechSynthesis.resume() - Web APIs
the resume() method of the speechsynthesis interface puts the speechsynthesis object into a non-paused state: resumes it if it was already paused.
SpeechSynthesis.speak() - Web APIs
the speak() method of the speechsynthesis interface adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.
SpeechSynthesisErrorEvent - Web APIs
methods speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits methods from its parent interface, event.
SpeechSynthesisEvent - Web APIs
methods the speechsynthesisevent interface also inherits methods from its parent interface, event.
SpeechSynthesisUtterance: boundary event - Web APIs
bubbles no cancelable no interface speechsynthesisevent event handler onboundary examples you can use the boundary event in an addeventlistener method: utterthis.addeventlistener('boundary', function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); }); or use the onboundary event handler property: utterthis.onboundary = function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utteranc...
SpeechSynthesisUtterance: end event - Web APIs
bubbles no cancelable no interface speechsynthesisevent event handler property onend examples you can use the end event in an addeventlistener method: utterthis.addeventlistener('end', function(event) { console.log('utterance has finished being spoken after ' + event.elapsedtime + ' milliseconds.'); }); or use the onend event handler property: utterthis.onend = function(event) { console.log('utterance has finished being spoken after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utte...
SpeechSynthesisUtterance: error event - Web APIs
bubbles no cancelable no interface speechsynthesiserrorevent event handler property onerror examples you can use the error event in an addeventlistener method: utterthis.addeventlistener('error', function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error'); }); or use the onerror event handler property: utterthis.onerror = function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error'); } specifications specification status comment web speech apithe definition of 'spee...
SpeechSynthesisUtterance: mark event - Web APIs
bubbles no cancelable no interface speechsynthesisevent event handler property onmark examples you can use the mark event in an addeventlistener method: utterthis.addeventlistener('mark', function(event) { console.log('a mark was reached: ' + event.name); }); or use the onmark event handler property: utterthis.onmark = function(event) { console.log('a mark was reached: ' + event.name); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
SpeechSynthesisUtterance.onpause - Web APIs
the onpause property of the speechsynthesisutterance interface represents an event handler that will run when the utterance is paused part way through (when the pause event fires.) this occurs when the speechsynthesis.pause() method is invoked.
SpeechSynthesisUtterance.onresume - Web APIs
the onresume property of the speechsynthesisutterance interface represents an event handler that will run when a paused utterance is resumed (when the resume event fires.) this occurs when the speechsynthesis.resume() method is invoked on a paused speech synthesis instance.
SpeechSynthesisUtterance.onstart - Web APIs
the onstart property of the speechsynthesisutterance interface represents an event handler that will run when the utterance has begun to be spoken (when the start event fires.) this occurs when the speechsynthesis.speak() method is invoked.
SpeechSynthesisUtterance: pause event - Web APIs
bubbles no cancelable no interface speechsynthesisevent event handler property onpause examples you can use the pause event in an addeventlistener method: utterthis.addeventlistener('pause', function(event) { console.log('speech paused after ' + event.elapsedtime + ' milliseconds.'); }); or use the onpause event handler property: utterthis.onpause = function(event) { console.log('speech paused after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specifica...
SpeechSynthesisUtterance: resume event - Web APIs
bubbles no cancelable no interface speechsynthesisevent event handler property onresume examples you can use the resume event in an addeventlistener method: utterthis.addeventlistener('resume', function(event) { console.log('speech resumed after ' + event.elapsedtime + ' milliseconds.'); }); or use the onresume event handler property: utterthis.onresume = function(event) { console.log('speech resumed after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
SpeechSynthesisUtterance: start event - Web APIs
bubbles no cancelable no interface speechsynthesisevent event handler property onstart examples you can use the start event in an addeventlistener method: utterthis.addeventlistener('start', function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); }); or use the onstart event handler property: utterthis.onstart = function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specifica...
SpeechSynthesisUtterance - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), use the constructor to create a new utterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
StereoPannerNode.pan - Web APIs
in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method.
Storage.clear() - Web APIs
WebAPIStorageclear
the clear() method of the storage interface clears all keys stored in a given storage object.
Storage.getItem() - Web APIs
WebAPIStoragegetItem
the getitem() method of the storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given storage object.
Storage.key() - Web APIs
WebAPIStoragekey
the key() method of the storage interface, when passed a number n, returns the name of the nth key in a given storage object.
Storage.setItem() - Web APIs
WebAPIStoragesetItem
the setitem() method of the storage interface, when passed a key name and value, will add that key to the given storage object, or update that key's value if it already exists.
Storage - Web APIs
WebAPIStorage
methods storage.key() when passed a number n, this method will return the name of the nth key in the storage.
StorageEstimate.usage - Web APIs
the value is an estimate because the user agent may use compression, duplication prevention techniques, and other methods to improve storage efficiency.
StorageEstimate - Web APIs
the estimate() method returns an object that conforms to this dictionary when its promise resolves.
StorageManager.persist() - Web APIs
the persist() method of the storagemanager interface requests permission to use persistent storage, and returns a promise that resolves to true if permission is granted and box mode is persistent, and false otherwise.
StorageManager.persisted() - Web APIs
the persisted() method of the storagemanager interface returns a promise that resolves to true if box mode is persistent for your site's storage.
StorageManager - Web APIs
methods storagemanager.estimate() secure context returns a promise that resolves to a storageestimate object containing usage and quota numbers for your origin.
StorageQuota - Web APIs
methods storagequota.queryinfo returns a storageinfo object containting the current data usage and available quota information for the application.
StylePropertyMap.append() - Web APIs
the append() method of the stylepropertymap interface adds a new css declaration to the stylepropertymap with the given property and value.
StylePropertyMap.clear() - Web APIs
the clear() method of the stylepropertymap interface removes all declarations in the stylepropertymap.
StylePropertyMap.delete() - Web APIs
the delete() method of the stylepropertymap interface removes the css declaration with the given property.
StylePropertyMap.set() - Web APIs
the set() method of the stylepropertymap interface changes the css declaration with the given property.
StylePropertyMap - Web APIs
methods inherits methods from its parent, stylepropertymapreadonly.
StylePropertyMapReadOnly.entries() - Web APIs
the stylepropertymapreadonly.entries() method returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
StylePropertyMapReadOnly.forEach() - Web APIs
the stylepropertymapreadonly.foreach() method executes a provided function once for each element of stylepropertymapreadonly.
StylePropertyMapReadOnly.getAll() - Web APIs
the getall() method of the stylepropertymapreadonly interface returns an array of cssstylevalue objects containing the values for the provided property.
StylePropertyMapReadOnly.has() - Web APIs
the has() method of the stylepropertymapreadonly interface indicates whether the specified property is in the stylepropertymapreadonly object.
StylePropertyMapReadOnly.keys() - Web APIs
the stylepropertymapreadonly.keys() method returns a new array iterator containing the keys for each item in stylepropertymapreadonly syntax stylepropertymapreadonly.keys() parameters none.
StylePropertyMapReadOnly.values() - Web APIs
the stylepropertymapreadonly.values() method returns a new array iterator containing the values for each index in the stylepropertymapreadonly object.
StylePropertyMapReadOnly - Web APIs
methods stylepropertymapreadonly.entries() returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
SubmitEvent - Web APIs
methods while submitevent offers no methods of its own, it inherits any specified by its parent interface, event.
SubtleCrypto.digest() - Web APIs
the digest() method of the subtlecrypto interface generates a digest of the given data.
SubtleCrypto.encrypt() - Web APIs
c the encrypt() method of the subtlecrypto interface encrypts data.
SubtleCrypto.exportKey() - Web APIs
the exportkey() method of the subtlecrypto interface exports a key: that is, it takes as input a cryptokey object and gives you the key in an external, portable format.
SubtleCrypto.generateKey() - Web APIs
use the generatekey() method of the subtlecrypto interface to generate a new key (for symmetric algorithms) or key pair (for public-key algorithms).
SubtleCrypto - Web APIs
methods this interface doesn't inherit any methods, as it has no parent interface.
SyncEvent - Web APIs
WebAPISyncEvent
methods inherits methods from its parent, extendableevent.
SyncManager.getTags() - Web APIs
the syncmanager.gettags method of the syncmanager interface returns a list of developer-defined identifiers for syncmanager registrations.
SyncManager.register() - Web APIs
the syncmanager.register method of the syncmanager interface returns a promise that resolves to a syncregistration instance.
SyncManager - Web APIs
methods syncmanager.register create a new sync registration and return a promise.
TextDecoder() - Web APIs
"csiso2022kr", "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.
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.
TextEncoder.prototype.encode() - Web APIs
the textencoder.prototype.encode() method takes a usvstring as input, and returns a uint8array containing the text given in parameters encoded with the specific method for that textencoder object.
TextMetrics - Web APIs
the textmetrics interface represents the dimensions of a piece of text in the canvas; a textmetrics() instance can be retrieved using the canvasrenderingcontext2d.measuretext() method.
TextTrack: cuechange event - Web APIs
bubbles no cancelable no interface event event handler property globaleventhandlers.oncuechange examples on the texttrack you can set up a listener for the cuechange event on a texttrack using the addeventlistener() method: track.addeventlistener('cuechange', function () { let cues = track.activecues; // array of current cues }); or you can just set the oncuechange event handler property: track.oncuechange = function () { let cues = track.activecues; // array of current cues } on the track element the underlying texttrack, indicated by the track property, receives a cuechange event every time the current...
TextTrack - Web APIs
WebAPITextTrack
methods this interface also inherits methods from eventtarget.
TextTrackList - Web APIs
methods this interface also inherits methods from its parent interface, eventtarget.
Touch - Web APIs
WebAPITouch
methods this interface has no method and no parent, and doesn't inherits or implements any method.
TouchList.identifiedTouch() - Web APIs
the identifiedtouch() method returns the first touch item in the touchlist that matches the specified identifier.
TouchList.length - Web APIs
WebAPITouchListlength
example this code example illustrates the use of the touchlist interface's item method and the length property.
TouchList - Web APIs
WebAPITouchList
methods touchlist.identifiedtouch() returns the first touch item in the list whose identifier matches a specified value.
Using Touch Events - Web APIs
to prevent the emulated mouse events from being sent, use the preventdefault() method in the touch event handlers.
TrackDefaultList.TrackDefault() - Web APIs
the trackdefault() getter method of the trackdefaultlist interface allows the trackdefault objects in the list to be accessed with an array operator (i.e.
TrackDefaultList - Web APIs
methods inherits properties from its parent interface, eventtarget.
TrackEvent - Web APIs
methods trackevent has no methods of its own; however, it is based on event, so it provides the methods available on event objects.
TransformStream - Web APIs
methods none examples anything-to-uint8array stream in the following example, a transform stream passes through all chunks it receives as uint8array values.
TreeWalker.expandEntityReferences - Web APIs
this takes precedence over the value of the treewalker.whattoshow method and the associated filter.
TreeWalker.filter - Web APIs
WebAPITreeWalkerfilter
when creating the treewalker, the filter object is passed in as the third parameter, and its method nodefilter.acceptnode() is called on every single node to determine whether or not to accept it.
TreeWalker.firstChild() - Web APIs
the treewalker.firstchild() method moves the current node to the first visible child of the current node, and returns the found child.
TreeWalker.lastChild() - Web APIs
the treewalker.lastchild() method moves the current node to the last visible child of the current node, and returns the found child.
TreeWalker.nextNode() - Web APIs
the treewalker.nextnode() method moves the current node to the next visible node in the document order, and returns the found node.
TreeWalker.nextSibling() - Web APIs
the treewalker.nextsibling() method moves the current node to its next sibling, if any, and returns the found sibling.
TreeWalker.parentNode() - Web APIs
the treewalker.parentnode() method moves the current node to the first visible ancestor node in the document order, and returns the found node.
TreeWalker.previousNode() - Web APIs
the treewalker.previousnode() method moves the current node to the previous visible node in the document order, and returns the found node.
TreeWalker.previousSibling() - Web APIs
the treewalker.previoussibling() method moves the current node to its previous sibling, if any, and returns the found sibling.
TypeInfo - Web APIs
WebAPITypeInfo
methods typeinfo.isderivedfrom() returns a boolean.
UIEvent.cancelBubble - Web APIs
use event.stoppropagation() instead of this non-standard method.
URL.createObjectURL() - Web APIs
the url.createobjecturl() static method creates a domstring containing a url representing the object given in the parameter.
URL.toJSON() - Web APIs
WebAPIURLtoJSON
the tojson() method of the url interface returns a usvstring containing a serialized version of the url, although in practice it seems to have the same effect as url.tostring().
URL.toString() - Web APIs
WebAPIURLtoString
the url.tostring() stringifier method returns a usvstring containing the whole url.
URLSearchParams.append() - Web APIs
the append() method of the urlsearchparams interface appends a specified key/value pair as a new search parameter.
URLSearchParams.delete() - Web APIs
the delete() method of the urlsearchparams interface deletes the given search parameter and all its associated values, from the list of all search parameters.
URLSearchParams.entries() - Web APIs
the entries() method of the urlsearchparams interface returns an iterator allowing iteration through all key/value pairs contained in this object.
URLSearchParams.forEach() - Web APIs
the foreach() method of the urlsearchparams interface allows iteration through all values contained in this object via a callback function.
URLSearchParams.get() - Web APIs
the get() method of the urlsearchparams interface returns the first value associated to the given search parameter.
URLSearchParams.getAll() - Web APIs
the getall() method of the urlsearchparams interface returns all the values associated with a given search parameter as an array.
URLSearchParams.has() - Web APIs
the has() method of the urlsearchparams interface returns a boolean that indicates whether a parameter with the specified name exists.
URLSearchParams.values() - Web APIs
the values() method of the urlsearchparams interface returns an iterator allowing iteration through all values contained in this object.
URLUtilsReadOnly.toString() - Web APIs
the urlutilsreadonly.tostring() stringifier method returns a domstring containing the whole url.
URL API - Web APIs
WebAPIURL API
you can also look up the values of individual parameters with the urlsearchparams object's get() method: let addr = new url("https://mysite.com/login?user=someguy&page=news"); try { loginuser(addr.searchparams.get("user")); gotopage(addr.searchparams.get("page")); } catch(err) { showerrormessage(err); } for example, in the above snippet, the username and target page are taken from the query and passed to appropriate functions that are used by the site's code to log in and route the user to...
USB.getDevices() - Web APIs
WebAPIUSBgetDevices
the getdevices method of the usb interface returns a promise that resolves with an array of usbdevice objects for paired attached devices.
USB.requestDevice() - Web APIs
WebAPIUSBrequestDevice
the requestdevice() method of the usb interface returns a promise that resolves with an instance of usbdevice if the specified device is found.
USBDevice.claimInterface() - Web APIs
the claiminterface() method of the usbdevice interface returns a promise that resolves when the requested interface is claimed for exclusive access.
USBDevice.clearHalt() - Web APIs
the clearhalt() method of the usbdevice interface returns a promise that resolves when a halt condition is cleared.
USBDevice.close() - Web APIs
WebAPIUSBDeviceclose
the close() method of the usbdevice interface returns a promise that resolves when all open interfaces are released and the device session has ended.
USBDevice.controlTransferIn() - Web APIs
the controltransferin() method of the usbdevice interface returns a promise that resolves with a usbintransferresult when the result of a command or status request has been received from the usb device.
USBDevice.controlTransferOut() - Web APIs
the controltransferout() method of the usbdevice interface returns a promise that resolves with a usbouttransferresult when a command or status operation has been transmitted to the usb device.
USBDevice.isochronousTransferIn() - Web APIs
the isochronoustransferin() method of the usbdevice interface returns a promise that resolves with a usbisochronousintransferresult when time sensitive information has been transmitted received from the usb device.
USBDevice.isochronousTransferOut() - Web APIs
the isochronoustransferout() method of the usbdevice interface returns a promise that resolves with a usbisochronousouttransferresult when time sensitive information has been transmitted to the usb device.
USBDevice.open() - Web APIs
WebAPIUSBDeviceopen
the open() method of the usbdevice interface returns a promise that resolves when a device session has started.
USBDevice.releaseInterface() - Web APIs
the releaseinterface() method of the usbdevice interface returns a promise that resolves when a cliamed interface is released from exclusive access.
USBDevice.reset() - Web APIs
WebAPIUSBDevicereset
the reset() method of the usbdevice interface returns a promise that resolves when the device is reset and all app operations canceled and their promises rejected.
USBDevice.selectAlternateInterface() - Web APIs
the selectalternateinterface() method of the usbdevice interface returns a promise that resolves when the specified alternative endpoint is selected.
USBDevice.selectConfiguration() - Web APIs
the selectconfiguration() method of the usbdevice interface returns a promise that resolves when the specified configuration is selected.
USBDevice.transferIn() - Web APIs
the transferin() method of the usbdevice interface returns a promise that resolves with a usbtransferinresult when bulk or interrupt data is received from the usb device.
USBDevice.transferOut() - Web APIs
the transferout() method of the usbdevice interface returns a promise that resolves with a usbtransferoutresult when bulk or interrupt data is sent to the usb device.
USBEndpoint - Web APIs
this value is used to identify the endpoint when calling methods on usbdevice.
USBInTransferResult - Web APIs
the usbintransferresult interface of the webusb api provides the result from a call to the transferin() and controltransferin() methods of the usbdevice interface.
USBIsochronousInTransferPacket - Web APIs
the usbisochronousintransferpacket interface of the webusb api is part of the response from a call to the isochronoustransferin() method of the usbdevice interface.
USBIsochronousInTransferResult - Web APIs
the usbisochronousintransferresult interface of the webusb api provides the result from a call to the isochronoustransferin() method of the usbdevice interface.
USBIsochronousOutTransferPacket - Web APIs
the usbisochronousouttransferpacket interface of the webusb api is part of the response from a call to the isochronoustransferout() method of the usbdevice interface.
USBIsochronousOutTransferResult - Web APIs
the usbisochronousouttransferresult interface of the webusb api provides the result from a call to the isochronoustransferout() method of the usbdevice interface.
USBOutTransferResult - Web APIs
the usbouttransferresult interface of the webusb api provides the result from a call to the transferout() and controltransferout() methods of the usbdevice interface.
UserDataHandler - Web APIs
methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is being cloned, imported, renamed and as well, if deleted or adopted.
VTTCue - Web APIs
WebAPIVTTCue
methods getcueashtml() returns the cue text as a documentfragment.
ValidityState - Web APIs
customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method.
VideoConfiguration - Web APIs
the videoconfiguration dictionary of the media capabilities api is used to define the video file being tested when calling the mediacapabilities methods encodinginfo() and decodinginfo() to determine whether or not the described video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled.
VideoTrack.id - Web APIs
WebAPIVideoTrackid
this id can be used with the videotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element.
VideoTrackList - Web APIs
methods this interface also inherits methods from its parent interface, eventtarget.
VisualViewport: resize event - Web APIs
bubbles no cancelable no interface event event handler property onresize examples you can use the resize event in an addeventlistener method: visualviewport.addeventlistener('resize', function() { ...
VisualViewport: scroll event - Web APIs
bubbles no cancelable no interface event event handler property onscroll examples you can use the scroll event in an addeventlistener method: visualviewport.addeventlistener('scroll', function() { ...
Visual Viewport API - Web APIs
when called it queries the offsetleft and height properties for values it uses in a css translate() method.
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
the webgl_compressed_texture_astc.getsupportedprofiles() method returns an array of strings containing the names of the astc profiles supported by the implementation.
WEBGL_compressed_texture_atc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
WEBGL_compressed_texture_etc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
WEBGL_compressed_texture_pvrtc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
WEBGL_compressed_texture_s3tc - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
WEBGL_compressed_texture_s3tc_srgb - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method.
WEBGL_debug_shaders.getTranslatedShaderSource() - Web APIs
the webgl_debug_shaders.gettranslatedshadersource() method is part of the webgl api and allows you to debug a translated shader.
WakeLockSentinel.release() - Web APIs
the release() method of the wakelocksentinel interface releases the wakelocksentinel, returning a promise that is resolved once the sentinel has been successfully released.
WaveShaperNode - Web APIs
methods no specific method; inherits methods from its parent, audionode.
WebGL2RenderingContext.beginQuery() - Web APIs
the webgl2renderingcontext.beginquery() method of the webgl 2 api starts an asynchronous query.
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
the webgl2renderingcontext.begintransformfeedback() method of the webgl 2 api starts a transform feedback operation.
WebGL2RenderingContext.bindBufferBase() - Web APIs
the webgl2renderingcontext.bindbufferbase() method of the webgl 2 api binds a given webglbuffer to a given binding point (target) at a given index.
WebGL2RenderingContext.bindBufferRange() - Web APIs
the webgl2renderingcontext.bindbufferrange() method of the webgl 2 api binds a range of a given webglbuffer to a given binding point (target) at a given index.
WebGL2RenderingContext.bindSampler() - Web APIs
the webgl2renderingcontext.bindsampler() method of the webgl 2 api binds a passed webglsampler object to the texture unit at the passed index.
WebGL2RenderingContext.bindTransformFeedback() - Web APIs
the webgl2renderingcontext.bindtransformfeedback() method of the webgl 2 api binds a passed webgltransformfeedback object to the current gl state.
WebGL2RenderingContext.bindVertexArray() - Web APIs
the webgl2renderingcontext.bindvertexarray() method of the webgl 2 api binds a passed webglvertexarrayobject object to the buffer.
WebGL2RenderingContext.blitFramebuffer() - Web APIs
the webgl2renderingcontext.blitframebuffer() method of the webgl 2 api transfers a block of pixels from the read framebuffer to the draw framebuffer.
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
the webgl2renderingcontext.clearbuffer[fiuv]() methods of the webgl 2 api clear buffers from the currently bound framebuffer.
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
the webgl2renderingcontext.compressedtexsubimage3d() method of the webgl api specifies a three-dimensional sub-rectangle for a texture image in a compressed format.
WebGL2RenderingContext.copyBufferSubData() - Web APIs
the webgl2renderingcontext.copybuffersubdata() method of the webgl 2 api copies part of the data of a buffer to another buffer.
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
the webgl2renderingcontext.copytexsubimage3d() method of the webgl api copies pixels from the current webglframebuffer into an existing 3d texture sub-image.
WebGL2RenderingContext.createQuery() - Web APIs
the webgl2renderingcontext.createquery() method of the webgl 2 api creates and initializes webglquery objects, which provide ways to asynchronously query for information.
WebGL2RenderingContext.createSampler() - Web APIs
the webgl2renderingcontext.createsampler() method of the webgl 2 api creates and initializes webglsampler objects.
WebGL2RenderingContext.createTransformFeedback() - Web APIs
the webgl2renderingcontext.createtransformfeedback() method of the webgl 2 api creates and initializes webgltransformfeedback objects.
WebGL2RenderingContext.createVertexArray() - Web APIs
the webgl2renderingcontext.createvertexarray() method of the webgl 2 api creates and initializes a webglvertexarrayobject object that represents a vertex array object (vao) pointing to vertex array data and which provides names for different sets of vertex data.
WebGL2RenderingContext.deleteQuery() - Web APIs
the webgl2renderingcontext.deletequery() method of the webgl 2 api deletes a given webglquery object.
WebGL2RenderingContext.deleteSampler() - Web APIs
the webgl2renderingcontext.deletesampler() method of the webgl 2 api deletes a given webglsampler object.
WebGL2RenderingContext.deleteSync() - Web APIs
the webgl2renderingcontext.deletesync() method of the webgl 2 api deletes a given webglsync object.
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
the webgl2renderingcontext.deletetransformfeedback() method of the webgl 2 api deletes a given webgltransformfeedback object.
WebGL2RenderingContext.deleteVertexArray() - Web APIs
the webgl2renderingcontext.deletevertexarray() method of the webgl 2 api deletes a given webglvertexarrayobject object.
WebGL2RenderingContext.drawBuffers() - Web APIs
the webgl2renderingcontext.drawbuffers() method of the webgl 2 api defines draw buffers to which fragment colors are written into.
WebGL2RenderingContext.drawRangeElements() - Web APIs
the webgl2renderingcontext.drawrangeelements() method of the webgl api renders primitives from array data in a given range.
WebGL2RenderingContext.endQuery() - Web APIs
the webgl2renderingcontext.endquery() method of the webgl 2 api marks the end of a given query target.
WebGL2RenderingContext.endTransformFeedback() - Web APIs
the webgl2renderingcontext.endtransformfeedback() method of the webgl 2 api ends a transform feedback operation.
WebGL2RenderingContext.fenceSync() - Web APIs
the webgl2renderingcontext.fencesync() method of the webgl 2 api creates a new webglsync object and inserts it into the gl command stream.
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
the webgl2renderingcontext.getactiveuniformblockname() method of the webgl 2 api retrieves the name of the active uniform block at a given index within a webglprogram.
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
the webgl2renderingcontext.getactiveuniformblockparameter() method of the webgl 2 api retrieves information about an active uniform block within a webglprogram.
WebGL2RenderingContext.getActiveUniforms() - Web APIs
the webgl2renderingcontext.getactiveuniforms() method of the webgl 2 api retrieves information about active uniforms within a webglprogram.
WebGL2RenderingContext.getBufferSubData() - Web APIs
the webgl2renderingcontext.getbuffersubdata() method of the webgl 2 api reads data from a buffer binding point and writes them to an arraybuffer or sharedarraybuffer.
WebGL2RenderingContext.getFragDataLocation() - Web APIs
the webgl2renderingcontext.getfragdatalocation() method of the webgl 2 api returns the binding of color numbers to user-defined varying out variables.
WebGL2RenderingContext.getIndexedParameter() - Web APIs
the webgl2renderingcontext.getindexedparameter() method of the webgl 2 api returns indexed information about a given target.
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
the webgl2renderingcontext.getinternalformatparameter() method of the webgl 2 api returns information about implementation-dependent support for internal formats.
WebGL2RenderingContext.getQuery() - Web APIs
the webgl2renderingcontext.getquery() method of the webgl 2 api returns the currently active webglquery for the target, or null.
WebGL2RenderingContext.getQueryParameter() - Web APIs
the webgl2renderingcontext.getqueryparameter() method of the webgl 2 api returns parameter information of a webglquery object.
WebGL2RenderingContext.getSamplerParameter() - Web APIs
the webgl2renderingcontext.getsamplerparameter() method of the webgl 2 api returns parameter information of a webglsampler object.
WebGL2RenderingContext.getSyncParameter() - Web APIs
the webgl2renderingcontext.getsyncparameter() method of the webgl 2 api returns parameter information of a webglsync object.
WebGL2RenderingContext.getTransformFeedbackVarying() - Web APIs
the webgl2renderingcontext.gettransformfeedbackvarying() method of the webgl 2 api returns information about varying variables from webgltransformfeedback buffers.
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
the webgl2renderingcontext.getuniformblockindex() method of the webgl 2 api retrieves the index of a uniform block within a webglprogram.
WebGL2RenderingContext.getUniformIndices() - Web APIs
the webgl2renderingcontext.getuniformindices() method of the webgl 2 api retrieves the indices of a number of uniforms within a webglprogram.
WebGL2RenderingContext.invalidateFramebuffer() - Web APIs
the webgl2renderingcontext.invalidateframebuffer() method of the webgl 2 api invalidates the contents of attachments in a framebuffer.
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
the webgl2renderingcontext.invalidatesubframebuffer() method of the webgl 2 api invalidates portions of the contents of attachments in a framebuffer.
WebGL2RenderingContext.isQuery() - Web APIs
the webgl2renderingcontext.isquery() method of the webgl 2 api returns true if the passed object is a valid webglquery object.
WebGL2RenderingContext.isSampler() - Web APIs
the webgl2renderingcontext.issampler() method of the webgl 2 api returns true if the passed object is a valid webglsampler object.
WebGL2RenderingContext.isSync() - Web APIs
the webgl2renderingcontext.issync() method of the webgl 2 api returns true if the passed object is a valid webglsync object.
WebGL2RenderingContext.isTransformFeedback() - Web APIs
the webgl2renderingcontext.istransformfeedback() method of the webgl 2 api returns true if the passed object is a valid webgltransformfeedback object.
WebGL2RenderingContext.isVertexArray() - Web APIs
the webgl2renderingcontext.isvertexarray() method of the webgl api returns true if the passed object is a valid webglvertexarrayobject object.
WebGL2RenderingContext.pauseTransformFeedback() - Web APIs
the webgl2renderingcontext.pausetransformfeedback() method of the webgl 2 api pauses a transform feedback operation.
WebGL2RenderingContext.readBuffer() - Web APIs
the webgl2renderingcontext.readbuffer() method of the webgl 2 api selects a color buffer as the source for pixels for subsequent calls to copyteximage2d, copytexsubimage2d, copytexsubimage3d or readpixels.
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
the webgl2renderingcontext.renderbufferstoragemultisample() method of the webgl 2 api returns creates and initializes a renderbuffer object's data store and allows specifying a number of samples to be used.
WebGL2RenderingContext.resumeTransformFeedback() - Web APIs
the webgl2renderingcontext.resumetransformfeedback() method of the webgl 2 api resumes a transform feedback operation.
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
the webgl2renderingcontext.samplerparameter[if]() methods of the webgl 2 api set webglsampler parameters.
WebGL2RenderingContext.texImage3D() - Web APIs
the webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image.
WebGL2RenderingContext.texStorage2D() - Web APIs
the webgl2renderingcontext.texstorage2d() method of the webgl api specifies all levels of two-dimensional texture storage.
WebGL2RenderingContext.texStorage3D() - Web APIs
the webgl2renderingcontext.texstorage3d() method of the webgl api specifies all levels of a three-dimensional texture or two-dimensional array texture.
WebGL2RenderingContext.texSubImage3D() - Web APIs
the webgl2renderingcontext.texsubimage3d() method of the webgl api specifies a sub-rectangle of the current texture.
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
the webgl2renderingcontext.transformfeedbackvaryings() method of the webgl 2 api specifies values to record in webgltransformfeedback buffers.
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
the webgl2renderingcontext.uniformblockbinding() method of the webgl 2 api assigns binding points for active uniform blocks.
WebGL2RenderingContext.vertexAttribI4[u]i[v]() - Web APIs
the webgl2renderingcontext.vertexattribi4[u]i[v]() methods of the webgl 2 api specify integer values for generic vertex attributes.
WebGLActiveInfo.name - Web APIs
the read-only webglactiveinfo.name property represents the name of the requested data returned by calling the getactiveattrib() or getactiveuniform() methods.
WebGLActiveInfo.size - Web APIs
the read-only webglactiveinfo.size property is a number representing the size of the requested data returned by calling the getactiveattrib() or getactiveuniform() methods.
WebGLActiveInfo.type - Web APIs
the read-only webglactiveinfo.type property represents the type of the requested data returned by calling the getactiveattrib() or getactiveuniform() methods.
WebGLActiveInfo - Web APIs
the webglactiveinfo interface is part of the webgl api and represents the information returned by calling the webglrenderingcontext.getactiveattrib() and webglrenderingcontext.getactiveuniform() methods.
WebGLQuery - Web APIs
when working with webglquery objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.createquery() webgl2renderingcontext.deletequery() webgl2renderingcontext.isquery() webgl2renderingcontext.beginquery() webgl2renderingcontext.endquery() webgl2renderingcontext.getquery() webgl2renderingcontext.getqueryparameter() examples creating a webglquery object in this example, gl must be a webgl2renderingcontex...
WebGLRenderingContext.activeTexture() - Web APIs
the webglrenderingcontext.activetexture() method of the webgl api specifies which texture unit to make active.
WebGLRenderingContext.attachShader() - Web APIs
the webglrenderingcontext.attachshader() method of the webgl api attaches either a fragment or vertex webglshader to a webglprogram.
WebGLRenderingContext.bindAttribLocation() - Web APIs
the webglrenderingcontext.bindattriblocation() method of the webgl api binds a generic vertex index to an attribute variable.
WebGLRenderingContext.bindBuffer() - Web APIs
the webglrenderingcontext.bindbuffer() method of the webgl api binds a given webglbuffer to a target.
WebGLRenderingContext.bindFramebuffer() - Web APIs
the webglrenderingcontext.bindframebuffer() method of the webgl api binds a given webglframebuffer to a target.
WebGLRenderingContext.bindRenderbuffer() - Web APIs
the webglrenderingcontext.bindrenderbuffer() method of the webgl api binds a given webglrenderbuffer to a target, which must be gl.renderbuffer.
WebGLRenderingContext.bindTexture() - Web APIs
the webglrenderingcontext.bindtexture() method of the webgl api binds a given webgltexture to a target (binding point).
WebGLRenderingContext.blendColor() - Web APIs
the webglrenderingcontext.blendcolor() method of the webgl api is used to set the source and destination blending factors.
WebGLRenderingContext.blendEquation() - Web APIs
the webglrenderingcontext.blendequation() method of the webgl api is used to set both the rgb blend equation and alpha blend equation to a single equation.
WebGLRenderingContext.blendEquationSeparate() - Web APIs
the webglrenderingcontext.blendequationseparate() method of the webgl api is used to set the rgb blend equation and alpha blend equation separately.
WebGLRenderingContext.blendFunc() - Web APIs
the webglrenderingcontext.blendfunc() method of the webgl api defines which function is used for blending pixel arithmetic.
WebGLRenderingContext.blendFuncSeparate() - Web APIs
the webglrenderingcontext.blendfuncseparate() method of the webgl api defines which function is used for blending pixel arithmetic for rgb and alpha components separately.
WebGLRenderingContext.bufferSubData() - Web APIs
the webglrenderingcontext.buffersubdata() method of the webgl api updates a subset of a buffer object's data store.
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
the webglrenderingcontext.checkframebufferstatus() method of the webgl api returns the completeness status of the webglframebuffer object.
WebGLRenderingContext.colorMask() - Web APIs
the webglrenderingcontext.colormask() method of the webgl api sets which color components to enable or to disable when drawing or rendering to a webglframebuffer.
WebGLRenderingContext.compileShader() - Web APIs
the webglrenderingcontext.compileshader() method of the webgl api compiles a glsl shader into binary data so that it can be used by a webglprogram.
WebGLRenderingContext.copyTexImage2D() - Web APIs
the webglrenderingcontext.copyteximage2d() method of the webgl api copies pixels from the current webglframebuffer into a 2d texture image.
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
the webglrenderingcontext.copytexsubimage2d() method of the webgl api copies pixels from the current webglframebuffer into an existing 2d texture sub-image.
WebGLRenderingContext.createBuffer() - Web APIs
the webglrenderingcontext.createbuffer() method of the webgl api creates and initializes a webglbuffer storing data such as vertices or colors.
WebGLRenderingContext.createFramebuffer() - Web APIs
the webglrenderingcontext.createframebuffer() method of the webgl api creates and initializes a webglframebuffer object.
WebGLRenderingContext.createProgram() - Web APIs
the webglrenderingcontext.createprogram() method of the webgl api creates and initializes a webglprogram object.
WebGLRenderingContext.createRenderbuffer() - Web APIs
the webglrenderingcontext.createrenderbuffer() method of the webgl api creates and initializes a webglrenderbuffer object.
WebGLRenderingContext.createShader() - Web APIs
the webglrenderingcontext method createshader() of the webgl api creates a webglshader that can then be configured further using webglrenderingcontext.shadersource() and webglrenderingcontext.compileshader().
WebGLRenderingContext.createTexture() - Web APIs
the webglrenderingcontext.createtexture() method of the webgl api creates and initializes a webgltexture object.
WebGLRenderingContext.depthMask() - Web APIs
the webglrenderingcontext.depthmask() method of the webgl api sets whether writing into the depth buffer is enabled or disabled.
WebGLRenderingContext.depthRange() - Web APIs
the webglrenderingcontext.depthrange() method of the webgl api specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
WebGLRenderingContext.detachShader() - Web APIs
the webglrenderingcontext.detachshader() method of the webgl api detaches a previously attached webglshader from a webglprogram.
WebGLRenderingContext.disableVertexAttribArray() - Web APIs
the webglrenderingcontext.disablevertexattribarray() method of the webgl api turns the generic vertex attribute array off at a given index position.
WebGLRenderingContext.drawArrays() - Web APIs
the webglrenderingcontext.drawarrays() method of the webgl api renders primitives from array data.
WebGLRenderingContext.drawElements() - Web APIs
the webglrenderingcontext.drawelements() method of the webgl api renders primitives from array data.
WebGLRenderingContext.finish() - Web APIs
the webglrenderingcontext.finish() method of the webgl api blocks execution until all previously called commands are finished.
WebGLRenderingContext.flush() - Web APIs
the webglrenderingcontext.flush() method of the webgl api empties different buffer commands, causing all commands to be executed as quickly as possible.
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
the webglrenderingcontext.framebufferrenderbuffer() method of the webgl api attaches a webglrenderbuffer object to a webglframebuffer object.
WebGLRenderingContext.framebufferTexture2D() - Web APIs
the webglrenderingcontext.framebuffertexture2d() method of the webgl api attaches a texture to a webglframebuffer.
WebGLRenderingContext.frontFace() - Web APIs
the webglrenderingcontext.frontface() method of the webgl api specifies whether polygons are front- or back-facing by setting a winding orientation.
WebGLRenderingContext.generateMipmap() - Web APIs
the webglrenderingcontext.generatemipmap() method of the webgl api generates a set of mipmaps for a webgltexture object.
WebGLRenderingContext.getActiveAttrib() - Web APIs
the webglrenderingcontext.getactiveattrib() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a vertex attribute.
WebGLRenderingContext.getActiveUniform() - Web APIs
the webglrenderingcontext.getactiveuniform() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a uniform attribute.
WebGLRenderingContext.getAttachedShaders() - Web APIs
the webglrenderingcontext.getattachedshaders() method of the webgl api returns a list of webglshader objects attached to a webglprogram.
WebGLRenderingContext.getAttribLocation() - Web APIs
the webglrenderingcontext.getattriblocation() method of the webgl api returns the location of an attribute variable in a given webglprogram.
WebGLRenderingContext.getBufferParameter() - Web APIs
the webglrenderingcontext.getbufferparameter() method of the webgl api returns information about the buffer.
WebGLRenderingContext.getError() - Web APIs
the webglrenderingcontext.geterror() method of the webgl api returns error information.
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
the webglrenderingcontext.getframebufferattachmentparameter() method of the webgl api returns information about a framebuffer's attachment.
WebGLRenderingContext.getParameter() - Web APIs
the webglrenderingcontext.getparameter() method of the webgl api returns a value for the passed parameter name.
WebGLRenderingContext.getProgramParameter() - Web APIs
the webglrenderingcontext.getprogramparameter() method of the webgl api returns information about the given program.
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
the webglrenderingcontext.getrenderbufferparameter() method of the webgl api returns information about the renderbuffer.
WebGLRenderingContext.getShaderParameter() - Web APIs
the webglrenderingcontext.getshaderparameter() method of the webgl api returns information about the given shader.
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
the webglrenderingcontext.getshaderprecisionformat() method of the webgl api returns a new webglshaderprecisionformat object describing the range and precision for the specified shader numeric format.
WebGLRenderingContext.getShaderSource() - Web APIs
the webglrenderingcontext.getshadersource() method of the webgl api returns the source code of a webglshader as a domstring.
WebGLRenderingContext.getTexParameter() - Web APIs
the webglrenderingcontext.gettexparameter() method of the webgl api returns information about the given texture.
WebGLRenderingContext.getUniform() - Web APIs
the webglrenderingcontext.getuniform() method of the webgl api returns the value of a uniform variable at a given location.
WebGLRenderingContext.getVertexAttrib() - Web APIs
the webglrenderingcontext.getvertexattrib() method of the webgl api returns information about a vertex attribute at a given position.
WebGLRenderingContext.getVertexAttribOffset() - Web APIs
the webglrenderingcontext.getvertexattriboffset() method of the webgl api returns the address of a specified vertex attribute.
WebGLRenderingContext.hint() - Web APIs
the webglrenderingcontext.hint() method of the webgl api specifies hints for certain behaviors.
WebGLRenderingContext.isBuffer() - Web APIs
the webglrenderingcontext.isbuffer() method of the webgl api returns true if the passed webglbuffer is valid and false otherwise.
WebGLRenderingContext.isContextLost() - Web APIs
the webglrenderingcontext.iscontextlost() method returns a boolean indicating whether or not the webgl context has been lost and must be re-established before rendering can resume.
WebGLRenderingContext.isFramebuffer() - Web APIs
the webglrenderingcontext.isframebuffer() method of the webgl api returns true if the passed webglframebuffer is valid and false otherwise.
WebGLRenderingContext.isProgram() - Web APIs
the webglrenderingcontext.isprogram() method of the webgl api returns true if the passed webglprogram is valid, false otherwise.
WebGLRenderingContext.isRenderbuffer() - Web APIs
the webglrenderingcontext.isrenderbuffer() method of the webgl api returns true if the passed webglrenderbuffer is valid and false otherwise.
WebGLRenderingContext.isShader() - Web APIs
the webglrenderingcontext.isshader() method of the webgl api returns true if the passed webglshader is valid, false otherwise.
WebGLRenderingContext.isTexture() - Web APIs
the webglrenderingcontext.istexture() method of the webgl api returns true if the passed webgltexture is valid and false otherwise.
WebGLRenderingContext.lineWidth() - Web APIs
the webglrenderingcontext.linewidth() method of the webgl api sets the line width of rasterized lines.
WebGLRenderingContext.linkProgram() - Web APIs
the webglrenderingcontext interface's linkprogram() method links a given webglprogram, completing the process of preparing the gpu code for the program's fragment and vertex shaders.
WebGLRenderingContext.readPixels() - Web APIs
the webglrenderingcontext.readpixels() method of the webgl api reads a block of pixels from a specified rectangle of the current color framebuffer into an arraybufferview object.
WebGLRenderingContext.renderbufferStorage() - Web APIs
the webglrenderingcontext.renderbufferstorage() method of the webgl api creates and initializes a renderbuffer object's data store.
WebGLRenderingContext.scissor() - Web APIs
the webglrenderingcontext.scissor() method of the webgl api sets a scissor box, which limits the drawing to a specified rectangle.
WebGLRenderingContext.shaderSource() - Web APIs
the webglrenderingcontext.shadersource() method of the webgl api sets the source code of a webglshader.
WebGLRenderingContext.texImage2D() - Web APIs
the webglrenderingcontext.teximage2d() method of the webgl api specifies a two-dimensional texture image.
WebGLRenderingContext.texParameter[fi]() - Web APIs
the webglrenderingcontext.texparameter[fi]() methods of the webgl api set texture parameters.
WebGLRenderingContext.texSubImage2D() - Web APIs
the webglrenderingcontext.texsubimage2d() method of the webgl api specifies a sub-rectangle of the current texture.
WebGLRenderingContext.useProgram() - Web APIs
the webglrenderingcontext.useprogram() method of the webgl api sets the specified webglprogram as part of the current rendering state.
WebGLRenderingContext.validateProgram() - Web APIs
the webglrenderingcontext.validateprogram() method of the webgl api validates a webglprogram.
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
the webglrenderingcontext.vertexattrib[1234]f[v]() methods of the webgl api specify constant values for generic vertex attributes.
WebGLRenderingContext.viewport() - Web APIs
the webglrenderingcontext.viewport() method of the webgl api sets the viewport, which specifies the affine transformation of x and y from normalized device coordinates to window coordinates.
WebGLSampler - Web APIs
when working with webglsampler objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.createsampler() webgl2renderingcontext.deletesampler() webgl2renderingcontext.issampler() webgl2renderingcontext.bindsampler() webgl2renderingcontext.getsamplerparameter() examples creating a webglsampler object in this example, gl must be a webgl2renderingcontext.
WebGLSync - Web APIs
WebAPIWebGLSync
when working with webglsync objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.fencesync() webgl2renderingcontext.deletesync() webgl2renderingcontext.issync() webgl2renderingcontext.clientwaitsync() webgl2renderingcontext.waitsync() webgl2renderingcontext.getsyncparameter() examples creating a webglsync object in this example, gl must be a webgl2renderingcontext.
WebGLTransformFeedback - Web APIs
when working with webgltransformfeedback objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.createtransformfeedback() webgl2renderingcontext.deletetransformfeedback() webgl2renderingcontext.istransformfeedback() webgl2renderingcontext.bindtransformfeedback() webgl2renderingcontext.begintransformfeedback() webgl2renderingcontext.endtransformfeedback() webgl2renderingcontext.pausetransformfeedback() webgl2renderingcontext.resumetransformfeedback() webgl2...
WebGLVertexArrayObject - Web APIs
when working with webglvertexarrayobject objects, the following methods are useful: webgl2renderingcontext.createvertexarray() webgl2renderingcontext.deletevertexarray() webgl2renderingcontext.isvertexarray() webgl2renderingcontext.bindvertexarray() webgl 1: the oes_vertex_array_object extension allows you to use vertex array objects in a webgl 1 context.
Basic scissoring - Web APIs
we enable it here using the enable() method (you will also use enable() to activate many other features of webgl; hence, the use of the scissor_test constant as an argument in this case).
Compressed texture formats - Web APIs
the webgl api provides methods to use compressed texture formats.
Creating 3D objects using WebGL - Web APIs
to do this efficiently, we're going to switch from drawing using the vertices directly by calling the gl.drawarrays() method to using the vertex array as a table, and referencing individual vertices in that table to define the positions of each face's vertices, by calling gl.drawelements().
Using WebGL extensions - Web APIs
var available_extensions = gl.getsupportedextensions(); the webglrenderingcontext.getsupportedextensions() method returns an array of strings, one for each supported extension.
WebGL best practices - Web APIs
another important method for batching is texture atlasing, where multiple images are placed into a single texture, often like a checkerboard.
Using WebRTC data channels - Web APIs
let datachannel = pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true.
WebSocket - Web APIs
WebAPIWebSocket
methods websocket.close([code[, reason]]) closes the connection.
Writing WebSocket servers - Web APIs
the client will send a pretty standard http request with headers that looks like this (the http version must be 1.1 or greater, and the method must be get): get /chat http/1.1 host: example.com:8000 upgrade: websocket connection: upgrade sec-websocket-key: dghlihnhbxbszsbub25jzq== sec-websocket-version: 13 the client can solicit extensions and/or subprotocols here; see miscellaneous for details.
WebXR application life cycle - Web APIs
call the xrsession method requestanimationframe() to schedule the first frame render for the xr device.
WebXR Device API - Web APIs
to get an xrframe, call the session's requestanimationframe() method, providing a callback which will be called with the xrframe once available.
Keyframe Formats - Web APIs
this is the canonical format returned by the getkeyframes() method.
Web Animations API Concepts - Web APIs
like a dvd player, we can use the animation object’s methods to play, pause, seek, and control the animation’s playback direction and speed.
Web Animations API - Web APIs
extensions to the element interface element.animate() a shortcut method for creating and playing an animation on an element.
Web Crypto API - Web APIs
in order to avoid confusion, methods and properties of this interface have been removed from browsers implementing the web crypto api, and all web crypto api methods are available on a new interface: subtlecrypto.
Web Speech API - Web APIs
you can get these spoken by passing them to the speechsynthesis.speak() method.
WheelEvent - Web APIs
methods this interface doesn't define any specific methods, but inherits methods from its ancestors, mouseevent, uievent, and event.
Window.alert() - Web APIs
WebAPIWindowalert
the window.alert() method displays an alert dialog with the optional specified content and an ok button.
Window: appinstalled event - Web APIs
bubbles no cancelable no interface event event handler onappinstalled examples you can use the appinstalled event in an addeventlistener method: window.addeventlistener('appinstalled', function() { console.log('thank you for installing our app!'); }); or use the onappinstalled event handler property: window.onappinstalled = function() { console.log('thank you for installing our app!'); }; ...
Window.blur() - Web APIs
WebAPIWindowblur
syntax window.blur() example window.blur(); notes the window.blur() method is the programmatic equivalent of the user shifting focus away from the current window.
window.cancelAnimationFrame() - Web APIs
the window.cancelanimationframe() method cancels an animation frame request previously scheduled through a call to window.requestanimationframe().
window.cancelIdleCallback() - Web APIs
summary the window.cancelidlecallback() method cancels a callback previously scheduled with window.requestidlecallback().
Window.closed - Web APIs
WebAPIWindowclosed
refreshing a previously opened popup in this example the function refreshpopupwindow() calls the reload() method of the popup's location object to refresh its data.
Window.confirm() - Web APIs
WebAPIWindowconfirm
the window.confirm() method displays a modal dialog with an optional message and two buttons: ok and cancel.
Window.customElements - Web APIs
examples the most common example you'll see of this property being used is to get access to the customelementregistry.define() method to define and register a new custom element, e.g.: let customelementregistry = window.customelements; customelementregistry.define('my-custom-element', mycustomelement); however, it is usually shortened to something like the following: customelements.define('element-details', class extends htmlelement { constructor() { super(); const template = document .getelementbyid('element-details-template') ...
Window.dialogArguments - Web APIs
the dialogarguments property returns the parameters that were passed into the window.showmodaldialog() method.
Window.find() - Web APIs
WebAPIWindowfind
the window.find() method finds a string in a window.
Window.focus() - Web APIs
WebAPIWindowfocus
it may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns.
Window.getAttention() - Web APIs
the window.getattention() method attempts to get the user's attention.
Window.getComputedStyle() - Web APIs
the window.getcomputedstyle() method returns an object containing the values of all css properties of an element, after applying active stylesheets and resolving any basic computation those values may contain.
Window: hashchange event - Web APIs
bubbles yes cancelable no interface hashchangeevent event handler onhashchange examples you can use the hashchange event in an addeventlistener method: window.addeventlistener('hashchange', function() { console.log('the hash has changed!') }, false); or use the onhashchange event handler property: function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're visiting a cool feature!"); } } window.onhashchange = locationhashchanged; specifications specification status comment html living standardthe definition of 'hashch...
Window.home() - Web APIs
WebAPIWindowhome
the window.home() method returns the window to the home page.
Window.innerHeight - Web APIs
to change the width of the window, call one of its resize methods, such as resizeto() or resizeby().
Window.innerWidth - Web APIs
WebAPIWindowinnerWidth
to change the window's width, use one of the window methods for resizing windows, such as resizeby() or resizeto().
Window: languagechange event - Web APIs
bubbles no cancelable no interface event event handler onlanguagechange examples you can use the languagechange event in an addeventlistener method: window.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: window.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html living standardthe definition of 'languagechange' in that specification.
window.location - Web APIs
WebAPIWindowlocation
location.assign("http://www.mozilla.org"); // or location = "http://www.mozilla.org"; example #2: force reloading the current page from the server location.reload(true); example #3 consider the following example, which will reload the page by using the replace() method to insert the value of location.pathname into the hash: function reloadpagewithhash() { var initialpage = location.pathname; location.replace('http://example.com/#' + initialpage); } example #4: display the properties of the current url in an alert dialog: function showloc() { var olocation = location, alog = ["property (typeof): value", "location (" + (typeof olocation) + "): " + oloca...
Window.matchMedia() - Web APIs
WebAPIWindowmatchMedia
the window interface's matchmedia() method returns a new mediaquerylist object that can then be used to determine if the document matches the media query string, as well as to monitor the document to detect when it matches (or stops matching) that media query.
Window.moveBy() - Web APIs
WebAPIWindowmoveBy
the moveby() method of the window interface moves the current window by a specified amount.
Window.moveTo() - Web APIs
WebAPIWindowmoveTo
the moveto() method of the window interface moves the current window to the specified coordinates.
Window.name - Web APIs
WebAPIWindowname
window.name will convert all values to their string representations by using the tostring method.
Window.navigator - Web APIs
WebAPIWindownavigator
the window.navigator read-only property returns a reference to the navigator object, which has methods and properties about the application running the script.
Window: orientationchange event - Web APIs
bubbles no cancelable no interface event event handler onorientationchange example you can use the orientationchange event in an addeventlistener method: window.addeventlistener("orientationchange", function(event) { console.log("the orientation of the device is now " + event.target.screen.orientation.angle); }); or use the onorientationchange event handler property: window.onorientationchange = function(event) { console.log("the orientation of the device is now " + event.target.screen.orientation.angle); }; specifications specification status compatibility standardthe definition of 'orientationchange' in that specificat...
Window.performance - Web APIs
recommendation defines now() method.
Window.releaseEvents() - Web APIs
example window.releaseevents(event.keypress) notes note that you can pass a list of events to this method using the following syntax: window.releaseevents(event.keypress | event.keydown | event.keyup).
Window.resizeTo() - Web APIs
WebAPIWindowresizeTo
the window.resizeto() method dynamically resizes the window.
Window: resize event - Web APIs
pan id="width"></span></p> const heightoutput = document.queryselector('#height'); const widthoutput = document.queryselector('#width'); function 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.restore() - Web APIs
WebAPIWindowrestore
this method is currently not working, but you can use: window.moveto(window.screenx, window.screeny); browser compatibility the compatibility table in this page is generated from structured data.
Window.routeEvent() - Web APIs
WebAPIWindowrouteEvent
the window method routeevent(), which is obsolete and no longer available, used to be called to forward an event to the next object that has asked to capture events.
Window.scrollBy() - Web APIs
WebAPIWindowscrollBy
the window.scrollby() method scrolls the document in the window by the given amount.
Window.scrollByLines() - Web APIs
the window.scrollbylines() method scrolls the document by the specified number of lines.
Window.scrollByPages() - Web APIs
the window.scrollbypages() method scrolls the current document by the specified number of pages.
Window.scrollTo() - Web APIs
WebAPIWindowscrollTo
examples window.scrollto(0, 1000); using options: window.scrollto({ top: 100, left: 100, behavior: 'smooth' }); notes window.scroll() is effectively the same as this method.
Window.setCursor() - Web APIs
WebAPIWindowsetCursor
the window.setcursor() method sets the cursor for the current window.
Window.showModalDialog() - Web APIs
this method was removed in chrome 43 and firefox 56.
Window.sizeToContent() - Web APIs
the window.sizetocontent() method sizes the window according to its content.
Window.speechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
Window.stop() - Web APIs
WebAPIWindowstop
because of how scripts are executed, this method cannot interrupt its parent document's loading, but it will stop its images, new windows, and other still-loading objects.
WindowClient.focus() - Web APIs
the focus() method of the windowclient interface gives user input focus to the current client and returns a promise that resolves to the existing windowclient.
WindowClient.navigate() - Web APIs
the navigate() method of the windowclient interface loads a specified url into a controlled client page then returns a promise that resolves to the existing windowclient.
WindowClient - Web APIs
methods windowclient inherits methods from its parent interface, client.
WindowEventHandlers.onbeforeunload - Web APIs
the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue to prompt the user.
WindowEventHandlers.onunload - Web APIs
note: browsers equipped with pop-up blockers will ignore all window.open() method calls in onunload event handler functions.
WindowEventHandlers - Web APIs
methods this interface defines no method.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
the queuemicrotask() method, which is exposed on the window or worker interface, queues a microtask to be executed at a safe time prior to control returning to the browser's event loop.
WindowOrWorkerGlobalScope - Web APIs
methods these methods are defined on the windoworworkerglobalscope mixin, and implemented by window and workerglobalscope.
Worker.onmessage - Web APIs
WebAPIWorkeronmessage
from the dedicatedworkerglobalscope.postmessage method).
Worker.terminate() - Web APIs
WebAPIWorkerterminate
the terminate() method of the worker interface immediately terminates the worker.
WorkerGlobalScope.importScripts() - Web APIs
the importscripts() method of the workerglobalscope interface synchronously imports one or more scripts into the worker's scope.
WorkerGlobalScope: languagechange event - Web APIs
bubbles no cancelable no interface event event handler onlanguagechange examples you can use the languagechange event in an addeventlistener method: worker.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: worker.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html living standardthe definition of 'languagechange' in that specification.
WorkerGlobalScope.performance - Web APIs
not all performance properties and methods are available to web workers.
WorkerLocation - Web APIs
methods the workerlocation interface doesn't inherit any method, but implements methods defined in the urlutilsreadonly interface.
WorkerNavigator.locks - Web APIs
the locks read-only property of the workernavigator interface returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object.
Worklet.addModule() - Web APIs
WebAPIWorkletaddModule
the addmodule() method of the worklet interface loads the module in the given javascript file and adds it to the current worklet.
WritableStream.abort() - Web APIs
the abort() method of the writablestream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
WritableStreamDefaultController - Web APIs
methods writablestreamdefaultcontroller.error() causes any future interactions with the associated stream to error.
WritableStreamDefaultWriter.releaseLock() - Web APIs
the releaselock() method of the writablestreamdefaultwriter interface releases the writer's lock on the corresponding stream.
WritableStreamDefaultWriter.write() - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
XDomainRequest.abort() - Web APIs
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.onerror - Web APIs
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
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.
XDomainRequest.ontimeout - Web APIs
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.send() - Web APIs
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.
init() - Web APIs
warning: this method must not be called from javascript.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
the xmlhttprequest method getallresponseheaders() returns all the response headers, separated by crlf, as a string, or returns null if no response has been received.
XMLHttpRequest.mozBackgroundRequest - Web APIs
note: this method is not available from web content.
XMLHttpRequest.onreadystatechange - Web APIs
examples const xhr = new xmlhttprequest(), method = "get", url = "https://developer.mozilla.org/"; xhr.open(method, url, true); xhr.onreadystatechange = function () { // in local files, status is 0 upon success in mozilla firefox if(xhr.readystate === xmlhttprequest.done) { var status = xhr.status; if (status === 0 || (status >= 200 && status < 400)) { // the request has been completed successfully console.log(xhr.re...
XMLHttpRequest.timeout - Web APIs
using a timeout with an asynchronous request in internet explorer, the timeout property may be set only after calling the open() method and before calling the send() method.
XMLHttpRequest: timeout event - Web APIs
bubbles no cancelable no interface progressevent event handler property ontimeout examples const client = new xmlhttprequest(); client.open('get', 'http://www.example.org/example.txt'); client.ontimeout = () => { console.error('timeout!!') }; client.send(); you could also set up the event handler using the addeventlistener() method: client.addeventlistener('timeout', () => { console.error("timeout!!"); }); specifications specification status comment xmlhttprequestthe definition of 'timeout event' in that specification.
XMLHttpRequestEventTarget.onabort - Web APIs
example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onabort = function () { console.log('** the request was aborted'); }; xmlhttp.send(); //..
XMLHttpRequestEventTarget.onerror - Web APIs
example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onerror = function () { console.log("** an error occurred during the transaction"); }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequestEventTarget.onload - Web APIs
example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onload = function () { // do something with the retrieved data ( found in xmlhttp.response ) }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequestEventTarget.onloadstart - Web APIs
example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onloadstart = function () { console.log("download underway"); }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequestEventTarget.onprogress - Web APIs
xmlhttprequest.onprogress = function (event) { event.loaded; event.total; }; example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onprogress = function () { //do something }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLSerializer.serializeToString() - Web APIs
the xmlserializer method serializetostring() constructs a string representing the specified dom tree in xml form.
XPathEvaluator - Web APIs
methods xpathevaluator.createexpression() creates a parsed xpath expression with resolved namespaces.
XPathExpression - Web APIs
methods xpathexpression.evaluate() evaluates the xpath expression on the given node or document.
XPathNSResolver.lookupNamespaceURI() - Web APIs
the lookupnamespaceuri method looks up the namespace uri associated to the given namespace prefix within an xpath expression evaluated by the xpathevaluator interface.
XPathNSResolver - Web APIs
methods xpathnsresolver.lookupnamespaceuri() looks up the namespace uri associated to the given namespace prefix.
XPathResult - Web APIs
methods xpathresult.iteratenext() if the result is a node set, this method iterates over it and returns the next node from it or null if there are no more nodes.
XRBoundedReferenceSpace.boundsGeometry - Web APIs
theoretically, a more advanced system might use sensors or other detection methods to determine the bounds of a dedicated xr room (notice how we carefully don't call it a holodeck?).
XRFrame.getPose() - Web APIs
WebAPIXRFramegetPose
the xrframe method getpose() returns the relative position and orientation—the pose—of one xrspace to that of another space.
XRInputSource.gripSpace - Web APIs
if a valid pose is returned, a method mydrawmeshusingtransform() is called to draw the controller's mesh transformed using the grip pose's transform matrix.
XRInputSourceEvent.frame - Web APIs
instead, the xrframe specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred.
XRInputSourcesChangeEvent - Web APIs
methods while xrinputsourceschangeevent defines no methods of its own, it inherits methods from its parent interface, event.
XRPermissionDescriptor.mode - Web APIs
the session's environmentblendmode indicates the method to be used to blend the content together.
XRPermissionDescriptor - Web APIs
if the permissions api is found to be available (by checking to see if navigator.permissions is defined), its query() method is called, specifying the permission descriptor we've established, xrpermissiondesc.
XRPermissionStatus.granted - Web APIs
the webxr device api's xrpermissionstatus interface's granted property is an array of strings, each identifying one of the webxr features for which permission has been granted as of the time at which the permission api's navigator.permissions.query() method was called.
XRPermissionStatus - Web APIs
methods no methods are defined by xrpermissionstatus.
XRPose.transform - Web APIs
WebAPIXRPosetransform
this is the same pose that's returned by the frame's getpose() method.
XRReferenceSpace: reset event - Web APIs
first, you can use the addeventlistener() method: viewerrefspace.addeventlistener("reset", (event) => { /* perform reset related tasks */ }); the second option is to set the xrreferencespace object's onreset event handler property: viewerrefspace.onreset = (event) => { /* perform reset related tasks */ }; specifications specification status comment webxr device apithe definition of 'reset event' in that specif...
XRReferenceSpaceEvent - Web APIs
methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event.
XRReferenceSpaceType - Web APIs
this type is used when calling the requestreferencespace() method to obtain a reference space for an xrsession.
XRRenderState - Web APIs
when you apply changes using the xrsession method updaterenderstate(), the specified changes take effect after the current animation frame has completed, but before the next one begins.
XRRenderStateInit - Web APIs
the xrrenderstateinit dictionary is a writeable version of the xrrenderstate interface, and is used when calling an xrsession's updaterenderstate() method to apply changes to the render state prior to rendering the next frame.
XRRigidTransform - Web APIs
it then requests the first animation frame callback by calling the session's requestanimationframe() method.
XRSession.cancelAnimationFrame() - Web APIs
the cancelanimationframe() method of the xrsession interface cancels an animation frame which was previously requested by calling requestanimationframe.
XRSession.end() - Web APIs
WebAPIXRSessionend
the end() method shuts down the xrsession on which it's called, returning a promise which resolves once the session has fully shut down.
XRSession.inputSources - Web APIs
these controllers may include handheld controllers, xr-equipped gloves, optically tracked hands, and gaze-based input methods.
XRSession.renderState - Web APIs
while this property is read only, you can call the xrsession method updaterenderstate() to make changes.
XRSession.requestReferenceSpace() - Web APIs
the requestreferencespace() method of the xrsession interface returns a promise that resolves with an instance of either xrreferencespace or xrboundedreferencespace as appropriate given the type of reference space requested.
XRSessionEvent - Web APIs
methods while xrsessionevent defines no methods, it inherits methods from its parent interface, event.
XRSessionInit - Web APIs
the webxr device api dictionary xrsessioninit specifies required and/or optional features when requesting a new xrsession by calling the navigator.xr.requestsession() method.
XRSessionMode - Web APIs
the session's environmentblendmode indicates the method to be used to blend the content together.
XRSystem: devicechange event - Web APIs
if (navigator.xr) { navigator.xr.addeventlistener("devicechange", event => { navigator.xr.issessionsupported("immersive-vr") .then(immersiveok) => { if (immersiveok) { enablexrbutton.disabled = false; } else { enablexrbutton.disabled = true; } }); }); } when devicechange is received, the handler set up in this code calls the xr method issessionsupported() to find out if there's a device available that can handle immersive vr presentations.
XRView.transform - Web APIs
WebAPIXRViewtransform
the read-only transform property of the xrview interface is an xrrigidtransform object which provides the position and orientation of the viewpoint relative to the xrreferencespace specified when the xrframe.getviewerpose() method was called to obtain the view object.
XRView - Web APIs
WebAPIXRView
usage notes positions and number of xrviews per frame while rendering a scene, the set of views that are used to render the scene for the viewer as of the current frame are obtained by calling the xrframe object's getviewerpose() method to get the xrviewerpose representing (in essence) the position of the viewer's head.
XRViewerPose - Web APIs
the viewer's pose for the animation frame represented by xrframe can be obtained by calling the frame's getviewerpose() method, specifying the reference space in which the origin's position should be computed.
XRViewport - Web APIs
these values may be passed directly into the webglrenderingcontext.viewport() method: let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); example this example sets up an animation frame callback using requestanimationframe().
XRWebGLLayer() - Web APIs
the browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet.
XRWebGLLayer.antialias - Web APIs
when the webxr compositor is enabled, this value corresponds to the value of the antialias property on the object returned by the webgl context's getcontentattributes() method.
XRWebGLLayer.getViewport() - Web APIs
the xrwebgllayer interface's getviewport() method returns the xrviewport that should be used to render the specified xrview into the webgl layer.
XRWebGLLayerInit - Web APIs
the browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet.
XSLT Basic Example - Web APIs
bar</author> </authors> <body>this is my article text.</body> </article> xsl stylesheet (example.xsl) : <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="text"/> <xsl:template match="/"> article - <xsl:value-of select="/article/title"/> authors: <xsl:apply-templates select="/article/authors/author"/> </xsl:template> <xsl:template match="author"> - <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> browser output : article - my article authors: - mr.
msCaching - Web APIs
WebAPImsCaching
this proprietary method is specific to internet explorer and microsoft edge.
msGetPropertyEnabled - Web APIs
this proprietary method is specific to internet explorer browser.
Web APIs
WebAPI
xture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 offlineaudiocompletionevent offlineaudiocontext offscreencanvas orientationsensor oscillatornode overconstrainederror p pagetransitionevent paintworklet pannernode parentnode passwordcredential path2d payererrors paymentaddress paymentcurrencyamount paymentdetailsbase paymentdetailsupdate paymentitem paymentmethodchangeevent paymentrequest paymentrequestevent paymentrequestupdateevent paymentresponse paymentvalidationerrors pbkdf2params performance performanceentry performanceeventtiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancenavigation performancenavigationtiming performanceobserver performanceobserverentrylist performancepainttiming performa...
Using the alert role - Accessibility
dynamic changes that are less urgent should use a less aggressive method, such as aria-live="polite" or other live region roles.
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.
ARIA: listbox role - Accessibility
it is recommended that a checkbox, link or other method be used to select all items, and ctrl+a could be used as a shortcut key for this.
Operable - Accessibility
the conformance criteria under this guideline ensures that users are able to interact with digital technology using different input methods beyond a keyboard or mouse (including touchscreen, voice, device motion, or alternative input devices.
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
this method can often be used to add small touches to the ui and improve user experience.
:defined - CSS: Cascading Style Sheets
WebCSS:defined
with the customelementregistry.define() method).
:dir() - CSS: Cascading Style Sheets
WebCSS:dir
other document types may have different methods.
:visited - CSS: Cascading Style Sheets
WebCSS:visited
although these styles can be change the appearance of colors to the end user, the window.getcomputedstyle method will lie and always return the value of the non-:visited color.
any-hover - CSS: Cascading Style Sheets
WebCSS@mediaany-hover
examples testing whether input methods can hover html <a href="#">try hovering over me!</a> css @media (any-hover: hover) { a:hover { background: yellow; } } result specifications specification status comment media queries level 4the definition of 'any-hover' in that specification.
Coordinate systems - CSS: Cascading Style Sheets
function update(e) { setcoords(e, "offset"); setcoords(e, "client"); setcoords(e, "page"); setcoords(e, "screen"); } inner.addeventlistener("mouseenter", update, false); inner.addeventlistener("mousemove", update, false); inner.addeventlistener("mouseleave", update, false); the event handler is in the update() method.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
there's no magic resetanimation() method on elements, and you can't even just set the element's animation-play-state to "running" again.
Basic Concepts of Multicol - CSS: Cascading Style Sheets
key concepts and terminology multicol is unlike any of the other layout methods we have in css in that it fragments the content, including all descendent elements, into columns.
Styling Columns - CSS: Cascading Style Sheets
in other layout methods the initial value for column-gap is 0.
CSS Display - CSS: Cascading Style Sheets
ine layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layout methods backwards compatibility of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and progressive e...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
justify-content align-content align-items align-self place-content place-items row-gap column-gap gap glossary entries flexbox flex container flex item main axis cross axis flex guides basic concepts of flexbox an overview of the features of flexbox relationship of flexbox to other layout methods how flexbox relates to other layout methods, and other css specifications aligning items in a flex container how the box alignment properties work with flexbox.
Block and inline layout in normal flow - CSS: Cascading Style Sheets
this concept of the outer and inner display type is important as this tells us that a container using a layout method such as flexbox (display: flex) and grid layout (display: grid) is still participating in block and inline layout, due to the outer display type of those methods being block.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
the other two are grid items enclosed in a div, they might be auto-placed or you could place these with a positioning method onto your grid.
Layout using named grid lines - CSS: Cascading Style Sheets
try building some common patterns with these various methods, and you will soon find your most productive way to work.
Subgrid - CSS: Cascading Style Sheets
as with any nested grid however, the size of content in the subgrid can change the track sizing, assuming a track sizing method is used that allows content to affect the size.
CSS Grid Layout - CSS: Cascading Style Sheets
rid-column-start grid-row-end grid-column-end grid-row grid-column grid-area row-gap column-gap gap css functions repeat() minmax() fit-content() css data types <flex> glossary entries grid grid lines grid tracks grid cell grid area gutters grid axis grid row grid column guides basic concepts of grid layout relationship of grid layout to other layout methods layout using line-based placement grid template areas layout using named grid lines auto-placement in css grid layout box alignment in css grid layout css grid, logical values and writing modes css grid layout and accessibility css grid and progressive enhancement realising common layouts using css grid subgrid external resources css grid and ie11 (polyfill) examples from jen si...
Using CSS gradients - CSS: Cascading Style Sheets
in both examples, the gradient is written twice: the first is the css images level 3 method of repeating the color for each stop and the second example is the css images level 4 multiple color stop method of including two color-stop-lengths in a linear-color-stop declaration.
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
as we saw above, newer css layout methods such as flexbox and grid layout use the concepts of block and inline rather than right and left/top and bottom when aligning items.
CSS selectors - CSS: Cascading Style Sheets
grouping selectors selector list the , is a grouping method, it selects all the matching nodes.
Overview of CSS Shapes - CSS: Cascading Style Sheets
this allows the overlay of wrapped content around an image, or the use of an image which is never displayed on the page purely as a method of creating a complex shape without needing to carefully map a polygon.
Using CSS transitions - CSS: Cascading Style Sheets
as usual, you can use the addeventlistener() method to monitor for this event: el.addeventlistener("transitionend", updatetransition, true); you detect the beginning of a transition using transitionrun (fires before any delay) and transitionstart (fires after any delay), in the same kind of fashion: el.addeventlistener("transitionrun", signalstart, true); el.addeventlistener("transitionstart", signalstart, true); note: the transitionend event...
Column layouts - CSS: Cascading Style Sheets
the recipes you need to choose different layout methods in order to achieve your requirements.
Grid wrapper - CSS: Cascading Style Sheets
useful fallbacks or alternative methods when using this recipe at page level it can be useful to set a max-width along with left and right auto margins to center the content horizontally: .grid { max-width: 1200px; margin: 0 auto; // horizontally centers the container } /* remove the max-width and margins if the browser supports grid */ @supports (display: grid) { .grid { display: grid; /* other grid code goes here */...
Pagination - CSS: Cascading Style Sheets
alternative methods once the column-gap property has implementation in browsers this could be used instead of margins to space out the items.
Sticky footers - CSS: Cascading Style Sheets
alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer.
CSS Layout cookbook - CSS: Cascading Style Sheets
the recipes recipe description layout methods media objects a two-column box with an image on one side and descriptive text on the other, e.g.
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
also, this method of switching animation off according to the user's preference can also benefit users with low battery or low-end phones or computers.
Using media queries - CSS: Cascading Style Sheets
to test and monitor media states using the window.matchmedia() and mediaquerylist.addlistener() javascript methods.
Media queries - CSS: Cascading Style Sheets
media queries in javascript in javascript, you can use the window.matchmedia() method to test the window against a media query.
Privacy and the :visited selector - CSS: Cascading Style Sheets
little white lies to preserve users' privacy, firefox and other browsers will lie to web applications under certain circumstances: the window.getcomputedstyle method, and similar functions such as element.queryselector, will always return values indicating that a user has never visited any of the links on a page.
background - CSS: Cascading Style Sheets
the background shorthand css property sets all background style properties at once, such as color, image, origin and size, or repeat method.
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
initially a part of multi-column layout, the definition of column-gap has been broadened to include multiple layout methods.
element() - CSS: Cascading Style Sheets
WebCSSelement
on gecko browsers, you can use the non-standard document.mozsetimageelement() method to change the element being used as the background for a given css background element.
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
choose the appropriate method based on the needs for the particular web page.
font-variant-position - CSS: Cascading Style Sheets
ant-position: normal; font-variant-position: sub; font-variant-position: super; /* global values */ font-variant-position: inherit; font-variant-position: initial; font-variant-position: unset; when the usage of these alternate glyphs is activated, if one character in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs.
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
the image-set() css function notation is a method of letting the browser pick the most appropriate css image from a given set, primarily for high pixel density screens.
resize - CSS: Cascading Style Sheets
WebCSSresize
values none the element offers no user-controllable method for resizing it.
shape-outside - CSS: Cascading Style Sheets
note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification for all urls in a shape-outside value.
will-change - CSS: Cascading Style Sheets
this property is intended as a method for authors to let the user-agent know about properties that are likely to change ahead of time.
Live streaming web audio and video - Developer guides
it can also be used instead of the traditional progressive download method for audio and video on demand: there are several advantages to this: latency is generally lower so media will start playing more quickly adaptive streaming makes for better experiences on a variety of devices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while static media is usually served over http, there are several protocols for servi...
Setting up adaptive streaming media sources - Developer guides
note: if you use webm you can use the methods shown in this tutorial dash adaptive streaming for html 5 video.
Mouse gesture events - Developer guides
if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventdefault() method.
Overview of events and handlers - Developer guides
browsers use as the registration method for the function which will handle those data structures a method called addeventlistener which expects as arguments a string event type name and the handler function.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
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.
HTML5 - Developer guides
WebGuideHTMLHTML5
web-based protocol handlers you can now register web applications as protocol handlers using the navigator.registerprotocolhandler() method.
Introduction to Web development - Developer guides
eloquent javascript — a comprehensive guide to intermediate and advanced javascript methodologies intermediate a re-introduction to javascript — a recap on the javascript programming language aimed at intermediate-level developers essential javascript design patterns — an introduction to essential javascript design patterns introduction to object-oriented javascript — learn about the javascript object model.
Parsing and serializing XML - Developer guides
serializing an xml document given a document, you can serialize the document's dom tree back into xml using the xmlserializer.serializetostring() method.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
hsl functional notation designers and artists often prefer to work using the hsl (hue/saturation/luminosity) color method.
<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.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
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
methods select(), stepdown(), stepup() value a domstring representing the date entered in the input.
<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 automatically validated as conforming to e-mail syntax.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
supported common attributes autocomplete idl attributes value methods none.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
idl attributes value methods select(), stepdown(), stepup().
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
events change and input supported common attributes autocomplete, list, placeholder, readonly idl attributes list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty.
<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="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
idl attributes value methods select(), setrangetext(), setselectionrange().
<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
events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value methods select(), setrangetext() and setselectionrange().
<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().
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input.
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmarquee
methods start() starts scrolling of the marquee.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
alternate separation methods, such as first-line indentation, can be achieved with css: html <p>separating paragraphs with blank lines is easiest for readers to scan, but they can also be separated by indenting their first lines.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
possible values are: off: the user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.
accesskey - HTML: Hypertext Markup Language
if the system lacks a method of notifying the user about this feature, the user might accidentally activate accesskeys.
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.
tabindex - HTML: Hypertext Markup Language
the user won't be able to focus any element with a negative tabindex using the keyboard, but a script can do so by calling the focus() method.
title - HTML: Hypertext Markup Language
if a tooltip effect is desired, it is better to use a more accessible technique that can be accessed with the above browsing methods.
Global attributes - HTML: Hypertext Markup Language
classes allows css and javascript to select and access specific elements via the class selectors or functions like the method document.getelementsbyclassname().
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname.
Link types - HTML: Hypertext Markup Language
note: the link prefetch faq has details on which links can be prefetched and on alternative methods.
Using the application cache - HTML: Hypertext Markup Language
there is a corresponding updateready event, which is fired instead of the cached event when a new update has been downloaded but not yet activated using the swapcache() method.
HTTP authentication - HTTP
www-authenticate and proxy-authenticate headers the www-authenticate and proxy-authenticate response headers define the authentication method that should be used to gain access to a resource.
Data URLs - HTTP
encoding in javascript the web apis have native methods to encode or decode to base64: base64 encoding and decoding.
Basics of HTTP - HTTP
on top of these basic concepts, numerous extensions have been developed over the years that add updated functionality and semantics with new http methods or headers.
CORS errors - HTTP
WebHTTPCORSErrors
reason: cors header ‘origin’ cannot be added reason: cors request external redirect not allowed reason: cors request not http reason: cors header ‘access-control-allow-origin’ missing reason: cors header ‘access-control-allow-origin’ does not match ‘xyz’ reason: credential is not supported if the cors header ‘access-control-allow-origin’ is ‘*’ reason: did not find method in cors header ‘access-control-allow-methods’ reason: expected ‘true’ in cors header ‘access-control-allow-credentials’ reason: cors preflight channel did not succeed reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ reason: invalid token ‘xyz’ in cors header ‘access-control-allow-headers’ reason: missing token ‘xyz’ in cors header ‘a...
Connection management in HTTP/1.x - HTTP
not all types of http requests can be pipelined: only idempotent methods, that is get, head, put and delete, can be replayed safely: should a failure happen, the pipeline content can simply be repeated.
Content negotiation - HTTP
besides falling back to the server-driven negotiation, this method is almost always used in conjunction with scripting, especially with javascript redirection: after having checked for the negotiation criteria, the script performs the redirection.
Using HTTP cookies - HTTP
WebHTTPCookies
see session fixation for primary mitigation methods.
Cross-Origin Resource Policy (CORP) - HTTP
the policy is only effective for no-cors requests, which are issued by default for cors-safelisted methods/headers.
Accept-Patch - HTTP
accept-patch in response to any method means that patch is allowed on the resource identified by the request-uri.
Access-Control-Max-Age - HTTP
the access-control-max-age response header indicates how long the results of a preflight request (that is the information contained in the access-control-allow-methods and access-control-allow-headers headers) can be cached.
Authorization - HTTP
this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding).
Content-Encoding - HTTP
content-encoding: gzip note that the server is not obligated to use any compression method.
Content-Location - HTTP
<form action="/send-payment" method="post"> <p> <label>who do you want to send the money to?
Content-Type - HTTP
<form action="/" method="post" enctype="multipart/form-data"> <input type="text" name="description" value="some text"> <input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: multipart/form-data; boundary=---------------------------97476729985249892953...
ETag - HTTP
WebHTTPHeadersETag
the method by which etag values are generated is not specified.
Feature-Policy: vibrate - HTTP
the http feature-policy header vibrate directive controls whether the current document is allowed to trigger device vibrations via navigator.vibrate() method of vibration api.
Feature-Policy - HTTP
display-capture controls whether or not the current document is permitted to use the getdisplaymedia() method to capture screen contents.
Location - HTTP
WebHTTPHeadersLocation
in cases of redirection, the http method used to make the new request to fetch the page pointed to by location depends of the original method and of the kind of redirection: if 303 (see also) responses always lead to the use of a get method, 307 (temporary redirect) and 308 (permanent redirect) don't change the method used in the original request; 301 (permanent redirect) and 302 (found) doesn't change the method most of the time, though older user-agents may (so you basically don't know).
Origin - HTTP
WebHTTPHeadersOrigin
note: the origin header is not set on fetch requests with a method of head or get (this behavior was corrected in firefox 65 — see bug 1508661).
Proxy-Authenticate - HTTP
the http proxy-authenticate response header defines the authentication method that should be used to gain access to a resource behind a proxy server.
Proxy-Authorization - HTTP
this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding).
WWW-Authenticate - HTTP
the http www-authenticate response header defines the authentication method that should be used to gain access to a resource.
GET - HTTP
WebHTTPMethodsGET
the http get method requests a representation of the specified resource.
PUT - HTTP
WebHTTPMethodsPUT
the http put request method creates a new resource or replaces a representation of the target resource with the request payload.
TRACE - HTTP
WebHTTPMethodsTRACE
the http trace method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism.
Protocol upgrade mechanism - HTTP
in essence, then, this key simply confirms that "yes, i really mean to open a websocket connection." this header is automatically added by clients that choose to use it; it cannot be added using the xmlhttprequest.setrequestheader() method.
200 OK - HTTP
WebHTTPStatus200
the meaning of a success depends on the http request method: get: the resource has been fetched and is transmitted in the message body.
303 See Other - HTTP
WebHTTPStatus303
the method used to display this redirected page is always get.
304 Not Modified - HTTP
WebHTTPStatus304
this happens when the request method is safe, like a get or a head request, or when the request is conditional and uses a if-none-match or a if-modified-since header.
308 Permanent Redirect - HTTP
WebHTTPStatus308
the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method.
412 Precondition Failed - HTTP
WebHTTPStatus412
this happens with conditional requests on methods other than get or head when the condition defined by the if-unmodified-since or if-none-match headers is not fulfilled.
507 Insufficient Storage - HTTP
WebHTTPStatus507
it indicates that a method could not be performed because the server cannot store the representation needed to successfully complete the request.
CSS Houdini
houdini's css typed om is a css object model with types and methods, exposing values as javascript objects making for more intuitive css manipulation than previous string based htmlelement.style manipulations.
About JavaScript - JavaScript
objects are created programmatically in javascript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class definitions common in compiled languages like c++ and java.
JavaScript data types and data structures - JavaScript
additionally, arrays inherit from array.prototype, which provides to them a handful of convenient methods to manipulate arrays.
Loops and iteration - JavaScript
therefore, it is better to use a traditional for loop with a numeric index when iterating over arrays, because the for...in statement iterates over user-defined properties in addition to the array elements, if you modify the array object (such as adding custom properties or methods).
JavaScript modules - JavaScript
creating a module object the above method works ok, but it's a little messy and longwinded.
Assertions - JavaScript
for selecting appropriate fruits we can use the filter method with an arrow function.
Using Promises - JavaScript
de—or just to avoid having them cluttering up your output—by adding a handler for the unhandledrejection event, like this: window.addeventlistener("unhandledrejection", event => { /* you might start here by adding code to examine the promise specified by event.promise and the reason in event.reason */ event.preventdefault(); }, false); by calling the event's preventdefault() method, you tell the javascript runtime not to do its default action when rejected promises go unhandled.
JavaScript Guide - JavaScript
rator numbers and dates number literals number object math object date object text formatting string literals string object template literals internationalization regular expressions indexed collections arrays typed arrays keyed collections map weakmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators iterables generators meta programming proxy handlers and traps revocable proxy reflect javascript modules exporting importi...
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.
About the JavaScript reference - JavaScript
structure of the reference in the javascript reference you can find the following chapters: standard built-in objects this chapter documents all the javascript standard built-in objects, along with their methods and properties.
The legacy Iterator protocol - JavaScript
an object is an legacy iterator when it implements a next() method with the following semantics, and throws stopiteration at the end of iteration.
TypeError: can't access property "x" of "y" - JavaScript
examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // typeerror: x is undefined, can't access property "substring" of it var foo = null; foo.substring(1); // typeerror: x is null, can't access property "substring" of it fixing the issue to fix null pointer to undefined or null values, you can use the typeof operator, for example.
TypeError: can't access dead object - JavaScript
examples checking if an object is dead components.utils offers a isdeadwrapper() method, which privileged code might use.
TypeError: More arguments needed - JavaScript
examples required arguments not provided the object.create() method requires at least one argument and the object.setprototypeof() method requires at least two arguments: var obj = object.create(); // typeerror: object.create requires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // typeerror: object.setprototypeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for ex...
TypeError: "x" is not a non-null object - JavaScript
examples property descriptor expected when methods like object.create() or object.defineproperty() and object.defineproperties() are used, the optional descriptor parameter expects a property descriptor object.
ReferenceError: "x" is not defined - JavaScript
it needs to be some string, so that the string.prototype.substring() method will work.
ReferenceError: reference to undefined property "x" - JavaScript
var foo = {}; foo.bar; // referenceerror: reference to undefined property "bar" valid cases to avoid the error, you need to either add a definition for bar to the object or check for the existence of the bar property before trying to access it; one way to do that is to use the object.prototype.hasownproperty() method), like this: var foo = {}; // define the bar property foo.bar = 'moon'; console.log(foo.bar); // "moon" // test to be sure bar exists before accessing it if (foo.hasownproperty('bar')) { console.log(foo.bar); } ...
SyntaxError: function statement requires a name - JavaScript
this doesn't work: function greeter() { german: function () { return "moin"; } } // syntaxerror: function statement requires a name this would work, for example: function greeter() { german: function g() { return "moin"; } } object methods if you intended to create a method of an object, you will need to create an object.
setter - JavaScript
ns the setter, which assigns 10 / 2 (5) to the 'a' property console.log(o.a) // 5 using a computed property name const expr = 'foo'; const obj = { baz: 'bar', set [expr](v) { this.baz = v; } }; console.log(obj.baz); // "bar" obj.foo = 'baz'; // run the setter console.log(obj.baz); // "baz" specifications specification ecmascript (ecma-262)the definition of 'method definitions' in that specification.
get Array[@@species] - JavaScript
however, you might want to overwrite this, in order to return parent array objects in your derived class methods: class myarray extends array { // overwrite myarray species to the parent array constructor static get [symbol.species]() { return array; } } specifications specification ecmascript (ecma-262)the definition of 'get array [ @@species ]' in that specification.
Array.prototype.reduceRight() - JavaScript
the reduceright() method applies a function against an accumulator and each value of the array (from right-to-left) to reduce it to a single value.
Array.prototype.entries() - JavaScript
the entries() method returns a new array iterator object that contains the key/value pairs for each index in the array.
Array.isArray() - JavaScript
the array.isarray() method determines whether the passed value is an array.
Array.prototype.join() - JavaScript
the join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string.
Array.prototype.keys() - JavaScript
the keys() method returns a new array iterator object that contains the keys for each index in the array.
Array.of() - JavaScript
the array.of() method creates a new array instance from a variable number of arguments, regardless of number or type of the arguments.
Array.prototype.values() - JavaScript
the values() method returns a new array iterator object that contains the values for each index in the array.
get ArrayBuffer[@@species] - JavaScript
however, you might want to overwrite this, in order to return parent arraybuffer objects in your derived class methods: class myarraybuffer extends arraybuffer { // overwrite myarraybuffer species to the parent arraybuffer constructor static get [symbol.species]() { return arraybuffer; } } specifications specification ecmascript (ecma-262)the definition of 'get arraybuffer [ @@species ]' in that specification.
ArrayBuffer.isView() - JavaScript
the arraybuffer.isview() method determines whether the passed value is one of the arraybuffer views, such as typed array objects or a dataview.
Atomics.add() - JavaScript
the static atomics.add() method adds a given value at a given position in the array and returns the old value at that position.
Atomics.and() - JavaScript
the static atomics.and() method computes a bitwise and with a given value at a given position in the array, and returns the old value at that position.
Atomics.compareExchange() - JavaScript
the static atomics.compareexchange() method exchanges a given replacement value at a given position in the array, if a given expected value equals the old value.
Atomics.exchange() - JavaScript
the static atomics.exchange() method stores a given value at a given position in the array and returns the old value at that position.
Atomics.isLockFree() - JavaScript
the static atomics.islockfree() method is used to determine whether to use locks or atomic operations.
Atomics.load() - JavaScript
the static atomics.load() method returns a value at a given position in the array.
Atomics.notify() - JavaScript
the static atomics.notify() method notifies up some agents that are sleeping in the wait queue.
Atomics.or() - JavaScript
the static atomics.or() method computes a bitwise or with a given value at a given position in the array, and returns the old value at that position.
Atomics.store() - JavaScript
the static atomics.store() method stores a given value at the given position in the array and returns that value.
Atomics.sub() - JavaScript
the static atomics.sub() method substracts a given value at a given position in the array and returns the old value at that position.
Atomics.wait() - JavaScript
the static atomics.wait() method verifies that a given position in an int32array still contains a given value and if so sleeps, awaiting a wakeup or a timeout.
Atomics.xor() - JavaScript
the static atomics.xor() method computes a bitwise xor with a given value at a given position in the array, and returns the old value at that position.
BigInt.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string with a language-sensitive representation of this bigint.
BigInt.prototype.valueOf() - JavaScript
the valueof() method returns the wrapped primitive value of a bigint object.
Boolean.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
DataView - JavaScript
instance methods dataview.prototype.getint8() gets a signed 8-bit integer (byte) at the specified byte offset from the start of the view.
Date() constructor - JavaScript
timestamp string datestring a string value representing a date, specified in a format recognized by the date.parse() method.
Date.prototype.getDate() - JavaScript
the getdate() method returns the day of the month for the specified date according to local time.
Date.prototype.getHours() - JavaScript
the gethours() method returns the hour for the specified date, according to local time.
Date.prototype.getMilliseconds() - JavaScript
the getmilliseconds() method returns the milliseconds in the specified date according to local time.
Date.prototype.getMinutes() - JavaScript
the getminutes() method returns the minutes in the specified date according to local time.
Date.prototype.getSeconds() - JavaScript
the getseconds() method returns the seconds in the specified date according to local time.
Date.prototype.getTimezoneOffset() - JavaScript
the gettimezoneoffset() method returns the time zone difference, in minutes, from current locale (host system settings) to utc.
Date.prototype.getUTCDate() - JavaScript
the getutcdate() method returns the day (date) of the month in the specified date according to universal time.
Date.prototype.getUTCDay() - JavaScript
the getutcday() method returns the day of the week in the specified date according to universal time, where 0 represents sunday.
Date.prototype.getUTCFullYear() - JavaScript
the getutcfullyear() method returns the year in the specified date according to universal time.
Date.prototype.getUTCHours() - JavaScript
the getutchours() method returns the hours in the specified date according to universal time.
Date.prototype.getUTCMinutes() - JavaScript
the getutcminutes() method returns the minutes in the specified date according to universal time.
Date.prototype.getUTCSeconds() - JavaScript
the getutcseconds() method returns the seconds in the specified date according to universal time.
Date.prototype.setDate() - JavaScript
the setdate() method sets the day of the date object relative to the beginning of the currently set month.
Date.prototype.setMilliseconds() - JavaScript
the setmilliseconds() method sets the milliseconds for a specified date according to local time.
Date.prototype.setUTCDate() - JavaScript
the setutcdate() method sets the day of the month for a specified date according to universal time.
Date.prototype.setUTCMilliseconds() - JavaScript
the setutcmilliseconds() method sets the milliseconds for a specified date according to universal time.
Date.prototype.toLocaleDateString() - JavaScript
the tolocaledatestring() method returns a string with a language sensitive representation of the date portion of this date.
Date.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string with a language sensitive representation of this date.
Date.prototype.toLocaleTimeString() - JavaScript
the tolocaletimestring() method returns a string with a language sensitive representation of the time portion of this date.
Date.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
Date.prototype.toUTCString() - JavaScript
the toutcstring() method converts a date to a string, using the utc time zone.
Error.prototype.message - JavaScript
the message property combined with the name property is used by the error.prototype.tostring() method to create a string representation of the error.
Error.prototype.name - JavaScript
the name property, in addition to the message property, is used by the error.prototype.tostring() method to create a string representation of the error.
Generator - JavaScript
instead, a generator instance can be returned from a generator function: function* generator() { yield 1; yield 2; yield 3; } const gen = generator(); // "generator { }" instance methods generator.prototype.next() returns a value yielded by the yield expression.
Intl.Collator.prototype.compare() - JavaScript
the intl.collator.prototype.compare() method compares two strings according to the sort order of this collator object.
Intl.Collator.supportedLocalesOf() - JavaScript
the intl.collator.supportedlocalesof() method returns an array containing those of the provided locales that are supported in collation without having to fall back to the runtime's default locale.
Intl.DateTimeFormat.prototype.format() - JavaScript
the intl.datetimeformat.prototype.format() method formats a date according to the locale and formatting options of this intl.datetimeformat object.
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
syntax intl.datetimeformat.prototype.formatrange(startdate, enddate) examples basic formatrange usage this method receives two dates and formats the date range in the most concise way based on the locale and options provided when instantiating intl.datetimeformat.
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
the intl.datetimeformat.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale.
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
the intl.displaynames.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current displaynames object.
Intl.DisplayNames.supportedLocalesOf() - JavaScript
the intl.displaynames.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale.
Intl​.List​Format​.prototype​.formatToParts() - JavaScript
the intl.listformat.prototype.formattoparts() method returns an array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
Intl​.List​Format​.prototype​.resolvedOptions() - JavaScript
the intl.listformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current listformat object.
Intl.ListFormat.supportedLocalesOf() - JavaScript
the intl.listformat.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale.
Intl.Locale - JavaScript
instance methods intl.locale.prototype.maximize() gets the most likely values for the language, script, and region of the locale based on existing values.
Intl.NumberFormat.prototype.format() - JavaScript
the intl.numberformat.prototype.format() method formats a number according to the locale and formatting options of this numberformat object.
Intl.NumberFormat.supportedLocalesOf() - JavaScript
the intl.numberformat.supportedlocalesof() method returns an array containing those of the provided locales that are supported in number formatting without having to fall back to the runtime's default locale.
Intl.PluralRules.select() - JavaScript
the intl.pluralrules.prototype.select method returns a string indicating which plural rule to use for locale-aware formatting.
Intl.PluralRules.supportedLocalesOf() - JavaScript
the intl.pluralrules.supportedlocalesof() method returns an array containing those of the provided locales that are supported in plural formatting without having to fall back to the runtime's default locale.
Intl.RelativeTimeFormat.prototype.format() - JavaScript
the intl.relativetimeformat.prototype.format() method formats a value and unit according to the locale and formatting options of this relativetimeformat object.
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
the intl.relativetimeformat.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale.
Intl.getCanonicalLocales() - JavaScript
the intl.getcanonicallocales() method returns an array containing the canonical locale names.
Map.prototype[@@iterator]() - JavaScript
the initial value of the @@iterator property is the same function object as the initial value of the entries method.
get Map[@@species] - JavaScript
however, you might want to overwrite this, in order to return parent map objects in your derived class methods: class mymap extends map { // overwrite mymap species to the parent map constructor static get [symbol.species]() { return map; } } specifications specification ecmascript (ecma-262)the definition of 'get map [ @@species ]' in that specification.
Map.prototype.clear() - JavaScript
the clear() method removes all elements from a map object.
Map.prototype.delete() - JavaScript
the delete() method removes the specified element from a map object by key.
Map.prototype.entries() - JavaScript
the entries() method returns a new iterator object that contains the [key, value] pairs for each element in the map object in insertion order.
Map.prototype.get() - JavaScript
the get() method returns a specified element from a map object.
Map.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified key exists or not.
Map.prototype.keys() - JavaScript
the keys() method returns a new iterator object that contains the keys for each element in the map object in insertion order.
Map.prototype.values() - JavaScript
the values() method returns a new iterator object that contains the values for each element in the map object in insertion order.
Math.abs() - JavaScript
description because abs() is a static method of math, you always use it as math.abs(), rather than as a method of a math object you created (math is not a constructor).
Math.acosh() - JavaScript
description because acosh() is a static method of math, you always use it as math.acosh(), rather than as a method of a math object you created (math is no constructor).
Math.asinh() - JavaScript
description because asinh() is a static method of math, you always use it as math.asinh(), rather than as a method of a math object you created (math is not a constructor).
Math.atanh() - JavaScript
description because atanh() is a static method of math, you always use it as math.atanh(), rather than as a method of a math object you created (math is not a constructor).
Math.cbrt() - JavaScript
description because cbrt() is a static method of math, you always use it as math.cbrt(), rather than as a method of a math object you created (math is not a constructor).
Math.ceil() - JavaScript
description because ceil() is a static method of math, you always use it as math.ceil(), rather than as a method of a math object you created (math is not a constructor).
Math.cosh() - JavaScript
description because cosh() is a static method of math, you always use it as math.cosh(), rather than as a method of a math object you created (math is not a constructor).
Math.exp() - JavaScript
description because exp() is a static method of math, you always use it as math.exp(), rather than as a method of a math object you created (math is not a constructor).
Math.expm1() - JavaScript
description because expm1() is a static method of math, you always use it as math.expm1(), rather than as a method of a math object you created (math is not a constructor).
Math.floor() - JavaScript
description because floor() is a static method of math, you always use it as math.floor(), rather than as a method of a math object you created (math is not a constructor).
Math.fround() - JavaScript
because fround() is a static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor).
Math.hypot() - JavaScript
because hypot() is a static method of math, you always use it as math.hypot(), rather than as a method of a math object you created (math is not a constructor).
Math.imul() - JavaScript
because imul() is a static method of math, you always use it as math.imul(), rather than as a method of a math object you created (math is not a constructor).
Math.log() - JavaScript
because log() is a static method of math, you always use it as math.log(), rather than as a method of a math object you created (math is not a constructor).
Math.log10() - JavaScript
because log10() is a static method of math, you always use it as math.log10(), rather than as a method of a math object you created (math is not a constructor).
Math.log1p() - JavaScript
because log1p() is a static method of math, you always use it as math.log1p(), rather than as a method of a math object you created (math is not a constructor).
Math.log2() - JavaScript
because log2() is a static method of math, you always use it as math.log2(), rather than as a method of a math object you created (math is not a constructor).
Math.max() - JavaScript
description because math is not a constructor, max() is a static method of math (you always use it as math.max(), rather than as a method of an instanced math object).
Math.min() - JavaScript
description because min() is a static method of math, you always use it as math.min(), rather than as a method of a math object you created (math is not a constructor).
Math.pow() - JavaScript
because pow() is a static method of math, you always use it as math.pow(), rather than as a method of a math object you created (math has no constructor).
Math.random() - JavaScript
use the web crypto api instead, and more precisely the window.crypto.getrandomvalues() method.
Math.random() - JavaScript
use the web crypto api instead, and more precisely the window.crypto.getrandomvalues() method.
Math.round() - JavaScript
because round() is a static method of math, you always use it as math.round(), rather than as a method of a math object you created (math has no constructor).
Math.sign() - JavaScript
description because sign() is a static method of math, you always use it as math.sign(), rather than as a method of a math object you created (math is not a constructor).
Math.sinh() - JavaScript
description because sinh() is a static method of math, you always use it as math.sinh(), rather than as a method of a math object you created (math is not a constructor).
Math.sqrt() - JavaScript
because sqrt() is a static method of math, you always use it as math.sqrt(), rather than as a method of a math object you created (math is not a constructor).
Math.tanh() - JavaScript
description because tanh() is a static method of math, you always use it as math.tanh(), rather than as a method of a math object you created (math is not a constructor).
NaN - JavaScript
true valueisnan(number.nan); // true however, do note the difference between isnan() and number.isnan(): the former will return true if the value is currently nan, or if it is going to be nan after it is coerced to a number, while the latter will return true only if the value is currently nan: isnan('hello world'); // true number.isnan('hello world'); // false additionally, some array methods cannot find nan, while others can.
Number.isNaN() - JavaScript
the number.isnan() method determines whether the passed value is nan and its type is number.
Number.isSafeInteger() - JavaScript
the number.issafeinteger() method determines whether the provided value is a number that is a safe integer.
Number.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string with a language-sensitive representation of this number.
Object.prototype.__lookupGetter__() - JavaScript
the __lookupgetter__ method returns the function bound as a getter to the specified property.
Object.prototype.__lookupSetter__() - JavaScript
the __lookupsetter__ method returns the function bound as a setter to the specified property.
Object.defineProperties() - JavaScript
the object.defineproperties() method defines new or modifies existing properties directly on an object, returning the object.
Object.entries() - JavaScript
the object.entries() method returns an array of a given object's own enumerable string-keyed property [key, value] pairs, in the same order as that provided by a for...in loop.
Object.getOwnPropertySymbols() - JavaScript
the object.getownpropertysymbols() method returns an array of all symbol properties found directly upon a given object.
Object.getPrototypeOf() - JavaScript
the object.getprototypeof() method returns the prototype (i.e.
Object.is() - JavaScript
the object.is() method determines whether two values are the same value.
Object.isFrozen() - JavaScript
object.issealed(frozen); // === true non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror.
Object.values() - JavaScript
the object.values() method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop.
Promise.allSettled() - JavaScript
the promise.allsettled() method returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.
Promise.race() - JavaScript
the promise.race() method returns a promise that fulfills or rejects as soon as one of the promises in an iterable fulfills or rejects, with the value or reason from that promise.
Proxy.revocable() - JavaScript
the proxy.revocable() method is used to create a revocable proxy object.
Proxy - JavaScript
static methods proxy.revocable() creates a revocable proxy object.
RangeError - JavaScript
this can be encountered when: passing a value that is not one of the allowed string values to string.prototype.normalize(), or when attempting to create an array of an illegal length with the array constructor, or when passing bad values to the numeric methods number.prototype.toexponential(), number.prototype.tofixed() or number.prototype.toprecision().
Reflect.construct() - JavaScript
the static reflect.construct() method acts like the new operator, but as a function.
get RegExp[@@species] - JavaScript
however, you might want to overwrite this, in order to return parent regexp objects in your derived class methods: class myregexp extends regexp { // overwrite myregexp species to the parent regexp constructor static get [symbol.species]() { return regexp; } } specifications specification ecmascript (ecma-262)the definition of 'get regexp [ @@species ]' in that specification.
get Set[@@species] - JavaScript
however, you might want to overwrite this, in order to return parent set objects in your derived class methods: class myset extends set { // overwrite myset species to the parent set constructor static get [symbol.species]() { return set; } } specifications specification ecmascript (ecma-262)the definition of 'get set [ @@species ]' in that specification.
Set.prototype.entries() - JavaScript
the entries() method returns a new iterator object that contains an array of [value, value] for each element in the set object, in insertion order.
Planned changes to shared memory - JavaScript
just as sharedarraybuffer and its methods are unconditionally enabled (and only sharing between threads is gated on the new headers), the webassembly atomic instructions are also unconditionally allowed.
SharedArrayBuffer - JavaScript
instance methods sharedarraybuffer.prototype.slice(begin, end) returns a new sharedarraybuffer whose contents are a copy of this sharedarraybuffer's bytes from begin, inclusive, up to end, exclusive.
String.prototype[@@iterator]() - JavaScript
the [@@iterator]() method returns a new iterator object that iterates over the code points of a string value, returning each code point as a string value.
String.prototype.charAt() - JavaScript
the string object's charat() method returns a new string consisting of the single utf-16 code unit located at the specified offset into the string.
String.prototype.codePointAt() - JavaScript
the codepointat() method returns a non-negative integer that is the unicode code point value.
String.prototype.localeCompare() - JavaScript
the localecompare() method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order.
String.prototype.matchAll() - JavaScript
the matchall() method returns an iterator of all results matching a string against a regular expression, including capturing groups.
String.prototype.padEnd() - JavaScript
the padend() method pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length.
String.prototype.padStart() - JavaScript
the padstart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length.
String.raw() - JavaScript
the static string.raw() method is a tag function of template literals.
String.prototype.slice() - JavaScript
the slice() method extracts a section of a string and returns it as a new string, without modifying the original string.
Symbol.asyncIterator - JavaScript
description the symbol.asynciterator symbol is a builtin symbol that is used to access an object's @@asynciterator method.
Symbol.for() - JavaScript
the symbol.for(key) method searches for existing symbols in a runtime-wide symbol registry with the given key and returns it if found.
Symbol.isConcatSpreadable - JavaScript
the symbol.isconcatspreadable well-known symbol is used to configure if an object should be flattened to its array elements when using the array.prototype.concat() method.
Symbol.keyFor() - JavaScript
the symbol.keyfor(sym) method retrieves a shared symbol key from the global symbol registry for the given symbol.
Symbol.species - JavaScript
for example, when using methods such as map() that return the default constructor, you want these methods to return a parent array object, instead of the myarray object.
Symbol.toStringTag - JavaScript
it is accessed internally by the object.prototype.tostring() method.
get TypedArray[@@species] - JavaScript
however, you might want to overwrite this, in order to return a parent typed array object in your derived class methods: class mytypedarray extends uint8array { // overwrite mytypedarray species to the parent uint8array constructor static get [symbol.species]() { return uint8array; } } specifications specification ecmascript (ecma-262)the definition of 'get %typedarray% [ @@species ]' in that specification.
TypedArray.prototype.entries() - JavaScript
the entries() method returns a new array iterator object that contains the key/value pairs for each index in the array.
TypedArray.prototype.keys() - JavaScript
the keys() method returns a new array iterator object that contains the keys for each index in the array.
TypedArray.prototype.set() - JavaScript
the set() method stores multiple values in the typed array, reading input values from a specified array.
TypedArray.prototype.values() - JavaScript
the values() method returns a new array iterator object that contains the values for each index in the array.
WeakRef.prototype.deref() - JavaScript
the deref method returns the weakref instance's target object, or undefined if the target object has been garbage-collected.
WeakSet.prototype.add() - JavaScript
the add() method appends a new object to the end of a weakset object.
WeakSet - JavaScript
instance methods weakset.prototype.add(value) appends value to the weakset object.
WebAssembly.CompileError - JavaScript
instance methods webassembly.compileerror.prototype.tosource() returns code that could eval to the same error.
WebAssembly.Global - JavaScript
instance methods global.prototype.valueof() old-style method that returns the value contained inside the global variable.
WebAssembly.Instance() constructor - JavaScript
syntax important: since instantiation for large modules can be expensive, developers should only use the instance() constructor when synchronous instantiation is absolutely required; the asynchronous webassembly.instantiatestreaming() method should be used at all other times.
WebAssembly.LinkError - JavaScript
instance methods webassembly.linkerror.prototype.tosource() returns code that could eval to the same error.
WebAssembly.Memory() constructor - JavaScript
the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above.
WebAssembly.Memory.prototype.buffer - JavaScript
examples using buffer the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above.
WebAssembly.Memory.prototype.grow() - JavaScript
the grow() protoype method of the memory object increases the size of the memory instance by a specified number of webassembly pages.
WebAssembly.Module() constructor - JavaScript
syntax important: since compilation for large modules can be expensive, developers should only use the module() constructor when synchronous compilation is absolutely required; the asynchronous webassembly.compilestreaming() method should be used at all other times.
WebAssembly.RuntimeError - JavaScript
instance methods webassembly.runtimeerror.prototype.tosource() returns code that could eval to the same error.
WebAssembly.Table() constructor - JavaScript
var tbl = new webassembly.table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an import object that contains the table: var importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming() method.
WebAssembly.Table.prototype.grow() - JavaScript
the grow() prototype method of the webassembly.table object increases the size of the table instance by a specified number of elements.
WebAssembly.Table.prototype.set() - JavaScript
the set() prototype method of the webassembly.table object mutates a reference stored at a given index to a different value.
WebAssembly.validate() - JavaScript
the validate() method is then used to check whether the module is valid.
WebAssembly - JavaScript
static methods webassembly.instantiate() the primary api for compiling and instantiating webassembly code, returning both a module and its first instance.
isFinite() - JavaScript
if the argument is nan, positive infinity, or negative infinity, this method returns false; otherwise, it returns true.
undefined - JavaScript
a method or statement also returns undefined if the variable that is being evaluated does not have an assigned value.
Destructuring assignment - JavaScript
console.log(a); // 1 console.log(b); // [2, 3] be aware that a syntaxerror will be thrown if a trailing comma is used on the left-hand side with a rest element: const [a, ...b,] = [1, 2, 3]; // syntaxerror: rest element may not have a trailing comma // always consider using rest operator as the last element unpacking values from a regular expression match when the regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression.
Equality (==) - JavaScript
if one of the operands is an object and the other is a number or a string, try to convert the object to a primitive using the object's valueof() and tostring() methods.
class expression - JavaScript
the constructor method is optional.
Expressions and operators - JavaScript
property accessors member operators provide access to a property or method of an object (object.property and object["property"]).
class - JavaScript
the constructor method is optional.
function declaration - JavaScript
description a function created with a function declaration is a function object and has all the properties, methods and behavior of function objects.
switch - JavaScript
methods for multi-criteria case source for this technique is here: switch statement multiple cases in javascript (stack overflow) multi-case : single operation this method takes advantage of the fact that if there is no break below a case clause it will continue to execute the next case clause regardless if the case meets the criteria.
with - JavaScript
the statements following the with statement refer to the pi property and the cos and sin methods, without specifying an object.
Template literals (Template strings) - JavaScript
function tag(strings) { console.log(strings.raw[0]); } tag`string text line 1 \n string text line 2`; // logs "string text line 1 \n string text line 2" , // including the two characters '\' and 'n' in addition, the string.raw() method exists to create raw strings—just like the default template function and string concatenation would create.
Trailing commas - JavaScript
function f(p) {} function f(p,) {} (p) => {}; (p,) => {}; the trailing comma also works with method definitions for classes or objects: class c { one(a,) {} two(a, b,) {} } var obj = { one(a,) {}, two(a, b,) {}, }; function calls the following function invocation pairs are legal and equivalent to each other.
JavaScript reference - JavaScript
built-ins javascript standard built-in objects, along with their methods and properties.
JavaScript
equality comparisons and sameness javascript provides three different value-comparison operations: strict equality using ===, loose equality using ==, and the object.is() method.
The "codecs" parameter in common media types - Web media technologies
you can also use the codecs parameter when specifying a mime media type to the mediasource.istypesupported() method; this method returns a boolean which indicates whether or not the media is likely to work on the current device.
Lazy loading - Web Performance
one of the methods we can use to tackle this problem is to shorten the critical rendering path length by lazy loading resources that are not critical for the first render to happen.
Add to Home screen - Progressive web apps (PWAs)
use the prompt() method available on the beforeinstallprompt event object (stored in deferredprompt) to trigger showing the install prompt.
Progressive web app structure - Progressive web apps (PWAs)
the most popular approach is the "app shell" concept, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in upcoming articles and use in our example application.
The building blocks of responsive design - Progressive web apps (PWAs)
if you use the mobile first methodology, you will be creating your mobile layout inside your default css, before any media queries have been applied.
Structural overview of progressive web apps - Progressive web apps (PWAs)
the most popular approach is the app shell concept, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in upcoming articles and use in our example application.
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
indefinite the begin of the animation will be determined by a beginelement() method call or a hyperlink targeted to the element.
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
indefinite the end of the animation will be determined by an svganimationelement.endelement() method call.
preserveAspectRatio - SVG: Scalable Vector Graphics
ke-linejoin: round; pointer-events: none; } rect:hover, rect:active { outline: 1px solid red; } syntax preserveaspectratio="<align> [<meetorslice>]" its value is made of one or two keywords: a required alignment value and an optional "meet or slice" reference as described below: alignment value the alignment value indicates whether to force uniform scaling and, if so, the alignment method to use in case the aspect ratio of the viewbox doesn't match the aspect ratio of the viewport.
textLength - SVG: Scalable Vector Graphics
the user agent will ensure that the text does not extend farther than that distance, using the method or methods specified by the lengthadjust attribute.
<feSpecularLighting> - SVG: Scalable Vector Graphics
such a map is intended to be combined with a texture using the add term of the arithmetic <fecomposite> method.
<linearGradient> - SVG: Scalable Vector Graphics
value type: <url> ; default value: none; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.
<radialGradient> - SVG: Scalable Vector Graphics
value type: <length> ; default value: 50%; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
value type: spacing|spacingandglyphs; default value: spacing; animatable: yes method which method to render individual glyphs along the path.
SVG In HTML Introduction - SVG: Scalable Vector Graphics
s 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
<hkern u1="a" u2="v" 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.
Certificate Transparency - Web security
with the latter methods, servers will need to be updated to send the required data.
How to turn off form autocompletion - Web security
disabling autocompletion to disable autocompletion in forms, you can set the autocomplete attribute to "off": autocomplete="off" you can do this either for an entire form, or for specific input elements in a form: <form method="post" action="/form" autocomplete="off"> […] </form> <form method="post" action="/form"> […] <div> <label for="cc">credit card:</label> <input type="text" id="cc" name="cc" autocomplete="off"> </div> </form> setting autocomplete="off" on fields has two effects: it tells the browser not to save data inputted by the user for later autocompletion on similar forms, though heur...
Securing your site - Web security
privacy and the :visited selector this article discusses changes made to the getcomputedstyle() method that eliminates the ability for malicious sites to figure out the user's browsing history.
Using shadow DOM - Web Components
basic usage you can attach a shadow root to any element using the element.attachshadow() method.
Using templates and slots - Web Components
constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } } ); the key point to note here is that we append a clone of the template content to the shadow root, created using the node.clonenode() method.
XML introduction - XML: Extensible Markup Language
entities like html, xml offers methods (called entities) for referring to some special reserved characters (such as a greater than sign which is used for tags).
choose - XPath
note: this method should be used instead of if(), which has been deprecated.
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.
Basic Example - XSLT: Extensible Stylesheet Language Transformations
</myns:body> </myns:article> figure 5 : xslt stylesheet <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </style> </head> <body> <p class="mybox"> <span class="title"> ...
Setting Parameters - XSLT: Extensible Stylesheet Language Transformations
xsltprocessor provides three javascript methods to interact with these parameters: xsltprocessor.setparameter(), xsltprocessor.getparameter() and xsltprocessor.removeparameter().
Compiling a New C/C++ Module to WebAssembly - WebAssembly
(note that we need to compile with no_exit_runtime, which is necessary as otherwise when main() exits the runtime would be shut down — necessary for proper c emulation, e.g., atexits are called — and it wouldn't be valid to call compiled code.) emcc -o hello3.html hello3.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html -s no_exit_runtime=1 -s "extra_exported_runtime_methods=['ccall']" if you load the example in your browser again, you'll see the same thing as before!
Exported WebAssembly functions - WebAssembly
ports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 othertable.set(0,tbl.get(0)); othertable.set(1,tbl.get(1)); console.log(othertable.get(0)()); console.log(othertable.get(1)()); }); here we create a table (othertable) from javascript using the webassembly.table constructor, then we load table.wasm into our page using the webassembly.instantiatestreaming() method.
Compiling an Existing C Module to WebAssembly - WebAssembly
it seemed to work brilliantly: $ emcc -o3 -s wasm=1 -s extra_exported_runtime_methods='["cwrap"]' \ -i libwebp \ webp.c \ libwebp/src/{dec,dsp,demux,enc,mux,utils}/*.c note: this strategy will not work with every c project.