Search completed in 1.19 seconds.
4665 results for "string":
Your results are loading. Please wait...
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.
... syntax str.substring(indexstart[, indexend]) parameters indexstart the index of the first character to include in the returned substring.
... indexend optional the index of the first character to exclude from the returned substring.
...And 21 more matches
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
the javascript warning about string generics occurs in firefox versions prior to 68.
... string generics have been removed starting with firefox 68.
... message warning: string.charat is deprecated; use string.prototype.charat instead warning: string.charcodeat is deprecated; use string.prototype.charcodeat instead warning: string.concat is deprecated; use string.prototype.concat instead warning: string.contains is deprecated; use string.prototype.contains instead warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.indexof is deprecated; use string.prototype.indexof instead warning: string.lastindexof is deprecated; use string.prototype.lastindexof instead warning: string.localecompa...
...And 6 more matches
String.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified object.
... syntax str.tostring() return value a string representing the calling object.
... description the string object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
...And 2 more matches
Mozilla internal string guide
most of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers.
... this guide documents the string classes which are visible to code within the mozilla codebase (code which is linked into libxul).
... introduction the string classes are a library of c++ classes which are used to manage buffers of wide (16-bit) and narrow (8-bit) character strings.
...And 236 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.
...the stringview constructor is one level above typed arrays.
...And 160 more matches
String - JavaScript
the string object is used to represent and manipulate a sequence of characters.
... description strings are useful for holding data that can be represented in text form.
... 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.
...And 63 more matches
nsDependentCString
class declaration nstdependentstring_chart stores a null-terminated, immutable sequence of characters.
... subclass of nststring that restricts string value to an immutable character sequence.
... this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use.
...And 49 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.
... strings as objects most things are objects in javascript.
...And 44 more matches
The new nsString class implementation (1999) - Archive of obsolete content
in the meantime, try the xpcom string guide—but note that that article bears a warning of its own!
... this document is intended to briefly describe the new nsstring class architecture, and discuss the implications on memory management, optimizations, internationalization and usage patterns.
... disclaimer: i absolutely hate string classes.
...And 42 more matches
Handling text — strings in JavaScript - Learn web development
previous overview: first steps next next, we'll turn our attention to strings — this is what pieces of text are called in programming.
... in this article, we'll look at all the common things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in strings, and joining strings together.
... objective: to gain familiarity with the basics of strings in javascript.
...And 41 more matches
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.
... syntax json.stringify(value[, replacer[, space]]) parameters value the value to convert to a json string.
... replacer optional a function that alters the behavior of the stringification process, or an array of string and number that serve as an allowlist for selecting/filtering the properties of the value object to be included in the json string.
...And 39 more matches
nsDependentString
class declaration nstdependentstring_chart stores a null-terminated, immutable sequence of characters.
... subclass of nststring that restricts string value to an immutable character sequence.
... this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use.
...And 37 more matches
nsCString
class declaration this is the canonical null-terminated string class.
... instances of this class allocate strings on the heap.
... names: nsstring for wide characters nscstring for narrow characters this class is also known as nsaflat[c]string, where "flat" is used to denote a null-terminated string.
...And 36 more matches
nsString
class declaration this is the canonical null-terminated string class.
... instances of this class allocate strings on the heap.
... names: nsstring for wide characters nscstring for narrow characters this class is also known as nsaflat[c]string, where "flat" is used to denote a null-terminated string.
...And 36 more matches
nsAutoString
class declaration nstautostring_chart subclass of nststring_chart that adds support for stack-based string allocation.
... it is normally not a good idea to use this class on the heap, because it will allocate space which may be wasted if the string it contains is significantly smaller or any larger than 64 characters.
... 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 beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(cons...
...And 35 more matches
nsCAutoString
class declaration nstautostring_chart subclass of nststring_chart that adds support for stack-based string allocation.
... it is normally not a good idea to use this class on the heap, because it will allocate space which may be wasted if the string it contains is significantly smaller or any larger than 64 characters.
... 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 trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat ...
...And 35 more matches
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<= ...
... operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find(const nsastring&, print32 (*) find(const nsastring&, pruint32, print32 (*) find rfind(const nsastring&, print32 (*) rfind(const nsastring&, print32, print32 (*) rfind findchar rfindchar appendint tointeger base classes nsstringcontainer data members no public members.
... 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 void nsdependentsubstring_external(const nsastring&, pruint32, pruint32) - source parameters nsastring astr pruint32 astartpos pruint32 alength rebind void rebind(const prunichar*, pruint32) - source parameters prunichar astart pruint32 alength beginreading pruint32 beginreading(c...
...And 35 more matches
nsAdoptingCString
class declaration nstadoptingstring extends nstxpidlstring such that: (1) adopt given string on construction or assignment, i.e.
...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 length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii ...
...st char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsxpidlcstring data members no public members.
...And 34 more matches
nsAdoptingString
class declaration nstadoptingstring extends nstxpidlstring such that: (1) adopt given string on construction or assignment, i.e.
...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 isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii ...
...nst char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsxpidlstring data members no public members.
...And 34 more matches
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...
...eequalsliteral find rfind findchar rfindchar appendint tointeger base classes nsstring_external data members no public members.
... 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 nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parame...
...And 34 more matches
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 ...
... find rfind findchar rfindchar appendint tointeger base classes nsstringcontainer data members no public members.
... 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 parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring ...
...And 34 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...
...l(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
...And 34 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...
...al(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
...And 34 more matches
PromiseFlatString (External)
stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes nsstringcontainer data members no public members.
... 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* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const ...
...- source returns the length, beginning, and end of a string in one operation.
...And 33 more matches
nsAString (External)
class declaration this header provides wrapper classes around the frozen string api which are roughly equivalent to the internal string classes.
... <map id="classes" name="classes"> <area alt="" coords="963,6,1045,54" href="http://developer.mozilla.org/en/nsastring_(external)" shape="rect" title="nsastring_(external)"> <area alt="" coords="939,102,1069,150" href="http://developer.mozilla.org/en/nsstringcontainer_(external)" shape="rect" title="nsstringcontainer_(external)"> <area alt="" coords="548,198,676,246" href="http://developer.mozilla.org/en/nsstring_external" shape="rect" title="nsstring_external"> <area alt="" coords="700,198,913,246" href="http://developer.mozilla.org/en/nsdependentsubstring_external" shape="rect" title="nsdependentsubstring_external"> <area alt="" coords="937,198,1071,246" href="http://developer.mozilla.org/en/promiseflatstring_(external)" shape="rect" title="promiseflatstring_(external)"> <area alt="" coords="1...
...095,198,1196,246" href="http://developer.mozilla.org/en/nsautostring_(external)" shape="rect" title="nsautostring_(external)"> <area alt="" coords="5,294,197,342" href="http://developer.mozilla.org/en/nsdependentstring_external" shape="rect" title="nsdependentstring_external"> <area alt="" coords="221,294,467,342" href="http://developer.mozilla.org/en/ns_convertasciitoutf16_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...
...And 33 more matches
nsAutoString (External)
stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes nsstringcontainer data members no public members.
... 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* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const ...
...- source returns the length, beginning, and end of a string in one operation.
...And 33 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...
... assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
... 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, pruint32) - source parameters char* data pruint32 storagesize pruint32 length operator= nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsacstring_internal& operator=(const char*) - source parameters char* data nsacstring_internal& operator=(const nsacstring_internal&) - source par...
...And 33 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 ...
... assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
... 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, pruint32) - source parameters prunichar* data pruint32 storagesize pruint32 length operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsas...
...And 33 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...
... assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
... 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_internal& operator=(const char*) - source parameters char* data nsacstring_internal& operator=(const nsacstring_internal&) - source parameters nsacstring_internal& str nsacstring_internal& operator=(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple get char* get() const - source returns the null-terminated string find print32 find(const nscstr...
...And 33 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 ...
... assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
... 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& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple get prunichar* get() const - source returns the null-terminated string find print32 find(cons...
...And 33 more matches
nsStringContainer (External)
stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes nsastring data members no public members.
... methods beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...And 33 more matches
PromiseFlatCString (External)
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data members no public members.
... 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 pruint32 beginreading(const char**, const char**) const - source returns the length, ...
...beginning, and end of a string in one operation.
...And 30 more matches
nsACString (External)
class declaration <map id="classes" name="classes"><area alt="" coords="1005,6,1096,54" href="http://developer.mozilla.org/en/nsacstring_(external)" shape="rect" title="nsacstring_(external)"> <area alt="" coords="980,102,1121,150" href="http://developer.mozilla.org/en/nscstringcontainer_(external)" shape="rect" title="nscstringcontainer_(external)"> <area alt="" coords="571,198,707,246" href="http://developer.mozilla.org/en/nscstring_external" shape="rect" title="nscstring_external"> <area alt="" coords="731,198,955,246" href="http://developer.mozilla.org/en/nsdependentcsubstring_external" shape="rect" title="nsdependentcsubstring_external"> <area alt="" coords="979,198,1123,246" href="http://developer.mozilla.org/en/promiseflatcstring_(external)" shape="rect" title="promiseflatcstring_...
...(external)"> <area alt="" coords="1147,198,1259,246" href="http://developer.mozilla.org/en/nscautostring_(external)" shape="rect" title="nscautostring_(external)"> <area alt="" coords="5,294,208,342" href="http://developer.mozilla.org/en/nsdependentcstring_external" shape="rect" title="nsdependentcstring_external"> <area alt="" coords="232,294,475,342" href="http://developer.mozilla.org/en/ns_convertutf16toutf8_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)"><...
...methods beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
nsCAutoString (External)
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data members no public members.
... 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 pruint32 beginreading(const char**, const char**) const - source returns the length, ...
...beginning, and end of a string in one operation.
...And 30 more matches
nsCStringContainer (External)
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> operator!= equalsliteral find(const nsacstring&, print32 (*) find(const nsacstring&, pruint32, print32 (*) find(const char*, print32 (*) find(con...
...st char*, pruint32, print32 (*) rfind(const nsacstring&, print32 (*) rfind(const nsacstring&, print32, print32 (*) rfind(const char*, print32 (*) rfind(const char*, print32, print32 (*) findchar rfindchar appendint tointeger base classes nsacstring data members no public members.
... methods beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
nsCString external
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data members no public members.
... 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& 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 pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
nsDependentCString external
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data members no public members.
... 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 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 pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
nsDependentCSubstring external
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data members no public members.
... 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 char* astart pruint32 alength beginreading pruint32 beginreading(const cha...
...r**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
nsLiteralCString (External)
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data members no public members.
... 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 adopt void adopt(const char*, pruint32) - source parameters char* adata pruint32 ...
...alength beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
nsLiteralString (External)
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data members no public members.
... 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 adopt void adopt(const char*, pruint32) - source parameters char* adata pruint32 ...
...alength beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
String.prototype.replace() - JavaScript
the replace() method returns a new string with some or all matches of a pattern replaced by a replacement.
... the pattern can be a string or a regexp, and the replacement can be a string or a function to be called for each match.
... if pattern is a string, only the first occurrence will be replaced.
...And 28 more matches
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 separator can be a simple string or it can be a regular expression.
... the simplest case is when separator is just a single character; this is used to split a delimited string.
...And 28 more matches
Firefox user agent string reference - HTTP
this document describes the user agent string used in firefox 4 and later and applications based on gecko 2.0 and later.
... for a breakdown of changes to the string in gecko 2.0, see final user agent string for firefox 4 (blog post).
... general form the ua string of firefox itself is broken down into four components: mozilla/5.0 (platform; rv:geckoversion) gecko/geckotrail firefox/firefoxversion mozilla/5.0 is the general token that says the browser is mozilla compatible, and is common to almost every browser today.
...And 24 more matches
nsIStringBundle
intl/strres/nsistringbundle.idlscriptable this interface provides functions for retrieving both formatted and unformatted strings from a properties file.
... inherits from: nsisupports last changed in gecko 1.7 this interface is used by xul:stringbundle to retrieve strings.
... it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary.
...And 23 more matches
JSAutoByteString
this article covers features introduced in spidermonkey 17 take ownership of a string and free it later.
... syntax jsautobytestring str; jsautobytestring(jscontext *cx, jsstring *str); name type description cx jscontext * the context in which to add the root.
... str jsstring * a pointer to jsstring to get initial content by calling js_encodestring(cx, str).
...And 22 more matches
nsACString
« xpcom api reference summary the nsacstring abstract class represents a character string composed of single-byte storage units.
... #include "nsstringapi.h" class nsacstring { ...
... self_type [nsacstring] an alias for the type of this class.
...And 20 more matches
nsAString
« xpcom api reference summary the nsastring abstract class represents a character string composed of double-byte storage units.
... #include "nsstringapi.h" class nsastring { ...
... self_type [nsastring] an alias for the type of this class.
...And 20 more matches
nsAString_internal
class declaration nstsubstring is the most abstract class in the string hierarchy.
... for example, see nststring.
... names: nsastring for wide characters nsacstring for narrow characters many of the accessors on nstsubstring are inlined as an optimization.
...And 20 more matches
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 “,”).
... syntax arr.tolocalestring([locales[, options]]); parameters locales optional a string with a bcp 47 language tag, or an array of such strings.
...And 20 more matches
nsACString_internal
class declaration nstsubstring is the most abstract class in the string hierarchy.
... for example, see nststring.
... names: nsastring for wide characters nsacstring for narrow characters many of the accessors on nstsubstring are inlined as an optimization.
...And 19 more matches
nsICompositionStringSynthesizer
dom/interfaces/base/nsicompositionstringsynthesizer.idlscriptable this interface is a composition string synthesizer interface that synthesizes composition string with arbitrary clauses and a caret 1.0 66 introduced gecko 26 obsolete gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface is obsoleted in gecko 38.
... every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer().
... to create an instance for this: var domwindowutils = window.windowutils; var compositionstringsynthesizer = domwindowutils.createcompositionstringsynthesizer(); for example, when you create a composition whose composing string is "foo-bar-buzz" and "bar" is selected to convert, then, first, you need to start composition: domwindowutils.sendcompositionevent("compositionstart", "", ""); next, dispatch composition string with crause information and caret information (optional): // set new composition string with .setstring().
...And 19 more matches
String.prototype.replaceAll() - JavaScript
the replaceall() method returns a new string with all matches of a pattern replaced by a replacement.
... the pattern can be a string or a regexp, and the replacement can be a string or a function to be called for each match.
... the original string is left unchanged.
...And 19 more matches
nsDependentSubstring
class declaration nstdependentsubstring_chart a string class which wraps an external array of string characters.
... it is the client code's responsibility to ensure that the external buffer remains valid for a long as the string is alive.
... 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 char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdat...
...And 18 more matches
NS_CStringContainerInit2
« xpcom api reference summary the ns_cstringcontainerinit2 function initializes a nscstringcontainer instance for use as a nsacstring.
... #include "nsstringapi.h" nsresult ns_cstringcontainerinit2( nscstringcontainer& acontainer, const char* adata = nsnull, pruint32 adatalength = pr_uint32_max, pruint32 aflags = 0 ); parameters acontainer [in] the nscstringcontainer instance to initialize.
... adata [in] an array of characters used to initialize the string object.
...And 18 more matches
nsDependentCSubstring
class declaration nstdependentsubstring_chart a string class which wraps an external array of string characters.
... it is the client code's responsibility to ensure that the external buffer remains valid for a long as the string is alive.
... 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 char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdat...
...And 17 more matches
XPCOM string functions
xpcom provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
... ns_cstringappenddatathe ns_cstringappenddata function appends data to the existing value of a nsacstring instance.
... this is a low-level api.ns_cstringclonedatathe ns_cstringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.ns_cstringcontainerfinishthe ns_cstringcontainerfinish function releases any memory allocated by a nscstringcontainer instance.ns_cstringcontainerinitthe ns_cstringcontainerinit function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcontainerinit2the ns_cstringcontainerinit2 function initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcopythe ns_cstringcopy function copies the value from one nsacstring instance to another.
...And 15 more matches
Object.prototype.toString() - JavaScript
the tostring() method returns a string representing the object.
... syntax obj.tostring() return value 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.
...And 15 more matches
JS_NewExternalString
create a new jsstring whose characters are stored in external memory.
... syntax jsstring * js_newexternalstring(jscontext *cx, const char16_t *chars, size_t length, const jsstringfinalizer *fin); jsstring * js_newexternalstringwithclosure(jscontext *cx, jschar *chars, size_t length, int type, void *closure); // obsolete since jsapi 13 name type description cx jscontext * the context in which to create the new string.
...this array is used as the character buffer of the jsstring to be created.
...And 14 more matches
Template literals (Template strings) - JavaScript
template literals are string literals allowing embedded expressions.
... you can use multi-line strings and string interpolation features with them.
... they were called "template strings" in prior editions of the es2015 specification.
...And 14 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.
... syntax str.indexof(searchvalue [, fromindex]) parameters searchvalue the string value to search for.
... if no string is explicitly provided, searchvalue will be coerced to "undefined", and this value will be searched for in str.
...And 13 more matches
String.raw() - JavaScript
the static string.raw() method is a tag function of template literals.
... this is similar to the r prefix in python, or the @ prefix in c# for string literals.
... (but it is not identical; see explanations in this issue.) it's used to get the raw string form of template strings, that is, substitutions (e.g.
...And 13 more matches
querystring - Archive of obsolete content
utility functions for working with query strings.
... globals functions stringify(fields, separator, assignment) serializes an object containing name:value pairs into a query string: querystring.stringify({ foo: 'bar', baz: 4 }); // => 'foo=bar&baz=4' by default '&' and'=' are used as separator and assignment characters, but you can override this using additional optional parameters: querystring.stringify({ foo: 'bar', baz: 4 }, ';', ':'); // => 'foo:bar;baz:4' parameters fields : object the data to convert to a query string.
... separator : string the string to use as a separator between each name:value pair.
...And 12 more matches
JS_ValueToString
convert a jsval to a jsstring.
... syntax jsstring * js_valuetostring(jscontext *cx, jsval v); name type description cx jscontext * the context in which to perform the conversion.
... description js_valuetostring converts a specified javascript value, v, to a string.
...And 12 more matches
Date.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string with a language sensitive representation of this date.
... in older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent.
... syntax dateobj.tolocalestring([locales[, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 12 more matches
JS_InternString
get an interned string - a jsstring that is protected from gc and automatically shared with other code that needs a jsstring with the same value.
... syntax jsstring * js_internstring(jscontext *cx, const char *s); jsstring * js_internstringn(jscontext *cx, const char *s, size_t length); jsstring * js_internucstring(jscontext *cx, const char16_t *s); jsstring * js_internucstringn(jscontext *cx, const char16_t *s, size_t length); name type description cx jscontext * a context.
... s const char * or const char16_t * pointer to a character array containing the data for the string.
...And 10 more matches
JS_NewStringCopyN
create a new js string.
... syntax jsstring * js_newstringcopyn(jscontext *cx, const char *s, size_t n); jsstring * js_newucstringcopyn(jscontext *cx, const char16_t *s, size_t n); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... s const char* or const char16_t * pointer to the array of characters containing the text for the js string to create.
...And 10 more matches
nsIStringBundleService
intl/strres/nsistringbundle.idlscriptable provides the string bundle service, which provides a way to fetch localized strings from a property file.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/stringbundle;1.
... 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 load.
...And 10 more matches
Date.prototype.toLocaleDateString() - JavaScript
the tolocaledatestring() method returns a string with a language sensitive representation of the date portion of this date.
...in older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.
... syntax dateobj.tolocaledatestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 10 more matches
JS_AddExternalStringFinalizer
register a custom string memory manager.
... syntax int js_addexternalstringfinalizer(jsstringfinalizeop finalizer); name type description finalizer jsstringfinalizeop pointer to a callback function, described below.
... the js engine will automatically call this function each time a string created by js_newexternalstring is garbage-collected.
...And 9 more matches
JS_GetStringBytes
convert a javascript string to a c string.
... syntax char * js_getstringbytes(jsstring *str); const char * js_getstringbytesz(jscontext *cx, jsstring *str); // added in jsapi 1.8.2 name type description cx jscontext * (js_getstringbytesz and js_encodestring only) a context.
... str jsstring * string to retrieve bytes from.
...And 9 more matches
nsIStringBundleOverride
intl/strres/nsistringbundleoverride.idlscriptable provides the string bundle override service; this interface is an implementation detail.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/stringbundle/text-override;1.
... to create an instance, use: var stringbundleservice = components.classes["@mozilla.org/intl/stringbundle/text-override;1"] .getservice(components.interfaces.nsistringbundleoverride); note: you should never need to use this service directly.
...And 9 more matches
NS_CStringGetMutableData
« xpcom api reference summary the ns_cstringgetmutabledata function gives the caller write access to the string's internal buffer.
... #include "nsstringapi.h" pruint32 ns_cstringgetmutabledata( nsacstring& astring, pruint32 adatalength, char** adata ); parameters astring [in] a nsacstring instance to modify.
... adatalength [in] the number of characters to resize the string's internal buffer to or pr_uint32_max to return the buffer as-is.
...And 9 more matches
Date.prototype.toLocaleTimeString() - JavaScript
the tolocaletimestring() method returns a string with a language sensitive representation of the time portion of this date.
...in older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.
... syntax dateobj.tolocaletimestring([locales[, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
...And 9 more matches
Number.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string with a language-sensitive representation of this number.
... syntax numobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.
...And 9 more matches
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.
... return value a string representing the character (exactly one utf-16 code unit) at the specified index.
... if index is out of range, charat() returns an empty string.
...And 9 more matches
String.prototype.normalize() - JavaScript
the normalize() method returns the unicode normalization form of the string.
... return value a string containing the unicode normalization form of the given string.
... let string1 = '\u00f1'; let string2 = '\u006e\u0303'; console.log(string1); // ñ console.log(string2); // ñ however, since the code points are different, string comparison will not treat them as equal.
...And 9 more matches
JS_CompareStrings
compare two js strings.
... syntax bool js_comparestrings(jscontext *cx, jsstring *str1, jsstring *str2, int32_t *result); name type description cx jscontext * the context to which both strings must belong.
... str1 jsstring * first string to compare.
...And 8 more matches
JS_EncodeString
this article covers features introduced in spidermonkey 1.8 convert a javascript string to a c string.
... syntax char * js_encodestring(jscontext *cx, jsstring *str); char * js_encodestringtoutf8(jscontext *cx, js::handlestring str); // added in spidermonkey 24 name type description cx jscontext * a context.
... str jsstring * / js::handlestring a string to encode.
...And 8 more matches
JS_MakeStringImmutable
make a jsstring thread-safe.
... syntax jsbool js_makestringimmutable(jscontext *cx, jsstring *str); name type description cx jscontext * a context.
... s jsstring * the string to operate on.
...And 8 more matches
NS_CStringContainerInit
« xpcom api reference summary the ns_cstringcontainerinit function initializes a nscstringcontainer instance for use as a nsacstring.
... #include "nsstringapi.h" nsresult ns_cstringcontainerinit( nscstringcontainer& astring ); parameters astring [in] a nscstringcontainer instance to be initialized.
... return values the ns_cstringcontainerinit function returns ns_ok if successful.
...And 8 more matches
NS_StringContainerInit
« xpcom api reference summary the ns_stringcontainerinit function initializes a nsstringcontainer instance for use as a nsastring.
... #include "nsstringapi.h" nsresult ns_stringcontainerinit( nsstringcontainer& astring ); parameters astring [in] a nsstringcontainer instance to be initialized.
... return values the ns_stringcontainerinit function returns ns_ok if successful.
...And 8 more matches
SyntaxError: unterminated string literal - JavaScript
the javascript error "unterminated string literal" occurs when there is an unterminated string somewhere.
... string literals must be enclosed by single (') or double (") quotes.
... message syntaxerror: unterminated string constant (edge) syntaxerror: unterminated string literal (firefox) error type syntaxerror what went wrong?
...And 8 more matches
BigInt.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified bigint object.
... the trailing "n" is not part of the string.
... syntax bigintobj.tostring([radix]) parameters radixoptional optional.
...And 8 more matches
Date.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified date object.
... syntax dateobj.tostring() return value a string representing the given date.
... description date instances inherit their tostring() method from date.prototype, not object.prototype.
...And 8 more matches
string - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the string function converts the given argument to a string.
... syntax string( [object] ) arguments object(optional) the object to convert to a string.
... returns a string notes if the object is a node-set, the string value of the first node in the set is returned.
...And 8 more matches
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.
... strings 1 in our first strings task, we start off small.
... concatenate the two strings together to make a single string containing the complete quote.
...And 7 more matches
JS_NewDependentString
create a new javascript string containing a range of characters from an existing string.
... syntax jsstring * js_newdependentstring(jscontext *cx, js::handlestring str, size_t start, size_t length); name type description cx jscontext * the context in which to create the new string.
... str js::handlestring the string containing the characters for the new string.
...And 7 more matches
nsEmbedCString
« xpcom api reference summary the nsembedcstring concrete class provides a way to construct a nsacstring object that allocates null-terminated storage.
... #include "nsembedstring.h" class nsembedcstring : public nsacstring { ...
... }; typedefs self_type [nsembedcstring] an alias for the type of this class.
...And 7 more matches
nsEmbedString
« xpcom api reference summary the nsembedstring concrete class provides a way to construct a nsastring object that allocates null-terminated storage.
... #include "nsembedstring.h" // or: #include "nsstringglue.h" if inside gecko class nsembedstring : public nsastring { ...
... }; typedefs self_type [nsembedstring] an alias for the type of this class.
...And 7 more matches
nsIStringEnumerator
xpcom/ds/nsistringenumerator.idlscriptable please add a summary to this article.
... 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.
... the "next" element is the first string upon the first call.
...And 7 more matches
BigInt.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string with a language-sensitive representation of this bigint.
... syntax bigintobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
... in implementations that ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent.
...And 7 more matches
Function.prototype.toString() - JavaScript
the tostring() method returns a string representing the source code of the function.
... syntax function.tostring() return value 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.
...And 7 more matches
Number.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified number object.
... syntax numobj.tostring([radix]) parameters radix optional.
... return value a string representing the specified number object.
...And 7 more matches
String.fromCharCode() - JavaScript
the static string.fromcharcode() method returns a string created from the specified sequence of utf-16 code units.
... syntax string.fromcharcode(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of numbers that are utf-16 code units.
... return value a string of length n consisting of the n specified utf-16 code units.
...And 7 more matches
String.fromCodePoint() - JavaScript
the static string.fromcodepoint() method returns a string created by using the specified sequence of code points.
... syntax string.fromcodepoint(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of code points.
... return value a string created by using the specified sequence of code points.
...And 7 more matches
String length - JavaScript
the length property of a string object contains the length of the string, in utf-16 code units.
... length is a read-only data property of string instances.
... description this property returns the number of code units in the string.
...And 7 more matches
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: [""].
... input a copy of the search string.
...And 7 more matches
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.
...(for example, if beginindex is -3 it is treated as str.length - 3.) if beginindex is greater than or equal to str.length, slice() returns an empty string.
... if endindex is omitted, slice() extracts to the end of the string.
...And 7 more matches
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.
... syntax str.substr(start[, length]) parameters start the index of the first character to include in the returned substring.
... return value a new string containing the specified part of the given string.
...And 7 more matches
JS_EncodeStringToBuffer
this article covers features introduced in spidermonkey 1.8.5 convert a javascript string to a c string.
... syntax size_t js_encodestringtobuffer(jscontext *cx, jsstring *str, char *buffer, size_t length); name type description cx jscontext * a context.
... str jsstring * a string to encode.
...And 6 more matches
JS_FlattenString
this article covers features introduced in spidermonkey 1.8.5 flattens a string.
... this makes getting the characters of the string infallible.
... syntax jsflatstring * js_flattenstring(jscontext *cx, jsstring *str); name type description cx jscontext * the context.
...And 6 more matches
JS_GetStringCharAt
this article covers features introduced in spidermonkey 38 return a specified character from a string.
... syntax bool js_getstringcharat(jscontext *cx, jsstring *str, size_t index, char16_t *res); char16_t js_getflatstringcharat(jsflatstring *str, size_t index); name type description cx jscontext * the context in which to create the new string.
... str jsstring * or jsflatstring * the string to get character.
...And 6 more matches
JS_NewUCString
note: js_newstring() was removed in spidermonkey 1.8.5.
... use js_newstringcopyn and js_newucstringcopyn instead.
... syntax jsstring * js_newucstring(jscontext *cx, char16_t *chars, size_t length); jsstring * js_newstring(jscontext *cx, char *buf, size_t length); // obsolete since jsapi 1.8.5 name type description cx jscontext * the context in which to create the new string.
...And 6 more matches
JS_StringEqualsAscii
this article covers features introduced in spidermonkey 1.8.5 compare flat string and ascii string.
... syntax bool js_stringequalsascii(jscontext *cx, jsstring *str, const char *asciibytes, bool *match); bool js_flatstringequalsascii(jsflatstring *str, const char *asciibytes); name type description cx jscontext * a context.
... str jsflatstring * string to compare.
...And 6 more matches
nsIPrefLocalizedString
modules/libpref/public/nsipreflocalizedstring.idlscriptable this interface is simply a wrapper interface for nsisupportsstring so the preferences service can have a unique identifier to distinguish between requests for normal wide strings nsisupportsstring) and 'localized' wide strings, which get their default values from properites files.
... 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.
...void setdatawithlength( in unsigned long length, [size_is(length)] in wstring data ); parameters length the length of the string.
...And 6 more matches
nsIUTF8StringEnumerator
xpcom/ds/nsistringenumerator.idlscriptable an object can implement this interface to allow a client to iterate over a set of strings provided by the object.
... inherits from: nsisupports last changed in gecko 1.7 method overview autf8string getnext(); boolean hasmore(); methods getnext() returns the next string in the enumerator.
... the "next" element is the first string upon the first call.
...And 6 more matches
NS_UTF16ToCString
« xpcom api reference summary the ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the specified multi-byte encoding and stores the result in a nsacstring instance.
... #include "nsstringapi.h" nsresult ns_utf16tocstring( const nsastring& asrc, nscstringencoding adestencoding, nsacstring& adest ); parameters asrc [in] a nsastring instance containing the source utf-16 string to be converted.
... the source string should be encoded using the host byte order.
...And 6 more matches
Binary strings - Web APIs
WebAPIDOMStringBinary
javascript strings are utf-16 encoded strings.
...a subset of these strings is represented by utf-16 strings containing only ascii characters (i.e., characters whose code point does not exceed 127).
... for instance, the string "hello world!" belongs to the ascii subset, while the string "ÀÈÌÒÙ" does not.
...And 6 more matches
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.
... kind is string).
... syntax datatransferitem.getasstring(callback); parameters callback a callback function that has access to the data transfer item's string data.
...And 6 more matches
SVGStringList - Web APIs
svg string list interface the svgstringlist defines a list of domstring objects.
... an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
... interface overview also implement none methods void clear() domstring initialize(in domstring newitem) domstring getitem(in unsigned long index) domstring insertitembefore(in domstring newitem, in unsigned long index) domstring replaceitem(in domstring newitem, in unsigned long index) domstring removeitem(in unsigned long index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
...And 6 more matches
<string> - CSS: Cascading Style Sheets
WebCSSstring
the <string> css data type represents a sequence of characters.
... strings are used in numerous css properties, such as content, font-family, and quotes.
... syntax the <string> data type is composed of any number of unicode characters surrounded by either double (") or single (') quotes.
...And 6 more matches
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.
... syntax referencestr.localecompare(comparestring[, locales[, options]]) parameters comparestring the string against which the referencestr is compared.
...in implementations which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent.
...And 6 more matches
String Quick Reference - Archive of obsolete content
function declarations what: use abstract classes instead of concrete classes when passing strings across function boundaries why: using abstract classes allows the caller to choose the storage mechanism, allowing for possible sharing or more efficient handling of string fragments.
... 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); nsautostring middle; leftside.right(middle, 8); new way: use substring() to grab a direct reference to those characters: // get an 8-character string starting at the 4th position const nsastring& middle = substring(str, 4, 8); unicode literals what: use macro tricks to make wide-c...
...haracter literal strings.
...And 5 more matches
JSID_IS_STRING
testing and conversion functions between a js id and a js string.
... syntax bool jsid_is_string(jsid id); jsstring * jsid_to_string(jsid id); jsid interned_string_to_jsid(jscontext *cx, jsstring *str); // added in spidermonkey 38 jsflatstring * jsid_to_flat_string(jsid id); // added in spidermonkey 17 name type description cx jscontext * pointer to a js context from which to derive runtime information.
... str jsstring * an interned string to convert to an id.
...And 5 more matches
JS_CStringsAreUTF8
api users should switch to functions which take utf-8 explicitly or handle their own string encoding and decoding.
... option to have the jsapi treat char strings as utf-8.
... syntax jsbool js_cstringsareutf8(void); void js_setcstringsareutf8(void); // added in spidermonkey 1.8 description by default, all c/c++ strings passed into the jsapi are treated as iso/iec 8859-1, also known as iso-latin-1.
...And 5 more matches
JS_ConcatStrings
concatenate two js strings.
... syntax jsstring * js_concatstrings(jscontext *cx, js::handlestring left, js::handlestring right); name type description cx jscontext * the context in which both the strings have been created.
... left js::handlestring first string to concatenate.
...And 5 more matches
JS_GetStringChars
retrieve a pointer to the 16-bit values that make up a given string.
... syntax jschar * js_getstringchars(jsstring *str); // obsolete since jsapi 1.8.5 const jschar * js_getstringcharsz(jscontext *cx, jsstring *str); // added in spidermonkey 1.8.2, obsolete since jsapi 33 name type description cx jscontext * (in js_getstringcharsz only) a context.
... str jsstring * the string to obtain characters from.
...And 5 more matches
JS_NewStringCopyZ
create a new javascript string based on a null-terminated c string.
... syntax jsstring * js_newstringcopyz(jscontext *cx, const char *s); jsstring * js_newucstringcopyz(jscontext *cx, const char16_t *s); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... s const char * or const char16_t * pointer to the character array containing the text for the js string to create; or null.
...And 5 more matches
NS_CStringInsertData
« xpcom api reference summary the ns_cstringinsertdata function appends data to the existing value of a nsacstring instance.
... #include "nsstringapi.h" nsresult ns_cstringinsertdata( nsacstring& astring, pruint32 aoffset, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified.
... aoffset [in] an offset into the string's internal buffer specifying where to place the given characters.
...And 5 more matches
NS_CStringToUTF16
« xpcom api reference summary the ns_cstringtoutf16 function converts the value of a nsacstring instance to utf-16 and stores the result in a nsastring instance.
... #include "nsstringapi.h" nsresult ns_cstringtoutf16( const nsacstring& asrc, nscstringencoding asrcencoding, nsastring& adest ); parameters asrc [in] a nsacstring instance containing the source string to be converted.
... asrcencoding [in] the character encoding of the source string.
...And 5 more matches
NS_StringInsertData
« xpcom api reference summary the ns_stringinsertdata function appends data to the existing value of a nsacstring instance.
... #include "nsstringapi.h" nsresult ns_stringinsertdata( nsacstring& astring, pruint32 aoffset, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified.
... aoffset [in] an offset into the string's internal buffer specifying where to place the given characters.
...And 5 more matches
Array.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified array and its elements.
... syntax arr.tostring() return value a string representing the elements of the array.
... description the array object overrides the tostring method of object.
...And 5 more matches
Date.prototype.toGMTString() - JavaScript
the togmtstring() method converts a date to a string, using internet greenwich mean time (gmt) conventions.
... the exact format of the value returned by togmtstring() varies according to the platform and browser, in general it should represent a human readable date string.
... note: togmtstring() is deprecated and should no longer be used.
...And 5 more matches
String.prototype.concat() - JavaScript
the concat() method concatenates the string arguments to the calling string and returns a new string.
... syntax str.concat(str2 [, ...strn]) parameters str2 [, ...strn] strings to concatenate to str.
... return value a new string containing the combined text of the strings provided.
...And 5 more matches
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.
... syntax str.lastindexof(searchvalue[, fromindex]) parameters searchvalue a string representing the value to search for.
... if searchvalue is an empty string, then fromindex is returned.
...And 5 more matches
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.
... the padding is applied from the end of the current string.
... syntax str.padend(targetlength [, padstring]) parameters targetlength the length of the resulting string once the current str has been padded.
...And 5 more matches
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.
... syntax str.startswith(searchstring[, position]) parameters searchstring the characters to be searched for at the start of this string.
... position optional the position in this string at which to begin searching for searchstring.
...And 5 more matches
String.prototype.toLocaleUpperCase() - JavaScript
the tolocaleuppercase() method returns the calling string value converted to upper case, according to any locale-specific case mappings.
... return value a new string representing the calling string converted to upper case, according to any locale-specific case mappings.
... a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string.
...And 5 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().
... syntax typedarray.tostring() return value a string representing the elements of the typed array.
...And 5 more matches
JS::DeflateStringToUTF8Buffer
this article covers features introduced in spidermonkey 38 encode the given string as utf8 into given buffer.
... syntax // new in jsapi 52 void deflatestringtoutf8buffer(jsflatstring* src, mozilla::rangedptr<char> dst, size_t* dstlenp = nullptr, size_t* numcharsp = nullptr); // obsolete in spidermonkey 49 void deflatestringtoutf8buffer(jsflatstring* src, mozilla::rangedptr<char> dst); name type description src jsflatstring * the pointer to the string to deflate.
... description js::deflatestringtoutf8buffer encodes src as utf8.
...And 4 more matches
JS::ToString
this article covers features introduced in spidermonkey 31 convert any javascript value to a string.
... syntax #include "js/conversions.h" // as of spidermonkey 38; previously in jsapi.h jsstring* js::tostring(jscontext *cx, js::handlevalue v) name type description cx jscontext * the context in which to perform the conversion.
... description js::tostring returns a string representation of a javascript value.
...And 4 more matches
JS_GetLatin1StringCharsAndLength
this article covers features introduced in spidermonkey 38 get the chars and the length of a string.
... syntax const js::latin1char * js_getlatin1stringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, jsstring *str, size_t *length); const char16_t * js_gettwobytestringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, jsstring *str, size_t *length); name type description cx jscontext * a context.
... str jsstring * a string to get characters.
...And 4 more matches
JS_GetStringEncodingLength
this article covers features introduced in spidermonkey 1.8.5 get the length of a javascript string in bytes.
... syntax size_t js_getstringencodinglength(jscontext *cx, jsstring *str); name type description cx jscontext * a context.
... str jsstring * a string to encode.
...And 4 more matches
JS_GetStringLength
return the length, in 16-bit code units, of a javascript string.
... syntax size_t js_getstringlength(jsstring *str); name type description str jsstring * the string to examine.
... description js_getstringlength reports the length, in 16-bit code units, of the string str.
...And 4 more matches
JS_StringHasLatin1Chars
this article covers features introduced in spidermonkey 38 determine if a string's characters are stored as latin1.
... syntax bool js_stringhaslatin1chars(jsstring *str); name type description str jsstring * string to examine.
... description js_stringhaslatin1chars returns true iff the string's characters are stored as latin1.
...And 4 more matches
nsCStringEncoding
« xpcom api reference summary the nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.
... ns_cstring_encoding_ascii conversion between ascii and utf-16 assumes that all bytes in the source string are 7-bit ascii and can be inflated to utf-16 by inserting null bytes.
...the conversion may result in loss and/or corruption of information if the strings do not strictly contain ascii data.
...And 4 more matches
NS_CStringAppendData
« xpcom api reference summary the ns_cstringappenddata function appends data to the existing value of a nsacstring instance.
... #include "nsstringapi.h" nsresult ns_cstringappenddata( nsacstring& astring, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified.
... adata [in] a raw character array to copy into this string.
...And 4 more matches
NS_CStringCopy
« xpcom api reference summary the ns_cstringcopy function copies the value from one nsacstring instance to another.
... #include "nsstringapi.h" nsresult ns_cstringcopy( nsacstring& adeststring, const nsacstring& asrcstring ); parameters adeststring [in] a nsacstring instance to be modified.
... asrcstring [in] a nsacstring instance containing the new string value.
...And 4 more matches
NS_CStringCutData
« xpcom api reference summary the ns_cstringcutdata function removes a section of the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_cstringcutdata( nsacstring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsacstring instance to be modified.
...pass pr_uint32_max to specify the length from acutstart to the end of the string.
...And 4 more matches
NS_CStringGetData
« xpcom api reference summary the ns_cstringgetdata function gives the caller read access to the string's internal buffer.
... #include "nsstringapi.h" pruint32 ns_cstringgetdata( const nsacstring& astring, const char** adata, prbool* aterminated = nsnull ); parameters astring [in] a nsacstring instance to inspect.
... adata [out] a const pointer to the string's internal buffer.
...And 4 more matches
NS_CStringSetData
« xpcom api reference summary the ns_cstringsetdata function copies data into the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_cstringsetdata( nsacstring& astring, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify.
... adata [in] a raw character array to copy into this string.
...And 4 more matches
NS_StringAppendData
« xpcom api reference summary the ns_stringappenddata function appends data to the existing value of a nsastring instance.
... #include "nsstringapi.h" nsresult ns_stringappenddata( nsastring& astring, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to be modified.
... adata [in] a raw character array to copy into this string.
...And 4 more matches
NS_StringCopy
removed by bug 1332639 « xpcom api reference summary the ns_stringcopy function copies the value from one nsastring instance to another.
... #include "nsstringapi.h" nsresult ns_stringcopy( nsastring& adeststring, const nsastring& asrcstring ); parameters adeststring [in] a nsastring instance to be modified.
... asrcstring [in] a nsastring instance containing the new string value.
...And 4 more matches
NS_StringCutData
« xpcom api reference summary the ns_stringcutdata function removes a section of the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_stringcutdata( nsastring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsastring instance to be modified.
...pass pr_uint32_max to specify the length from acutstart to the end of the string.
...And 4 more matches
NS_StringSetData
« xpcom api reference summary the ns_stringsetdata function copies data into the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_stringsetdata( nsastring& astring, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify.
... adata [in] a raw character array to copy into this string.
...And 4 more matches
CSSPrimitiveValue.setStringValue() - Web APIs
the setstringvalue() method of the cssprimitivevalue interface is used to set a string value.
... if the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a domexception will be raised.
... syntax cssprimitivevalue.setstringvalue(stringtype, stringvalue); parameters stringtype an unsigned short representing the type of the value.
...And 4 more matches
ConstrainDOMString - Web APIs
the constraindomstring dictionary is used to specify a constraint for a property whose value is a string.
... it allows you to specify one or more exact string values from which one must be the parameter's value, or a set of ideal values which should be used if possible.
... you can also specify a single string (or an array of strings) which the user agent will do its best to match once all more stringent constraints have been applied.
...And 4 more matches
Boolean.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified boolean object.
... syntax bool.tostring() return value 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().
...And 4 more matches
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.
... syntax dateobj.todatestring() return value a string representing the date portion of the given date object in human readable form in english.
...calling tostring() will return the date formatted in a human readable form in english.
...And 4 more matches
Object.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the object.
... syntax obj.tolocalestring() return value a string representing the object.
... description object's tolocalestring returns the result of calling tostring().
...And 4 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.
... syntax str.includes(searchstring[, position]) parameters searchstring a string to be searched for within str.
... position optional the position within the string at which to begin searching for searchstring.
...And 4 more matches
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.
... the padding is applied from the start of the current string.
... syntax str.padstart(targetlength [, padstring]) parameters targetlength the length of the resulting string once the current str has been padded.
...And 4 more matches
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.
... syntax str.repeat(count) parameters count an integer between 0 and +infinity, indicating the number of times to repeat the string.
... return value a new string containing the specified number of copies of the given string.
...And 4 more matches
String.prototype.toLocaleLowerCase() - JavaScript
the tolocalelowercase() method returns the calling string value converted to lower case, according to any locale-specific case mappings.
... return value a new string representing the calling string converted to lower case, according to any locale-specific case mappings.
... a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string.
...And 4 more matches
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).
... syntax str.touppercase() return value a new string representing the calling string converted to upper case.
... exceptions typeerror when called on null or undefined, for example, string.prototype.touppercase.call(undefined).
...And 4 more matches
String.prototype.trimStart() - JavaScript
the trimstart() method removes whitespace from the beginning of a string.
... syntax str.trimstart(); str.trimleft(); return value a new string representing the calling string stripped of whitespace from its beginning (left end).
... description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end.
...And 4 more matches
TypedArray.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the typed array.
... the elements are converted to strings and are separated by a locale-specific string (such as a comma “,”).
... 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.
...And 4 more matches
setValueString - Archive of obsolete content
setvaluestring sets the value of a key, when that value is a string.
... 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".
... value the new string value.
...And 3 more matches
stringbundle - Archive of obsolete content
stringbundles should be placed inside a stringbundleset element.
... 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.
... stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle.
...And 3 more matches
JSVAL_TO_STRING
cast a jsval to type jsstring * without a type check.
... syntax jsstring * jsval_to_string(jsval v); description jsval_to_string casts the argument, v, to type jsstring *.
... as a precondition, jsval_is_string(v) must be true.
...And 3 more matches
JS_FileEscapedString
this article covers features introduced in spidermonkey 1.8.5 write string into file with escaping.
... syntax bool js_fileescapedstring(file *fp, jsstring *str, char quote); name type description fp file * a file pointer to write into.
... str jsstring * a string to write into the file.
...And 3 more matches
JS_GetLatin1InternedStringChars
this article covers features introduced in spidermonkey 38 get the chars of an interned string.
... syntax const js::latin1char * js_getlatin1internedstringchars(const js::autocheckcannotgc &nogc, jsstring *str); const char16_t * js_gettwobyteinternedstringchars(const js::autocheckcannotgc &nogc, jsstring *str); name type description cx jscontext * a context.
... str jsstring * a string to get characters.
...And 3 more matches
JS_InternJSString
this article covers features introduced in spidermonkey 1.8.5 make a string to interned string.
... syntax jsstring * js_internjsstring(jscontext *cx, js::handlestring str); name type description cx jscontext * the context.
... str js::handlestring a string to be interned.
...And 3 more matches
JS_RemoveExternalStringFinalizer
unregister a custom string memory manager.
... syntax int js_removeexternalstringfinalizer(jsstringfinalizeop finalizer); name type description finalizer jsstringfinalizeop the finalizer to remove.
... as with js_addexternalstringfinalizer, there is a threading restriction if you compile the engine js_threadsafe: this function may be called for a given finalizer pointer on only one thread; different threads may call to remove distinct finalizers safely.
...And 3 more matches
STRING_TO_JSVAL
casts a specified js string to a js value.
... please use js::stringvalue instead in spidermonkey 45 or later.
... syntax jsval string_to_jsval(jsstring *str) name type description obj jsstring * a pointer to a js string to convert to a jsval.
...And 3 more matches
nsEmbedCString
« xpcom api reference summary constructors for nsembedcstring.
... nsembedcstring(); explicit nsembedcstring( const self_type& astring ); parameters astring [in] a nsembedcstring to copy into this string.
... nsembedcstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsacstring to copy into this string.
...And 3 more matches
nsEmbedString
« xpcom api reference summary constructors for nsembedstring.
... nsembedstring(); explicit nsembedstring( const self_type& astring ); parameters astring [in] a nsembedstring to copy into this string.
... nsembedstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsastring to copy into this string.
...And 3 more matches
NS_CStringSetDataRange
« xpcom api reference summary the ns_cstringsetdatarange function copies data into a section of the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_cstringsetdatarange( nsacstring& astring, pruint32 acutstart, pruint32 acutlength, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify.
... adata [in] a raw character array to copy into this string.
...And 3 more matches
NS_StringGetData
« xpcom api reference summary the ns_stringgetdata function gives the caller access to the string's internal buffer.
... #include "nsstringapi.h" pruint32 ns_stringgetdata( const nsastring& astring, const prunichar** adata, prbool* aterminated ); parameters astring [in] a nsastring instance to inspect.
... adata [out] a const pointer to the string's internal buffer.
...And 3 more matches
NS_StringSetDataRange
« xpcom api reference summary the ns_stringsetdatarange function copies data into a section of the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_stringsetdatarange( nsastring& astring, pruint32 acutstart, pruint32 acutlength, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify.
...adata [in] a raw character array to copy into this string.
...And 3 more matches
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.
... syntax urlsearchparams.tostring() parameters none.
...And 3 more matches
Date.prototype.toTimeString() - JavaScript
the totimestring() method returns the time portion of a date object in human readable form in american english.
... syntax dateobj.totimestring() return value a string representing the time portion of the given date in human readable form in american english.
...calling tostring() will return the date formatted in a human readable form in american english.
...And 3 more matches
Error.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified error object.
... syntax e.tostring() return value a string representing the specified error object.
... description the error object overrides the object.prototype.tostring() method inherited by all objects.
...And 3 more matches
Intl.Locale.prototype.toString() - JavaScript
the intl.locale.prototype.tostring() returns the locale's full locale identifier string.
... syntax locale.tostring() return value the locale's unicode locale identifier string.
...information about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string.
...And 3 more matches
String.prototype.charCodeAt() - JavaScript
syntax str.charcodeat(index) parameters index an integer greater than or equal to 0 and less than the length of the string.
... because of this, in order to examine (or reproduce) the full character for individual character values of 65536 or greater, for such characters, it is necessary to retrieve not only charcodeat(i), but also charcodeat(i+1) (as if manipulating a string with two letters), or to use codepointat(i) instead.
... charcodeat() returns nan if the given index is less than 0, or if it is equal to or greater than the length of the string.
...And 3 more matches
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.
... syntax str.endswith(searchstring[, length]) parameters searchstring the characters to be searched for at the end of str.
... return value true if the given characters are found at the end of the string; otherwise, false.
...And 3 more matches
String.prototype.fontcolor() - JavaScript
the fontcolor() method creates a <font> html element that causes a string to be displayed in the specified font color.
... syntax str.fontcolor(color) parameters color a string expressing the color as a hexadecimal rgb triplet or as a string literal.
... string literals for color names are listed in the css color reference.
...And 3 more matches
String.prototype.trimEnd() - JavaScript
the trimend() method removes whitespace from the end of a string.
... syntax str.trimend(); str.trimright(); return value a new string representing the calling string stripped of whitespace from its (right) end.
... description the trimend() / trimright() methods return the string stripped of whitespace from its right end.
...And 3 more matches
Symbol.toStringTag - JavaScript
the symbol.tostringtag well-known symbol is a string valued property that is used in the creation of the default string description of an object.
... it is accessed internally by the object.prototype.tostring() method.
... property attributes of symbol.tostringtag writable no enumerable no configurable no examples default tags object.prototype.tostring.call('foo'); // "[object string]" object.prototype.tostring.call([1, 2]); // "[object array]" object.prototype.tostring.call(3); // "[object number]" object.prototype.tostring.call(true); // "[object boolean]" object.prototype.tostring.call(undefined); // "[object undefined]" object.prototype.tostring.call(null); // "[o...
...And 3 more matches
substring-after - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring-after function returns a string that is the rest of a given string after a given substring.
... syntax substring-after(haystack ,needle ) arguments haystack the string to be evaluated.
... part of this string will be returned.
...And 3 more matches
substring-before - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring-before function returns a string that is the part of a given string before a given substring.
... syntax substring-before(haystack ,needle ) arguments haystack the string to be evaluated.
... part of this string will be returned.
...And 3 more matches
substring - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring function returns a part of a given string.
... syntax substring(string ,start [,length] ) arguments string the string to evaluate.
... start the position withinstring the substring begins length(optional) the length of the substring.
...And 3 more matches
toString - Archive of obsolete content
summary converts an installversion init object to a string.
... 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.
... returns the major, minor, revision, and build numbers represented as a single string.
...And 2 more matches
getString - Archive of obsolete content
getstring retrieves a value from a .ini file.
... 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".
... returns the value of the key or an empty string if none was found.
...And 2 more matches
getValueString - Archive of obsolete content
getvaluestring retrieves the value of a key when that value is a string.
... 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".
... returns a string representing the value of the named value-name/value pair or null if there's an error, the value is not found, or the value is not a string.
...And 2 more matches
NPN_GetStringIdentifiers - Archive of obsolete content
syntax #include <npruntime.h> void npn_getstringidentifiers(const nputf8 **names, int32_t namecount, npidentifier *identifiers); parameters the function has the following parameters: names an array of strings for which opaque identifiers should be returned.
... namecount the number of strings in the names array.
... identifiers a pointer to the first element of an array to fill with the identifiers for the strings specified by names.
...And 2 more matches
PL_CompareStrings
compares two character strings.
... syntax #include <plhash.h> printn pl_comparestrings( const void *v1, const void *v2); description pl_comparestrings compares v1 and v2 as character strings using strcmp.
... if the two strings are equal, it returns 1.
...And 2 more matches
JSString
a jsstring represents a primitive javascript string in the jsapi.
... conceptually, a javascript string is just an array of char16_t characters and a length.
... you should not rely on the structure of jsstring, because it is subject to change; instead, treat jsstring objects as opaque.
...And 2 more matches
JSStringFinalizer
this article covers features introduced in spidermonkey 17 finalize external strings created by js_newexternalstring.
... syntax struct jsstringfinalizer { void (*finalize)(const jsstringfinalizer *fin, char16_t *chars); }; name type description fin jsstringfinalizer the finalizer itself.
... chars char16_t * buffer of the external string to be finalized.
...And 2 more matches
JSVAL_IS_STRING
determines if a given jsval is a string.
... syntax jsval_is_string(v) description jsval_is_string(v) is true if v is a string.
... to access the content of a string jsval, use jsval_to_string, js_getstringchars, and js_getstringlength.
...And 2 more matches
JS_GetExternalStringClosure
this article covers features introduced in spidermonkey 6 returns the string closure stored in a jsstring created by calling js_newexternalstringwithclosure.
... syntax void * js_getexternalstringclosure(jscontext *cx, jsstring *str); name type description cx jscontext * the context from which to retrieve the closure for a string.
... str jsstring * the string for which to return the closure.
...And 2 more matches
JS_GetInternedStringChars
this article covers features introduced in spidermonkey 1.8.5 get the chars of an interned string.
... syntax const jschar * js_getinternedstringchars(jsstring *str); const jschar * js_getinternedstringcharsandlength(jsstring *str, size_t *length); name type description str jsstring * the interned string.
...receives the length of the string.
...And 2 more matches
JS_GetLatin1FlatStringChars
this article covers features introduced in spidermonkey 38 get the chars of a flat string.
... syntax const js::latin1char * js_getlatin1flatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); const char16_t * js_gettwobyteflatstringchars(const js::autocheckcannotgc &nogc, jsflatstring *str); name type description cx jscontext * a context.
... str jsflatstring * a string to get characters.
...And 2 more matches
JS_GetStringCharsAndLength
this article covers features introduced in spidermonkey 1.8.5 get the characters and the length of a string.
... syntax const jschar * js_getstringcharsandlength(jscontext *cx, jsstring *str, size_t *length); name type description cx jscontext * the context.
... str jsstring * a string to get characters.
...And 2 more matches
JS_GetTwoByteExternalStringChars
this article covers features introduced in spidermonkey 38 get the chars of an external string.
... syntax const char16_t * js_gettwobyteexternalstringchars(jsstring *str); name type description str jsstring * a string to get characters.
... description js_gettwobyteexternalstringchars gets the characters of the string, str.
...And 2 more matches
JS_PutEscapedString
this article covers features introduced in spidermonkey 1.8.5 write a string into buffer with escaping.
... syntax size_t js_putescapedstring(jscontext *cx, char *buffer, size_t size, jsstring *str, char quote); size_t js_putescapedflatstring(char *buffer, size_t size, jsflatstring *str, char quote); name type description cx jscontext * a context.
... str jsstring * or jsflatstring * a string to write into the file.
...And 2 more matches
nsISupportsCString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for ascii character strings.
... 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.
...And 2 more matches
nsISupportsString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for unicode character strings.
... 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.
...And 2 more matches
CSSPrimitiveValue.getStringValue() - Web APIs
the getstringvalue() method of the cssprimitivevalue interface is used to get a string value.
... if this css value doesn't contain a string value, a domexception is raised.
... syntax var stringvalue = cssprimitivevalue.getstringvalue(); return value a string value.
...And 2 more matches
FileReaderSync.readAsBinaryString() - Web APIs
the readasbinarystring() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring.
... syntax readasbinarystring(file); readasbinarystring(blob); parameters blob the dom file or blob to read.
... return value an domstring representing the input data.
...And 2 more matches
Range.toString() - Web APIs
WebAPIRangetoString
the range.tostring() method is a stringifier returning the text of the range.
... alerting the contents of a range makes an implicit tostring() call, so comparing range and text through an alert dialog is ineffective.
... syntax text = range.tostring(); example html <p>this example logs <b>everything</b> between the bold <b>words</b>.
...And 2 more matches
SVGAnimatedString - Web APIs
the svganimatedstring interface represents string attributes which can be animated from each svg declaration.
... properties svganimatedstring.animval read only this is a domstring representing the animation value.
... svganimatedstring.baseval this is a domstring representing the base value.
...And 2 more matches
Selection.toString() - Web APIs
the selection.tostring() method returns a string currently being represented by the selection object, i.e.
... syntax sel.tostring() return value a string representing the selection.
... 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.
...And 2 more matches
USVString - Web APIs
WebAPIUSVString
usvstring corresponds to the set of all possible sequences of unicode scalar values.
... usvstring maps to a string when returned in javascript; it's generally only used for apis that perform text processing and need a string of unicode scalar values to operate on.
... usvstring is equivalent to domstring except for not allowing unpaired surrogate codepoints.
...And 2 more matches
XMLSerializer.serializeToString() - Web APIs
the xmlserializer method serializetostring() constructs a string representing the specified dom tree in xml form.
... syntax xmlstring = anxmlserializer.serializetostring(rootnode); parameters rootnode the node to use as the root of the dom tree or subtree for which to construct an xml representation.
... return value a domstring containing the xml representation of the specified dom tree.
...And 2 more matches
XPathResult.stringValue - Web APIs
the read-only stringvalue property of the xpathresult interface returns the string value of a result with xpathresult.resulttype being string_type.
... syntax var value = result.stringvalue; return value the return value is the string value of the xpathresult returned by document.evaluate().
... exceptions type_err in case xpathresult.resulttype is not string_type, an xpathexception of type type_err is thrown.
...And 2 more matches
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).
... syntax dateobj.toisostring() return value a string representing the given date in the iso 8601 format according to universal time.
...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 = ...
...And 2 more matches
Date.prototype.toUTCString() - JavaScript
the toutcstring() method converts a date to a string, using the utc time zone.
... based on rfc7231 and modified according to ecma-262 toutcstring, it can have negative values in the 2021 version the source for this interactive example is stored in a github repository.
... syntax dateobj.toutcstring() return value a string representing the given date using the utc time zone.
...And 2 more matches
RegExp.prototype.toString() - JavaScript
the tostring() method returns a string representing the regular expression.
... syntax regexobj.tostring(); return value a string representing the given object.
... description the regexp object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring().
...And 2 more matches
String() constructor - JavaScript
the string constructor is used to create a new string object.
... syntax new string(thing) string(thing) parameters thing anything to be converted to a string.
... examples string constructor and string function string function and string constructor produce different results: typeof string('hello world'); // string typeof new string('hello world'); // object here, the function produces a string (the primitive type) as promised.
...And 2 more matches
String.prototype.fontsize() - JavaScript
the fontsize() method creates a <font> html element that causes a string to be displayed in the specified font size.
... syntax str.fontsize(size) parameters size an integer between 1 and 7, a string representing a signed integer between 1 and 7.
... return value a string containing a <font> html element.
...And 2 more matches
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.
... syntax str.link(url) parameters url any string that specifies the href attribute of the <a> tag; it should be a valid url (relative or absolute), with any & characters escaped as &amp;, and any " characters escaped as &quot;.
... return value a string containing an <a> html element.
...And 2 more matches
String.prototype.search() - JavaScript
the search() method executes a search for a match between a regular expression and this string object.
... return value the index of the first match between the regular expression and the given string, or -1 if no match was found.
... description when you want to know whether a pattern is found, and also know its index within a string, use search().
...And 2 more matches
String.prototype.sub() - JavaScript
the sub() method creates a <sub> html element that causes a string to be displayed as subscript.
... syntax str.sub() return value a string containing a <sub> html element.
... description the sub() method embeds a string in a <sub> tag: "<sub>str</sub>".
...And 2 more matches
String.prototype.toLowerCase() - JavaScript
the tolowercase() method returns the calling string value converted to lower case.
... syntax str.tolowercase() return value a new string representing the calling string converted to lower case.
... description the tolowercase() method returns the value of the string converted to lower case.
...And 2 more matches
String.prototype.trim() - JavaScript
the trim() method removes whitespace from both ends of a string.
... syntax str.trim() return value a new string representing the str stripped of whitespace from both ends.
... description the trim() method returns the string stripped of whitespace from both ends.
...And 2 more matches
String.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a string object.
... syntax str.valueof() return value a string representing the primitive value of a given string object.
... description the valueof() method of string returns the primitive value of a string object as a string data type.
...And 2 more matches
Symbol.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified symbol object.
... syntax symbol().tostring() return value 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().
...And 2 more matches
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.
... example to set the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.ini"); ini.writestring ("desktop", "wallpaper", "newpathname"); ...
NPN_GetStringIdentifier - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary returns an opaque identifier for the string that is passed in.
... syntax #include <npruntime.h> npidentifier npn_getstringidentifier(const nputf8 *name); parameters the function has the following parameters: <tt>name</tt> the string for which an opaque identifier should be returned.
... returns an npidentifier identifying the string.
... description all calls for the same string are guaranteed to return the same exact identifier.
NPString - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npstring is a struct that holds a pointer to a sequence of 8-bit units (nputf8) making up a utf-8 string, and the number of 8-bit units in the utf-8 string.
... note: whenever an npstring owns its string data and the data may be released through a call to npn_releasevariantvalue(), the string data must be allocated using npn_memalloc().
... syntax typedef struct _npstring { const nputf8 *utf8characters; uint32_t utf8length; } npstring; fields the data structure has the following fields: utf8characters an array of the utf-8 characters comprising the string.
... utf8length the number of bytes in the utf-8 string (not the number of characters).
PR_ExportFileMapAsString
creates a string identifying a prfilemap.
... syntax #include <prshma.h> nspr_api( prstatus ) pr_exportfilemapasstring( prfilemap *fm, prsize bufsize, char *buf ); define pr_filemap_string_bufsize 128 parameters the function has the following parameters: fm a pointer to the prfilemap to be represented as a string.
... bufsize sizeof(buf) buf a pointer to abuffer of length pr_filemap_string_bufsize.
... returns prstatus description creates an identifier, as a string, from a prfilemap object previously created with pr_openanonfilemap.
PR_NetAddrToString
converts a character string to a network address.
... syntax #include <prnetdb.h> prstatus pr_netaddrtostring( const prnetaddr *addr, char *string, pruint32 size); parameters the function has the following parameters: addr a pointer to the network address to be converted.
... string a buffer that will hold the converted string on output.
... size the size of the result buffer (string).
PR_StringToNetAddr
converts a character string to a network address.
... syntax #include <prnetdb.h> prstatus pr_stringtonetaddr( const char *string, prnetaddr *addr); parameters the function has the following parameters: string the string to be converted.
... description for ipv4 addresses, the input string represents numbers in the internet standard "." notation.
... ipv6 addresses are indicated as strings using ":" characters separating octets, with numerous caveats for shortcutting (see rfc #1884).
JS::GetDeflatedUTF8StringLength
this article covers features introduced in spidermonkey 38 returns the length of the char buffer required to encode given string as utf8.
... syntax size_t getdeflatedutf8stringlength(jsflatstring* s); name type description s jsflatstring * the pointer to the string to calculate the length.
... description js::getdeflatedutf8stringlength returns the length of the char buffer required to encode s as utf8.
... see also js::deflatestringtoutf8buffer bug 1034627 ...
JS::StringValue
this article covers features introduced in spidermonkey 24 convert a jsstring to a js::value.
... syntax js::value js::stringvalue(jsstring* str) name type description str jsstring* a pointer to a jsstring to convert.
... description js::stringvalue converts a given jsstring to js::value.
... see also mxr id search for js::stringvalue js::value ...
JS_ASSERT_STRING_IS_FLAT
this article covers features introduced in spidermonkey 1.8.5 assert a string is flattened.
... syntax static moz_always_inline jsflatstring * js_assert_string_is_flat(jsstring *str) { moz_assert(js_stringisflat(str)); return (jsflatstring *)str; } name type description str jsstring * string to examine.
... description js_assert_string_is_flat asserts the string is flattened, and returns a pointer to jsflatstring.
... see also mxr id search for js_assert_string_is_flat js_stringisflat bug 609440 ...
JS_GetEmptyString
this article covers features introduced in spidermonkey 1.8.5 returns the empty string as a jsstring object.
... syntax jsstring * js_getemptystring(jsruntime *rt); name type description rt jsruntime * the runtime for which to return the empty string.
... description the returned empty string has the length 0.
... see also mxr id search for js_getemptystring js_getstringlength js_getemptystringvalue bug 612150 ...
JS_GetEmptyStringValue
get the empty string as a value of type js::value.
... syntax // added in spidermonkey 42 js::value js_getemptystringvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getemptystringvalue(jscontext *cx); name type description cx jscontext * a context.
... description js_getemptystringvalue returns the empty string as a js::value.
... see also mxr id search for js_getemptystringvalue bug 1184564 -- changed jsval to js::value ...
JS_GetExternalStringFinalizer
this article covers features introduced in spidermonkey 17 get the string finalizer of an external string.
... syntax const jsstringfinalizer * js_getexternalstringfinalizer(jsstring *str); name type description str jsstring * a string to get finalizer.
... description js_getexternalstringfinalizer returns the fin parameter passed to js_newexternalstring.
... see also mxr id search for js_ js_newexternalstring bug 724810 ...
JS_GetFlatStringChars
this article covers features introduced in spidermonkey 1.8.5 get the chars of a flat string.
... use js_flattenstring to flatten the string.
... syntax const jschar * js_getflatstringchars(jsflatstring *str); name type description str jsflatstring * the flattended string returned by js_flattenstring.
... description jsflatstring *fstr = js_flattenstring(cx, str); if (!fstr) return js_false; const jschar *chars = js_getflatstringchars(fstr) js_assert(chars); see also js_flattenstring bug 1037869 ...
JS_IsExternalString
this article covers features introduced in spidermonkey 17 determines whether or not the specified jsstring is an external string (that is, a string created by calling js_newexternalstring rather than js_newexternalstringwithclosure).
... syntax bool js_isexternalstring(jsstring *str); name type description str jsstring * the string to check.
... description js_isexternalstring returns true if the string is an external string; otherwise it's false.
... see also mxr id search for js_isexternalstring bug 651041 ...
JS_StringHasBeenInterned
this article covers features introduced in spidermonkey 17 determine if string is interned.
... syntax bool js_stringhasbeeninterned(jscontext *cx, jsstring *str); name type description str jsstring * a string to examine.
... description js_stringhasbeeninterned returns true if the string str is interned.
... see also mxr id search for js_stringhasbeeninterned bug 724810 ...
JS_StringIsFlat
this article covers features introduced in spidermonkey 38 determine if a string is flattened.
... syntax bool js_stringisflat(jsstring *str); name type description str jsstring * string to examine.
... description js_stringisflat returns true if the string is flattened.
... see also mxr id search for js_stringisflat bug 1037869 ...
JS_StringToVersion
returns a jsversion value representing the version string.
... syntax jsversion js_stringtoversion(const char *string); name type description string const char * version string to convert.
... description js_stringtoversion attempts to convert the version string to a jsversion value.
... js_stringtoversion may return any of the following values: string enumeration "1.0" jsversion_1_0 obsolete since jsapi 24 "1.1" jsversion_1_1 obsolete since jsapi 24 "1.2" jsversion_1_2 obsolete since jsapi 24 "1.3" jsversion_1_3 obsolete since jsapi 24 "1.4" jsversion_1_4 obsolete since jsapi 24 "ecmav3" jsversion_ecma_3 "1.5" jsversion_1_5 obsolete since jsapi 24 "1.6" jsversion_1_6 "1.7" jsversion_1_7 "1.8" jsversion_1_8 other jsversion_unknown see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_versiontostring bug 824312 ...
JS_VersionToString
returns a string representation of a jsversion value.
... syntax const char * js_versiontostring(jsversion version); name type description version jsversion version value to convert.
... description js_versiontostring attempts to convert the version to a const char * string representation.
... js_versiontostring may return any of the following values: enumeration string jsversion_1_0 "1.0" obsolete since jsapi 24 jsversion_1_1 "1.1" obsolete since jsapi 24 jsversion_1_2 "1.2" obsolete since jsapi 24 jsversion_1_3 "1.3" obsolete since jsapi 24 jsversion_1_4 "1.4" obsolete since jsapi 24 jsversion_ecma_3 "ecmav3" jsversion_1_5 "1.5" obsolete since jsapi 24 jsversion_1_6 "1.6" jsversion_1_7 "1.7" jsversion_1_8 "1.8" jsversion_ecma_5 "ecmav5" jsversion_default "default" other null see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_stringtoversion bug 824312 ...
NS_CStringCloneData
« xpcom api reference summary the ns_cstringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.
... #include "nsstringapi.h" char* ns_cstringclonedata( const nsacstring& astring ); parameters astring [in] a nsacstring instance whose data is to be cloned.
... return values the ns_cstringcutdata function returns a pointer to a null-terminated, heap allocated buffer on success.
... see also nsmemory::free, nsacstring ...
NS_StringCloneData
« xpcom api reference summary the ns_stringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.
... #include "nsstringapi.h" prunichar* ns_stringclonedata( const nsastring& astring ); parameters astring [in] a nsastring instance whose data is to be cloned.
... return values the ns_stringcutdata function returns a pointer to a null-terminated, heap allocated buffer on success.
... see also nsmemory::free, nsastring ...
NS_StringContainerFinish
« xpcom api reference summary the ns_stringcontainerfinish function releases any memory allocated by a nsstringcontainer instance.
... #include "nsstringapi.h" void ns_stringcontainerfinish( nsstringcontainer& astring ); parameters astring [in] a nsstringcontainer instance that is no longer needed.
... example code see ns_stringcontainerinit for an example.
... see also ns_stringcontainerinit ...
CSSOMString - Web APIs
cssomstring is used to denote string data in cssom specifications and can refer to either domstring or usvstring.
... when a specification says cssomstring, it depends on the browser vendors to choose whether to use domstring or usvstring.
... while browser implementations that use utf-8 internally to represent strings in memory can use usvstring when the specification says cssomstring, implementations that already represent strings as 16-bit sequences might choose to use domstring instead.
... implementation differences browser domstring or usvstring for cssomstring firefox (gecko) usvstring chrome (blink) usvstring safari (webkit) usvstring edge (edgehtml) - opera (blink) usvstring specifications specification status comment css object model (cssom)the definition of 'cssomstring' in that specification.
DOMString - Web APIs
WebAPIDOMString
domstring is a utf-16 string.
... as javascript already uses such strings, domstring is mapped directly to a string.
... passing null to a method or parameter accepting a domstring typically stringifies to "null".
... specifications specification status comment web idlthe definition of 'domstring' in that specification.
DOMStringList - Web APIs
a type returned by some apis which contains a list of domstring (strings).
... properties domstringlist.length read only returns the length of the list.
... methods domstringlist.item() returns a domstring.
... domstringlist.contains() returns boolean indicating if the given string is in the list specifications specification status comment html living standardthe definition of 'domstringlist' in that specification.
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.
... syntax speechgrammarlistinstance.addfromstring(string,weight); returns void.
... parameters string a domstring representing the grammar to be added.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'addfromstring()' in that specification.
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.
... syntax str.anchor(name) parameters name a string representing a name value to put into the generated <a name="..."> start tag.
... return value a string beginning with an <a name="name"> start tag, then the text str, and then an </a> end tag description don't use this method.
... examples using anchor() var mystring = 'table of contents'; document.body.innerhtml = mystring.anchor('contents_anchor'); will output the following html: <a name="contents_anchor">table of contents</a> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.anchor' in that specification.
String.prototype.big() - JavaScript
the big() method creates a <big> html element that causes a string to be displayed in a big font.
... syntax str.big() return value a string containing a <big> html element.
... 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.
... syntax str.blink() return value a string containing a <blink> html element.
... 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.
... syntax str.bold() return value a string containing a <b> html element.
... 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.codePointAt() - JavaScript
polyfill the following extends strings to include the codepointat() function as specified in ecmascript 2015 for browsers without native support.
...https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineproperty = (function() { // ie 8 only supports `object.defineproperty` on dom elements try { var object = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catch(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.length; // `tointeger` var index = position ?
... number(position) : 0; if (index != index) { // better `isnan` index = 0; } // account for out-of-bounds indices: if (index < 0 || index >= size) { return undefined; } // get the first code unit var first = string.charcodeat(index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charcodeat(index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; ...
... }; if (defineproperty) { defineproperty(string.prototype, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.prototype.codepointat = codepointat; } }()); } examples using codepointat() 'abc'.codepointat(1) // 66 '\ud800\udc00'.codepointat(0) // 65536 'xyz'.codepointat(42) // undefined looping with codepointat() for (let codepoint of '\ud83d\udc0e\ud83d\udc71\u2764') { console.log(codepoint.codepointat(0).tostring(16)) } // '1f40e', '1f471', '2764' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.codepointat' 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.
... syntax str.fixed() return value a string representing a <tt> html element.
... 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.prototype.italics() - JavaScript
the italics() method creates an <i> html element that causes a string to be italic.
... syntax str.italics() return value a string containing a <i> html element.
... 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.matchAll() - JavaScript
the matchall() method returns an iterator of all results matching a string against a regular expression, including capturing groups.
... const regexp = regexp('[a-c]',''); const str = 'abc'; str.matchall(regexp); // typeerror matchall internally makes a clone of the regexp—so, unlike regexp.exec(), lastindex does not change as the string is scanned.
... const regexp = regexp('[a-c]','g'); regexp.lastindex = 1; const str = 'abc'; array.from(str.matchall(regexp), m => `${regexp.lastindex} ${m[0]}`); // array [ "1 b", "1 c" ] better access to capturing groups (than string.prototype.match()) another compelling reason for matchall is the improved access to capture groups.
...tr.match(regexp); // array ['test1', 'test2'] using matchall, you can access capture groups easily: let array = [...str.matchall(regexp)]; array[0]; // ['test1', 'e', 'st1', '1', index: 0, input: 'test1test2', length: 4] array[1]; // ['test2', 'e', 'st2', '2', index: 5, input: 'test1test2', length: 4] specifications specification ecmascript (ecma-262)the definition of 'string.prototype.matchall' in that specification.
String.prototype.small() - JavaScript
the small() method creates a <small> html element that causes a string to be displayed in a small font.
... syntax str.small() return value a string containing a <small> html element.
... 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.
... syntax str.strike() return value a string containing a <strike> html element.
... 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.sup() - JavaScript
the sup() method creates a <sup> html element that causes a string to be displayed as superscript.
... syntax str.sup() return value a string containing a <sup> html element.
... 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-length - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the string-length function returns a number equal to the number of characters in a given string.
... syntax string-length( [string] ) arguments string(optional) the string to evaluate.
... if omitted, string used will be the same as the context node converted to a string.
... returns an integer equal to the number of characters in the string.
NPN_IdentifierIsString - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not an identifier is a string.
... syntax #include <npruntime.h> bool npn_identifierisstring(npidentifier identifier); parameters the function has the following parameter: <tt>identifier</tt> the identifier whose type is to be examined.
... returns true if the identifier is a string identifier, or false otherwise.
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 (").
... syntax str.quote() return value a new string representing the original string wrapped in double-quotes, with any special characters escaped.
... examples using quote in the table below the quote() method replaces any special characters and wraps the strings in double-quotes.
String - MDN Web Docs Glossary: Definitions of Web-related terms
in any computer programming language, a string is a sequence of characters used to represent text.
... in javascript, a string is one of the primitive values and the string object is a wrapper around a string primitive.
... learn more general knowledge string (computer science) on wikipedia javascript data types and data structures ...
PL_HashString
a general-purpose hash function for character strings.
... syntax #include <plhash.h> plhashnumber pl_hashstring(const void *key); parameter the function has the following parameter: key a pointer to a character string.
... description pl_hashstring can be used as the key hash function for a hash table if the key is a character string.
PR_ImportFileMapFromString
creates a prfilemap from an identifying string.
... syntax #include <prshma.h> nspr_api( prfilemap * ) pr_importfilemapfromstring( const char *fmstring ); parameter the function has the following parameter: fmstring a pointer to string created by pr_exportfilemapasstring.
... description pr_importfilemapfromstring creates a prfilemap object from a string previously created by pr_exportfilemapasstring.
String Operations
this chapter describes some of the key nspr functions for manipulating strings.
... libraries built on top of nspr, such as the netscape security libraries, use these functions to manipulate strings.
... if you are copying or examining strings for use by such libraries or freeing strings that were allocated by such libraries, you must use these nspr functions rather than the libc equivalents.
JSErrorFormatString
syntax typedef struct jserrorformatstring { const char *format; uint16_t argcount; int16_t exntype; } jserrorformatstring; name type description format const char * the error format string in ascii.
... description jserrorformatstring is a struct to represent error message and type, returned by js_reporterrornumber function.
... see also mxr id search for jserrorformatstring jsexntype js_reporterrornumber bug 684526 ...
JS_FORGET_STRING_FLATNESS
this article covers features introduced in spidermonkey 1.8.5 convert jsflatstring to jsstring.
... syntax static moz_always_inline jsstring * js_forget_string_flatness(jsflatstring *fstr) { return (jsstring *)fstr; } name type description fstr jsflatstring * a string to convert description js_forget_string_flatness converts jsflatstring * to jsstring *.
... see also mxr id search for js_forget_string_flatness jsflatstring jsstring bug 609440 ...
NS_CStringContainerFinish
« xpcom api reference summary the ns_cstringcontainerfinish function releases any memory allocated by a nscstringcontainer instance.
... #include "nsstringapi.h" void ns_cstringcontainerfinish( nscstringcontainer& astring ); parameters astring [in] a nscstringcontainer instance that is no longer needed.
... see also ns_cstringcontainerinit, ns_cstringcontainerinit2 ...
Access StringBundle from Overlay
stringbundles are handy for localizing your project by removing all of your strings into a separate, easy to access text file.
...the most efficient way to append these strings is by attaching them to an existing stringbundleset as such: <stringbundleset id="stringbundleset"> <stringbundle src="chrome://your_extension/locale/overlay.properties" id="your-extension-strings" /> </stringbundleset> now that your stringbundle is attached you can access it from javascript as follows: var str = document.getelementbyid("your-extension-strings"); //get the stringbundle object itself str.getstring("propertyname"); //get a string (and do something with it) alternative way let stringbundleservice = cc["@mozilla.org/intl/stringbundle;1"].getservice(ci.nsistringbundleservice); let bundle = string...
...bundleservice.createbundle("chrome://your_extension/locale/overlay.properties"); let str = bundle.getstringfromname("propertyname"); see nsistringbundleservice ...
ByteString - Web APIs
bytestring is a utf-8 string that corresponds to the set of all possible sequences of bytes.
... bytestring maps to a string when returned in javascript; generally, it's only used when interfacing with protocols that use bytes and strings interchangably, such as http.
... specifications specification status comment web idlthe definition of 'bytestring' in that specification.
FileReader.readAsBinaryString() - Web APIs
the readasbinarystring method is used to start reading the contents of the specified blob or file.
... syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read.
...); var height = 200; var width = 200; canvas.width = width; canvas.height = height; var ctx = canvas.getcontext('2d'); ctx.strokestyle = '#090'; ctx.beginpath(); ctx.arc(width/2, height/2, width/2 - width/10, 0, math.pi*2); ctx.stroke(); canvas.toblob(function (blob) { var reader = new filereader(); reader.onload = function () { console.log(reader.result); } reader.readasbinarystring(blob); }); specifications specification status comment file apithe definition of 'readasbinarystring' in that specification.
URL.toString() - Web APIs
WebAPIURLtoString
the url.tostring() stringifier method returns a usvstring containing the whole url.
... syntax const href = url.tostring() return value a usvstring.
... examples const url = new url("/docs/web/api/url/tostring"); url.tostring(); // should return the url as a string specifications specification status comment urlthe definition of 'stringifier' in that specification.
URLUtilsReadOnly.toString() - Web APIs
the urlutilsreadonly.tostring() stringifier method returns a domstring containing the whole url.
... syntax string = object.tostring(); examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.tostring(); // returns:'https://developer.mozilla.org/urlutilsreadonly.href' browser compatibility the compatibility table in this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettostring experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support nowebview android no support nochrome android no sup...
Strings (str) - EXSLT
WebEXSLTstr
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt strings package provides functions that allow the manipulation of strings.
... the namespace for the strings package is http://exslt.org/strings.
... str:concat()str:concat() returns a string containing all the string values in a node-set concatenated together.str:split()str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.str:tokenize()str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.
String.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax string.tosource() str.tosource() return value a string representing the source code of the calling object.
... examples native function for the built-in string object, tosource() returns the following string indicating that the source code is not available: function string() { [native code] } for instances of string or string literals, tosource() returns a string representing the source code.
Mozilla external string guide
the mozilla codebase used to have a notion of "external" strings, which were the string classes visible to code outside of the mozilla codebase (extensions, xulrunner applications, and embedders).
...the only remaining string classes are the "internal" ones, which are documented xpcom guide internal strings.
DOMStringMap - Web APIs
the domstringmap interface is used for the htmlelement.dataset attribute, to represent data for custom attributes added to elements.
... specifications specification status comment html living standardthe definition of 'domstringmap' in that specification.
HTMLHyperlinkElementUtils.toString() - Web APIs
the htmlhyperlinkelementutils.tostring() stringifier method returns a usvstring containing the whole url.
... syntax string = object.tostring(); examples // let's imagine an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils/tostring"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.tostring(); // returns: 'https://developer.mozilla.org/docs/htmlhyperlinkelementutils/tostring' specifications specification status comment html living standard living standard ...
Location: toString() - Web APIs
WebAPILocationtoString
the tostring() stringifier method of the location interface returns a usvstring containing the whole url.
... syntax string = object.tostring(); examples // let's imagine an <a id="myanchor" href="https://developer.mozilla.org/docs/location/tostring"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.tostring(); // returns: 'https://developer.mozilla.org/docs/location/tostring' specifications specification status comment html living standard living standard ...
Map.prototype[@@toStringTag] - JavaScript
the map[@@tostringtag] property has an initial value of "map".
... property attributes of map.prototype[@@tostringtag] writable no enumerable no configurable yes syntax map[symbol.tostringtag] examples using tostringtag object.prototype.tostring.call(new map()) // "[object map]" specifications specification ecmascript (ecma-262)the definition of 'map.prototype[@@tostringtag]' in that specification.
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.
...or](); console.log(striter.next().value); // "a" console.log(striter.next().value); // "\ud835\udc68" using [@@iterator]() with for..of var str = 'a\ud835\udc68b\ud835\udc69c\ud835\udc6a'; for (var v of str) { console.log(v); } // "a" // "\ud835\udc68" // "b" // "\ud835\udc69" // "c" // "\ud835\udc6a" specifications specification ecmascript (ecma-262)the definition of 'string.prototype[@@iterator]()' in that specification.
string - SVG: Scalable Vector Graphics
WebSVGAttributestring
the string attribute is a hint to the user agent, and specifies a list of formats that the font referenced by the parent <font-face-uri> element supports.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'string' in that specification.
String Rosetta Stone - Archive of obsolete content
find a substring nsstring findinreadable(const nsastring& pattern, nsastring::const_iterator start, nsastring::const_iterator end, nsstringcomparator& acomparator = nsdefaultstringcomparator()) std::string size_type find(const basic_string& s, size_type pos = 0) const size_type find(const chart* s, size_type pos, size_type n) const size_type find(const chart* s, size_type pos = 0) const size_type find(chart c, size_type pos = 0) const qstring int qstring::indexof ( const qstring & str, int from = 0, qt::casesensitivity cs = qt::casesensitive ) const format a printf style string nsstring appendprintf() std::string n/a qstring qstring & qstring::sprintf ( const char * cformat, ...
stringbundle.src - Archive of obsolete content
« xul reference home src type: uri the uri of the property file that contains the localized strings.
getFormattedString - Archive of obsolete content
« xul reference home 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.
getString - Archive of obsolete content
« xul reference home getstring( key ) return type: string returns the string with the given key name from the string bundle.
stringBundle - Archive of obsolete content
« xul reference stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle.
strings - Archive of obsolete content
« xul reference strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle.
stringbundleset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for stringbundle elements.
Floating Point Number to String Conversion
nspr provides functions that convert double-precision floating point numbers to and from their character string representations.
toString
this content is now available at nsisupportscstring.tostring().
toString
this content is now available at nsisupportschar.tostring().
toString
this content is now available at nsisupportsdouble.tostring().
toString
this content is now available at nsisupportsfloat.tostring().
toString
this content is now available at nsisupportsid.tostring().
toString
this content is now available at nsisupportsinterfacepointer.tostring().
toString
this content is now available at nsisupportsprbool.tostring().
toString
this content is now available at nsisupportsprint16.tostring().
toString
this content is now available at nsisupportsprint32.tostring().
toString
this content is now available at nsisupportsprint64.tostring().
toString
this content is now available at nsisupportsprtime.tostring().
toString
this content is now available at nsisupportspruint16.tostring().
toString
this content is now available at nsisupportspruint32.tostring().
toString
this content is now available at nsisupportspruint64.tostring().
toString
this content is now available at nsisupportspruint8.tostring().
toString
this content is now available at nsisupportsstring.tostring().
toString
documentation is now located at nsisupportsvoid.tostring().
Index - Web APIs
WebAPIIndex
30 addresserrors.addressline api, addresserrors, error, payment request, payment request api, property, reference, validation, addressline, payment an object based on addresserrors includes an addressline property when validation of the address finds one or more errors in the array of strings in the address's addressline.
... the returned string explains the error and should offer suggestions for how to correct it.
...the returned string explains the error and should offer suggestions for how to correct it.
...And 455 more matches
Index
MozillaTechXPCOMIndex
35 components.utils.evalinwindow this function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context.
...it also introduces a basic string type that is used with many of the apis in both xpcom and gecko.
... 117 mozilla internal string guide guide, xpcom most of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers.
...And 134 more matches
Index
17 jsapi reference needscontent, spidermonkey js::deflatestringtoutf8buffer 18 boolean_to_jsval jsapi reference, obsolete, spidermonkey boolean_to_jsval converts a bool argument, b, to a boolean jsval.
... 32 js::compilefunction jsapi reference, reference, référence(2), spidermonkey js::compilefunction compiles a function from a text string chars, bytes, or srcbuf.
... 38 js::deflatestringtoutf8buffer jsapi reference, refere, spidermonkey js::deflatestringtoutf8buffer encodes src as utf8.
...And 118 more matches
Localization content best practices
it's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details.
... localization files choose good key ids the ids (names) chosen for your keys, regardless of the file format, should always be descriptive of the string, and its role in the interface (button label, title, etc.).
...for example, suppose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header is definitely a better choice for the new string than new-event-header1.
...And 63 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 aflags, in unsigned short aexpiration); boolean setitemannotatio...
...nstring(in long long aitemid, in autf8string aname, in astring avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint32(in nsiuri auri, in autf8string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint32(in long long aitemid, in autf8string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint64(in nsiuri auri, in autf8string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint64(in long long aitemid, in autf8string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationdouble(in nsiuri auri, in autf8string aname, in double avalue, in long aflags,...
... in unsigned short aexpiration); void setitemannotationdouble(in long long aitemid, in autf8string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setpageannotationbinary(in nsiuri auri, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration); void setitemannotationbinary(in long long aitemid, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration); nsivariant getpageannotation(in nsiuri auri, in autf8string aname); nsivariant getitemannotation(in long long aitemid, in autf8string aname); ...
...And 54 more matches
WebIDL bindings
webidl type argument type return type dictionary/member type any js::handle<js::value> js::mutablehandle<js::value> js::value boolean bool bool bool byte int8_t int8_t int8_t bytestring const nsacstring& nscstring& (outparam) nsacstring& (outparam) nscstring date mozilla::dom::date domstring const nsastring& mozilla::dom::domstring& (outparam) nsastring& (outparam) nsstring& (outparam) nsstring utf8string const nsacstring& nsacstring& (outparam) nscstring double double double double ...
...equence<t>& nstarray<t>& (outparam) short int16_t int16_t int16_t unrestricted double double double double unrestricted float float float float unsigned long uint32_t uint32_t uint32_t unsigned long long uint64_t uint64_t uint64_t unsigned short uint16_t uint16_t uint16_t usvstring const nsastring& mozilla::dom::domstring& (outparam) nsastring& (outparam) nsstring& (outparam) nsstring any any is represented in three different ways, depending on use: any arguments become js::handle<js::value>.
...arg); }; will correspond to these c++ function declarations: float myattr(); void setmyattr(float value); double mymethod(const nullable<double>& arg); domstring strings are reflected in three different ways, depending on use: string arguments become const nsastring&.
...And 45 more matches
nsIVariant
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview acstring getasacstring(); native code only!
... nsresult getasarray(out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr); violates the xpcom interface guidelines astring getasastring(); native code only!
... autf8string getasautf8string(); native code only!
...And 44 more matches
nsIFile
inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility.
... an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform locations retrieved from the directory service.
... all methods with string parameters have two forms.
...And 42 more matches
IME handling guide
it handles native key events before or after focused application (depending on the platform) and creates a composition string (a.k.a.
... preedit string), suggests a list of what the user attempts to input, commits composition string as a selected item off the list and commits composition string without any conversion.
... composition string and clauses typical japanese ime can input two or more words into a composition string.
...And 39 more matches
Starting WebLock
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.
...for example, in the case of the xpcom shutdown observation, asubject and adata are not defined, and atopic is defined as the string "xpcom-shutdown".
... class weblock: public nsiobserver { public: weblock(); virtual ~weblock(); ns_decl_isupports ns_decl_nsiobserver }; ns_impl_isupports1(weblock, nsiobserver); the standard implementation of observe() simply compares the atopic string with the value defined by the event the object is expecting.
...And 39 more matches
Component; nsIPrefBranch
method overview void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void clearuserpref(in string aprefname); void deletebranch(in string astartingat); boolean getboolpref(in string aprefname, requires gecko 54 [optional] in boolean adefaultvalue); string getcharpref(in string aprefname,requires gecko 54 [optional] in string adefaultvalue); requires gecko 58 utf...
...8tring 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); long getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void removeobserver(in string adomain, in nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string...
... aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); requires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); void setintpref(in string aprefname, in long avalue); void unlockpref(in string aprefname); attributes attribute type description root string called to get the root on which this branch is based, such as "browser.startup." read only.
...And 39 more matches
Index - Archive of obsolete content
47 l10n add-on sdk localize strings appearing in the add-on's javascript code.
... 53 private-browsing add-on sdk check whether a given object is private, so an add-on can respect private browsing 54 querystring add-on sdk utility functions for working with query strings.
... 128 util/match-pattern test strings containing urls against simple patterns.
...And 38 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, function acallback); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void end...
...compoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettopindex(); boolean hasfocus(); void settopindex(number atopindex); content management operations number getcharcount(); string getindentationstring(); string getlinedelimiter(); number getlinecount(); number getlineend(number alineindex, boolean aincludedelimiter); number getlinestart(number alineindex); string getmode(); string gettext([optional] number astart, [optional] number aend); string getselectedtext(); void setmode(string amode); void settext(string ...
...ction(); number getcaretoffset(); object getcaretposition(); object getselection(); void setcaretoffset(number aoffset); void setcaretposition(number aline, [optional] number acolumn, [optional] number aalign); void setselection(number astart, number aend); breakpoint management void addbreakpoint(number alineindex, [optional] string acondition); array getbreakpoints(); boolean removebreakpoint(number alineindex); properties attribute type description dirty boolean set this value to false whenever you save the text; the editor will update it to true when the content is changed.
...And 38 more matches
nsIHTMLEditor
inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) method overview void adddefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void addinsertionlistener(in nsicontentfilter infilter); void align(in astring aalign); boolean breakisvisible(in nsidomnode anode); boolean candrag(in nsidomevent aevent); void checkselectionstateforanonymousbuttons(in nsiselection aselection); nsidomelement createanonymouselement(in astring atag, in nsidomnode aparentnode, in astring aanonclass, in boolean aiscreatedhidden); nsidomelement createelementwithdefaults(in astring at...
...agname); void decreasefontsize(); void dodrag(in nsidomevent aevent); void getalignment(out boolean amixed, out short aalign); astring getbackgroundcolorstate(out boolean amixed); nsidomelement getelementorparentbytagname(in astring atagname, in nsidomnode anode); astring getfontcolorstate(out boolean amixed); astring getfontfacestate(out boolean amixed); astring getheadcontentsashtml(); astring gethighlightcolorstate(out boolean amixed); void getindentstate(out boolean acanindent, out boolean acanoutdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in...
... nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignorespuriousdragevent); void increasefontsize(); void indent(in astring aindent); void insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfro...
...And 36 more matches
JXON - Archive of obsolete content
jxontree.prototype.valueof = function () { return this.keyvalue; }; jxontree.prototype.tostring = function () { return string(this.keyvalue); }; jxontree.prototype.getitem = function (nitem) { if (nlength === 0) { return null; } var ncount = 0; for (var skey in this) { if (ncount === nitem) { return this[skey]; } ncount++; } return null; }; jxontree.prototype.getattribute = function (nattrid) { if (nattrlen === 0 || nattrid + 1 > nattrlen) { return null; } var nattr = 0; for (...
...try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "static" nature of an xml document), uncomment the string: /* object.freeze(this); */.
...try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "static" nature of an xml document), uncomment the string: /* object.freeze(this); */.
...And 35 more matches
LiveConnect Overview - Archive of obsolete content
for example, you can create a java string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); in the previous example, the variable mystring is a javaobject because it holds an instance of the java object string.
... as a javaobject, mystring has access to the public instance methods of java.lang.string and its superclass, java.lang.object.
... these java methods are available in javascript as methods of the javaobject, and you can call them as follows: mystring.length(); // returns 11 static members can be called directly on the javaclass object.
...And 35 more matches
nsIDOMWindowUtils
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 createcompositionstringsynth...
...tviapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccoun...
...tscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalstate(); void leavemodalstate(); void loadsheet(in nsiuri sheeturi, in unsigned long type); nsidomnodelist nodesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nscons...
...And 34 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 ...
... assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsautostring data members no public members.
... 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 nsautostring& str nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& ...
...And 33 more matches
NS ConvertASCIItoUTF16 external
stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes nsstring_external data members no public members.
... 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 nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source ...
... parameters prunichar achar adopt void adopt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
...And 33 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...
...nst char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscautostring data members no public members.
... 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= nscautostring& operator=(const nscautostring&) - source parameters nscautostring& str nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsacstring_internal& operator=(const char*) - source parameters char* data nsacstring_internal& operator=(const nsacstring_internal&) - source par...
...And 33 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 ...
... assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsautostring data members no public members.
... 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 nsautostring& str nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& ope...
...And 33 more matches
NS ConvertUTF8toUTF16 external
stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes nsstring_external data members no public members.
... 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 nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source ...
... parameters prunichar achar adopt void adopt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
...And 33 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...
...nst char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscautostring data members no public members.
... 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 nsastring_internal& astring operator= nscautostring& operator=(const nscautostring&) - source parameters nscautostring& str nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsacstring_internal& operator=(const char*) - source parameters char* data nsacstring_internal& operator=(const ...
...And 33 more matches
Text formatting - JavaScript
« previousnext » this chapter introduces how to work with strings and text in javascript.
... strings javascript's string type is used to represent textual data.
...each element in the string occupies a position in the string.
...And 33 more matches
nsIJSON
dom/interfaces/json/nsijson.idlscriptable this interface provides a convenient way to encode and decode json strings from javascript code.
... jsobject decode(in astring str); obsolete since gecko 7.0 jsval decodetojsval(in astring str, in jscontext cx); native code only!
... jsobject decodefromstream(in nsiinputstream stream, in long contentlength); astring encode(in jsobject value); obsolete since gecko 7.0 astring encodefromjsval(in jsvaljsval value, in jscontext cx); native code only!
...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(); boolean haschild(in astring name); boolean hasvalue(in astring name); ...
... boolean iswatching(); void open(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey openchild(in astring relpath, in unsigned long mode); acstring readbinaryvalue(in astring name); unsigned long long readint64value(in astring name); unsigned long readintvalue(in astring name); astring readstringvalue(in astring name); void removechild(in astring relpath); void removevalue(in astring name); void startwatching(in boolean recurse); void stopwatching(); void writebinaryvalue(in astring name, in acstring data); void writeint64value(in astring name, in unsigned long long data); void writeintvalue(in astring name, in unsigned long data); ...
... void writestringvalue(in astring name, in astring data); attributes attribute type description childcount unsigned long this attribute returns the number of child keys.
...And 31 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
quick tip if you must determine if a visitor is using a gecko-based browser, simply test navigator.product == 'gecko' or look for the string 'gecko/' in the navigator.useragent.
... note that some other browsers such as safari are reporting (like gecko) in their user agent strings and can confuse simple tests.
...server side browser detection using user agent strings was born.
...And 30 more matches
NS ConvertUTF16toUTF8 external
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data members no public members.
... 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=(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 pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
NS LossyConvertUTF16toASCII external
truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data members no public members.
... 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 nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - sou...
...rce parameters char achar adopt void adopt(const char*, pruint32) - source parameters char* adata pruint32 alength beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...And 30 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
the formats of the strings that specify these values are described in this article.
... for <input>, the values of type that return a value which contains a string representing a date and/or time are: date datetime datetime-local month time week examples before getting into the intricacies of how date and time strings are written and parsed in html, here are some examples that should give you a good idea what the more commonly-used date and time string formats look like.
... example html date and time strings string date and/or time 2005-06-07 june 7, 2005 [details] 08:45 8:45 am [details] 08:45:25 8:45 am and 25 seconds [details] 0033-08-04t03:40 3:40 am on august 4, 33 [details] 1977-04-01t14:00:30 30 seconds after 2:00 pm on april 1, 1977 [details] 1901-01-01t00:00z midnight utc on january 1, 1901 [details] 1901-01-01t00:00:01-04:00 1 second past midnight eastern standard time (est) on january 1, 1901 [details] basics before looking at the various formats of date and time related strings used by html elements, it is helpful to understand a few fundamental facts about the way they're defined.
...And 30 more matches
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.
... allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false.
... classname domstring gets/sets the value of the element's class attribute.
...And 28 more matches
nsIMsgFolder
n 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); void createstorageifmissing(in nsiurllistener urllistener); void compact(in nsiurllistener alistener, in nsimsgwindow amsgwindow); void compactall(in nsiurllistener alistener, innsimsgwindow amsgwindow,in nsisupportsarray afolderarray, in boolean acompactofflinealso,in nsi...
...supportsarray aofflinefolderarray); void compactallofflinestores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); void emptytrash(in nsimsgwindow amsgwindow, in nsiurllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearrequirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned l...
... void toggleflag(in unsigned long flag); void onflagchange(in unsigned long flag); void setprefflag(); nsimsgfolder getfolderswithflag(in unsigned long flags, in unsigned long resultsize, out unsigned long numfolders); nsisupportsarray getallfolderswithflag(in unsigned long aflag); void getexpansionarray(in nsisupportsarray expansionarray); acstring geturiformsg(in nsimsgdbhdr msghdr); void deletemessages(in nsisupportsarray messages,in nsimsgwindow msgwindow, in boolean deletestorage, in boolean ismove, in nsimsgcopyservicelistener listener, in boolean allowundo); void copymessages(in nsimsgfolder srcfolder, in nsisupportsarray messages,in boolean ismove, in nsimsgwindow msgwindow,in nsimsgcopyservicelistener listener, in ...
...And 28 more matches
nsISessionStore
method overview void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long aindex); nsidomnode forgetclosedwindow(in unsigned long aindex); astring getbrowserstate(); unsigned long getclosedtabcount(in nsi...
...domwindow awindow); astring getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); astring getclosedwindowdata(); astring gettabstate(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindowstate(in nsidomwindow awindow); astring getwindowvalue(in nsidomwindow awindow, in astring akey); void init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void restorelastsession(); void setbrowserstate(in astring astate); void settabstate(in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwindowstate(in nsidomwindow ...
...awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
...And 28 more matches
nsITextInputProcessor
next, you can set the composition string or dispatch keyboard events.
... the following example sets "foo-bar-buzz", "bar" is selected clause to convert, and caret position is the end of the selected clause: // first, sets composition string.
... tip.setpendingcompositionstring("foo-bar-buzz"); // next, append clauses.
...And 28 more matches
url - Archive of obsolete content
globals constructors url(source, base) the url constructor creates an object that represents a url, verifying that the provided string is a valid url in the process.
... any api in the sdk which has a url parameter will accept url objects, not raw strings, unless otherwise noted.
... parameters source : string a string to be converted into a url.
...And 27 more matches
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 makefulladdresswstring(in wstring...
... name, in wstring addr); obsolete since gecko 1.9 void parseheaderaddresses(in string line, out string names, out string addresses, out pruint32 numaddresses); void parseheaderswitharray(in wstring aline, [array, size_is(count)] out wstring aemailaddresses, [array, size_is(count)] out wstring anames, [array, size_is(count)] out wstring afullnames, [retval] out unsigned long count); void reformatheaderaddresses(in string line, out string 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 unquotephraseoraddrwstri...
...ng(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.
...And 27 more matches
HTMLInputElement - Web APIs
formaction string: returns / sets the element's formaction attribute, containing the uri of a program that processes information submitted by the element.
... formenctype string: returns / sets the element's formenctype attribute, containing the type of content that is used to submit the form to the server.
... formmethod string: returns / sets the element's formmethod attribute, containing the http method that the browser uses to submit the form.
...And 27 more matches
Regular expressions - JavaScript
« previousnext » regular expressions are patterns used to match character combinations in strings.
...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.
...for example, the pattern /abc/ matches character combinations in strings only when the exact sequence "abc" occurs (all characters together and in that order).
...And 27 more matches
Grammar and types - JavaScript
string.
... so, for example, you could define a variable as follows: var answer = 42; and later, you could assign the same variable a string value, for example: answer = 'thanks for all the fish...'; because javascript is dynamically typed, this assignment does not cause an error message.
... numbers and the '+' operator in expressions involving numeric and string values with the + operator, javascript converts numeric values to strings.
...And 26 more matches
context-menu - Archive of obsolete content
matchpattern is a match pattern string or an array of match pattern strings.
...these are the same match pattern strings that you use with the page-mod include property.
...in addition to returning true, your "context" listeners can also return strings.
...And 25 more matches
jspage - Archive of obsolete content
terimplement||function(){};var d=f||i;h=h!==false;d.constructor=native;d.$family={name:"native"}; if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.tolowercase();d.prototype.$family={name:e};native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; }if(h){native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); }}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); }return this;};if(c){d.implement(c);}return d;};native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=array.prototype.slice.cal...
...l(arguments); return b.prototype[c].apply(d.shift(),d);};}};native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","indexof","join","lastindexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; fo...
...c=="array"||c=="collection"||c=="arguments")?array.flatten(this[b]):this[b]); }return d;},hextorgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toint(16);});return(b)?a:"rgb("+a+")"; },rgbtohex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).tostring(16); b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); }var e=function(){return a.apply(b.bind||null,c);};if(b.delay){ret...
...And 25 more matches
AddonManager
getinstallforurl(in string url, in installcallback?
... callback, in string mimetype, in string hash, in string name, in string iconurl, in string version, in nsiloadgroup loadgroup) promise?
...callback, in string mimetype) promise?
...And 25 more matches
OS.File for the main thread
example: read the contents of a file as text the following snippet opens a file "file.txt" and read its contents as a string, using the default encoding (utf-8).
... example: write a string to a file the following snippet writes the text "this is some text" to a string "file.txt", using the default encoding (utf-8).
...= yield outfile.write(view.subarray(pos, chunksize)); } outfile.close(); }).then( null, function onfailure(reason) { outfile.close(); throw reason; } ); } example: save canvas to disk this exmaple uses image to load an image from a path (note: if your path is a file on disk you must use local file; this is accomplished with os.path.tofileuri, which accepts a string).
...And 25 more matches
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); void removegroupedprefs(); void rem...
...oveobserver(in astring aname, in nsicontentprefobserver aobserver); void removepref(in nsivariant agroup, in astring aname); void removeprefsbyname(in astring aname); void setpref(in nsivariant agroup, in astring aname, in nsivariant avalue); attributes attribute type description dbconnection mozistorageconnection the database connection to the content preferences database.
...void addobserver( in astring aname, in nsicontentprefobserver aobserver ); parameters aname the name of the preference to observe.
...And 25 more matches
Working with data
if the type represents a javascript string (that is, an array of jschar characters followed by a null terminator), a copy of that string is created and returned.
... if the type is an array of 8-bit characters and value is a utf-16 string, the new cdata object is the result of converting the utf-16 string to utf-8, with a null terminator.
... example: creating an array of strings var cstr1 = ctypes.jschar.array()('rawr'); var cstr2 = ctypes.jschar.array()('boo'); var mycarray_ofstrings = ctypes.jschar.ptr.array(2)([cstr1, cstr2]); // specifying length of 2 is optional, can omit it, so can just do `ctypes.jschar.ptr.array()([cstr1, cstr2])` mycarray_ofstrings.addressofelement(0).contents.readstring(); // outputs: "rawr" mycarray_ofstrings.addressofelement(1).contents.
...And 25 more matches
io/file - Archive of obsolete content
note that if you do decide to hardcode windows-style paths, be sure to escape backslashes in strings.
... for example, to specify the file at c:\users\myk, you need to use the string "c:\\users\\myk", not "c:\users\myk".
... read more about escaping characters in strings.
...And 24 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
strings the most obvious change required by frozen linkage is using the frozen string api.
... - #include "nsastring.h"- #include "nsstring.h"- #include "nsreadableutils.h"- #include "nsescape.h" + #include "nsstringapi.h" on windows, if you see the following error, you are including a header you shouldn't be: nsstringfwd.h(60) : fatal error c1001: internal compiler error to debug this error, make in the failing directory, adding the /showincludes directive to figure out what is being included incorrectly: make -c directory/that/failed os_cppflags=-showincludes the frozen string api is similar but not identical to the nonfrozen string api.
... 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().
...And 24 more matches
Index
to see a usage string, issue the command without options.
...to see a usage string, issue the command without options, or with the -h option.
...bracket the nickname string with quotation marks if it contains spaces.
...And 24 more matches
nsINavBookmarksService
.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 gecko 1.9 obsolete since gecko 13.0 long long createfolder(in long long aparentfolder, in autf8string name, in long index); void endupdatebatch(); obsolete since gecko 1.9 void exportbookmarkshtml(in nsifile file); obsolete since gecko 1.9 nsiuri getbookmarkedurifor(in nsiuri ...
... obsolete since gecko 2.0 nsiuri getbookmarkuri(in long long aitemid); long long getchildfolder(in long long afolder, in astring asubfolder); obsolete since gecko 2.0 long long getfolderidforitem(in long long aitemid); boolean getfolderreadonly(in long long aitemid); astring getfoldertitle(in print64 folder); obsolete since gecko 1.9 nsiuri getfolderuri(in print64 folder); obsolete since gecko 1.9 long long getidforitemat(in long long aparentid, in long aindex); prtim...
...e getitemdateadded(in long long aitemid); astring getitemguid(in long long aitemid); obsolete since gecko 14.0 long long getitemidforguid(in astring aguid); obsolete since gecko 14.0 long getitemindex(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); unsigned short getitemtype(in long long aitemid); astring getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 astring getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri url); obso...
...And 24 more matches
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!
... void createtmpfiletopost(in string apostdataurl, out string atmpfilename); native code only!
... void findproxyforurl(in string aurl, out string aresult); native code only!
...And 24 more matches
nsIPromptService
to get an instance, use: var promptservice = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); method overview void alert(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); void alertcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheckstate); boolean confirm(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); boolean confirmcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boo...
...lean acheckstate); print32 confirmex(in nsidomwindow aparent,in wstring adialogtitle,in wstring atext, in unsigned long abuttonflags,in wstring abutton0title, in wstring abutton1title,in wstring abutton2title,in wstring acheckmsg, inout boolean acheckstate); boolean prompt(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring avalue, in wstring acheckmsg, inout boolean acheckstate); boolean promptusernameandpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean promptpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring apassword, in wstring acheckmsg, inout boolean ac...
...heckstate); boolean select(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pruint32 acount, [array, size_is(acount)] in wstring aselectlist, out long aoutselection); constants the following flags are combined to form the abuttonflags parameter passed to confirmex.
...And 24 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
javascript's types are: number string boolean function object symbol (new in es2015) ...
...so the type diagram looks more like this: number string boolean symbol (new in es2015) object function array date regexp null undefined and there are some built-in error types as well.
...there's also a built-in object that we did not mention earlier called math that provides advanced mathematical functions and constants: math.sin(3.5); var circumference = 2 * math.pi * r; you can convert a string to an integer using the built-in parseint() function.
...And 24 more matches
WebRequest.jsm
opt_extrainfospec array of string the optional opt_extrainfospec argument lets you pass extra instructions for the handling of events.
... types array of strings.
...the matchpattern constructor accepts: either: a string defining a single pattern or: an array of such strings cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern("https:/developer.mozilla.org/*"); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern(["https://mozorg.cdn.mozilla.net/*", "https://mdn.mozillademos.org/*", "https://developer.cdn.mozilla.net/*"]); see the match patterns article for details on the syntax of the strings you supply.
...And 23 more matches
Parser API
reflect.parse(src[, options]) coerces src to a string and parses the result as a javascript program.
... source string default: null a description of the input source; typically a filename, path, or url.
... this string is not meaningful to the parsing process, but is produced as part of the source location information in the returned ast nodes.
...And 23 more matches
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 propertyname, in unsigned long propert...
...yval); void markread(in boolean read); void markflagged(in boolean flagged); void markhasattachments(in boolean hasattachments); void setprioritystring(in string priority); unsigned long orflags(in unsigned long flags); unsigned long andflags(in unsigned long flags); void setreferences(in string references); acstring getstringreference(in long refnum); void setrecipientsarray(in string names, in string addresses,in unsigned long numaddresses); void setcclistarray(in string names, in string addresses,in unsigned long numaddresses); void setbcclistarray(in string names, in string addresses,in unsigned long numaddresses);new in thunderbird 3.1 [noscript] void getauthorcollationkey(out octetpt...
... messageid string indicates the message id of this message, without angle brackets.
...And 23 more matches
DevTools API - Firefox Developer Tools
parameters: tool {tooldefinition|string} - the tool definition object or the id of the tool to unregister.
... parameters: theme {themedefinition|string} - the theme definition object or the theme identifier.
... toolid {string} - the tool that should be activated.
...And 23 more matches
HTMLAnchorElement - Web APIs
element.accesskey is a domstring representing a single character that switches input focus to the hyperlink.
... htmlanchorelement.download is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser.
... htmlhyperlinkelementutils.hash is a usvstring representing the fragment identifier, including the leading hash mark ('#'), if any, in the referenced url.
...And 23 more matches
Reading from Files - Archive of obsolete content
an input stream provides a means of reading bytes, strings or other values from the file.
...the two most common for text files are the readstring and readline methods for reading a string and a line from the file respectively.
... var file = io.getfile("home", "sample.txt"); var stream = io.newinputstream(file, "text"); var str = stream.readstring(20); stream.close(); in this example, a text input stream is created for the file 'sample.txt'.
...And 22 more matches
Bytecode Descriptions
string operands: (uint32_t atomindex) stack: ⇒ string push the string constant script->getatom(atomindex).
...the result is always a string that depends on the type of val.
...the conversion can call .tostring()/.valueof() methods and can throw.
...And 22 more matches
JSAPI reference
_setoptions obsolete since jsapi 27 js_getoptions obsolete since jsapi 27 js_toggleoptions obsolete since jsapi 27 enum jsversion jsversion_ecma_3 jsversion_1_6 jsversion_1_7 jsversion_1_8 jsversion_ecma_5 jsversion_default jsversion_unknown jsversion_latest js_getimplementationversion js_getversion js_setversionforcompartment added in spidermonkey 31 js_stringtoversion js_versiontostring js_setversion obsolete since jsapi 25 js::currentglobalornull added in spidermonkey 31 js_getglobalforscopechain obsolete since jsapi 25 js_getglobalobject obsolete since jsapi 24 js_setglobalobject obsolete since jsapi 25 js_initclass js_initstandardclasses js_resolvestandardclass js_enumeratestandardclasses js_enumerateresolvedstandardclasse...
...le javascript code into a function: struct jsfunction js::compilefunction added in spidermonkey 17 js_decompilefunction js_decompilefunctionbody js_compilefunction obsolete since jsapi 36 js_compilefunctionforprincipals obsolete since jsapi 28 js_compileucfunction obsolete since jsapi 36 js_compileucfunctionforprincipals obsolete since jsapi 28 error handling struct jserrorformatstring added in spidermonkey 17 class jserrorreport class js::autosaveexceptionstate added in spidermonkey 31 enum jsexntype added in spidermonkey 17 js_reporterror js_reportwarning js_reporterrornumber js_reporterrornumberuc js_reporterrorflagsandnumber js_reporterrorflagsandnumberuc js_reporterrornumberucarray added in spidermonkey 24 js_reportoutofmemory js_reportallocationoverflow added ...
...e constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spidermonkey 24 js::truevalue added in spidermonkey 24 js::falsevalue added in spidermonkey 24 js::numbervalue added in spidermonkey 24 js::int32value added in spidermonkey 24 js::doublevalue added in spidermonkey 24 js::float32value added in spidermonkey 24 js::stringvalue added in spidermonkey 24 js::objectvalue added in spidermonkey 24 js::objectornullvalue added in spidermonkey 24 js::symbolvalue added in spidermonkey 38 js::value constants: js::nullhandlevalue added in spidermonkey 24 js::undefinedhandlevalue added in spidermonkey 24 js::truehandlevalue added in spidermonkey 38 js::falsehandlevalue added in spidermonkey 38 jsval constants: ...
...And 22 more matches
Using XPCOM Utilities to Make Things Easier
it also introduces a basic string type that is used with many of the apis in both xpcom and gecko.
... the first parameter for each of these macros is an arbitrary string that names the module.
... in a debugging environment, this string will be printed to the screen when the component library is loaded or unloaded.
...And 22 more matches
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); ...
... void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring amsgfilename); void openattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlar...
...ray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray); void saveattachmenttofile(in nsifile afile, in acstring aurl, in acstring amessageuri, in acstring acontenttype, in nsiurllistener alistener); void detachattachment(in string contenttpe, in string url, in string displayname, in string messageuri, in boolean savefirst, [optional] in boolean withoutwarning); void detachallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray, in boolean savefirst, [optional] in boolean withoutwarning); nsilocalfile saveattachmenttofolder(in acst...
...And 22 more matches
Browser detection using the user agent - HTTP
considerations before using browser detection when considering using the user agent string to detect which browser is being used, your first step is to try to avoid it if possible.
...in those rare cases where behavior differs between browsers, instead of checking the user agent string, you should instead implement a test to detect how the browser implements the api and determine how to use it from that.
...so, you might have thought to do this: // this code snippet splits a string in a special notation if (navigator.useragent.indexof("chrome") !== -1){ // yes!
...And 22 more matches
sslfnc.html
syntax #include "nss.h" secstatus nss_init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside.
... syntax #include "nss.h" secstatus nss_initreadwrite(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside.
... directory a pointer to a string specifying the pathname of the directory that will contain the session cache.
...And 21 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(nsinavhistoryresultnode anode); boolean nodeisuri(nsinavhist...
... boolean nodeisdynamiccontainer(nsinavhistoryresultnode anode); boolean nodeislivemarkcontainer(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean nodeislivemarkitem(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean isreadonlyfolder(nsinavhistoryresultnode anode); int getindexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode anode, string atype, nsiuri aoverrideuri); array unwrapnodes(string blob, string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmar...
...kui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showaddlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker); boolean showminimaladdlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker); boolean showminimaladdmultibookmarkui(array nsiuri aurilist); boolean showbookmarkproperties(int aid); ...
...And 21 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
nsistringenumerator / nsiutf8stringenumerator - enumerators for strings obsolete arrays / enumerators there are some deprecated classes which should not be used by new code.
... example: an array of integers or an array of strings.
... for example, here is its use in a class: class medialist { public: void addmedium(const nsstring& amedium); private: nstarray<nsstring> mmedia; }; // typesafety of mmedia ensures that we only append an nsstring void nodecontainer::addmedium(const nsstring& amedium) { mmedia.appendelement(amedium); } nstarray<t> can also be declared on the stack to collect a temporary list of objects and manipulate them.
...And 21 more matches
nsIMsgIncomingServer
artemporaryreturnreceiptsfilter(); 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 string attr); acstring getcharattribute(in string name); acstring getcharvalue(in string attr); nsilocalfile getfilevalue(in string relpref, in string abspref); nsimsgfilterlist getfilterlist(in nsimsgwindow amsgwindow); long getintattribute(in string name); long getintvalue(in stri...
...ng attr); nsimsgfolder getmsgfolderfromuri(in nsimsgfolder afolderresource, in acstring auri); void getnewmessages(in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); acstring getpasswordwithui(in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in acstring oldname, in acstring newname); void performbiff(in nsimsgwindow amsgwindow); void performexpand(in nsimsgwindow amsgwindow); void removefiles(); void setboolattribute(in string name, in boolean value); void setboolvalue(in string attr, in boolean value); void setcharat...
...tribute(in string name, in acstring value); void setcharvalue(in string attr, in acstring value); void setdefaultlocalpath(in nsilocalfile adefaultlocalpath); void setfilevalue(in string relpref, in string abspref, in nsilocalfile avalue); void setfilterlist(in nsimsgfilterlist afilterlist); void setintattribute(in string name, in long value); void setintvalue(in string attr, in long value); void setunicharattribute(in string name, in astring value); void setunicharvalue(in string attr, in astring value); void shutdown(); void storepassword(); astring tostring(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome astring read only.
...And 21 more matches
nsIURI
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 compatible encoding.
... asciispec acstring (us-ascii) the uri spec with an ascii compatible encoding.
... host autf8string the host is the internet domain name to which this uri refers.
...And 21 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.
... tosource() returns the string "t(arg)", where t and arg are implementation-defined javascript expressions intended to represent the type of the cdata object and its value, respectively.
... string tosource() parameters none.
...And 21 more matches
AddressErrors - Web APIs
properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated.
... the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem.
... city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated.
...And 21 more matches
widget - Archive of obsolete content
you can include this content inline as a string by using the content property, or point to content using a url with the contenturl property.
... unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
... examples for conciseness, these examples create their content scripts as strings and use the contentscript property.
...And 20 more matches
gettext
plurals gettext lets you define and use singular and plural forms of a string.
...different gettext function name) for string which are supposed to support plurals.
...a definition of a string with plurals takes three arguments: the singular form of the english string, the plural form of the english string, and the number basing on which the function will return the correct (singular or plural) form of the string.
...And 20 more matches
IAccessibleText
other-licenses/ia2/accessibletext.idlnot scriptable a structure containing a substring and the start and end offsets in the enclosing string.
...rs([out] long ncharacters ); [propget] hresult newtext([out] ia2textsegment newtext ); [propget] hresult nselections([out] long nselections ); [propget] hresult offsetatpoint([in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out] long offset ); [propget] hresult oldtext([out] ia2textsegment oldtext ); hresult removeselection([in] long selectionindex ); hresult scrollsubstringto([in] long startindex, [in] long endindex, [in] enum ia2scrolltype scrolltype ); hresult scrollsubstringtopoint([in] long startindex, [in] long endindex, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult selection([in] long selectionindex, [out] long startoffset, [out] long endoffset ); hresult setcaretoffset([in] long offset ); hresult setselectio...
...(0 based) textattributes a string of attributes describing the text().
...And 20 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 principal, in st...
...ring type); void removepermission(in nsipermission perm); void removeallsince(in int64_t since); void removeall(); pruint32 testexactpermission(in nsiuri uri, in string type); pruint32 testexactpermissionfromprincipal(in nsiprincipal principal, in string type); pruint32 testpermission(in nsiuri uri, in string type); pruint32 testpermissionfromprincipal(in nsiprincipal principal, in string type); attributes attribute type description enumerator nsisimpleenumerator enumerates all stored permissions.
... void add( in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime ); parameters uri the uri to add the permission for.
...And 20 more matches
HTMLAreaElement - Web APIs
element.accesskey is a domstring containing a single character that switches input focus to the control.
... htmlareaelement.alt is a domstring that reflects the alt html attribute, containing alternative text for the element.
... htmlareaelement.coords is a domstring that reflects the coords html attribute, containing coordinates to define the hot-spot region.
...And 20 more matches
Symbol - JavaScript
description to create a new primitive symbol, you write symbol() with an optional string as its description: let sym1 = symbol() let sym2 = symbol('foo') let sym3 = symbol('foo') the above code creates three new symbols.
... note that symbol("foo") does not coerce the string "foo" into a symbol.
...time: symbol('foo') === symbol('foo') // false the following syntax with the new operator will throw a typeerror: let sym = new symbol() // typeerror this prevents authors from creating an explicit symbol wrapper object instead of a new symbol value and might be surprising as creating explicit wrapper objects around primitive data types is generally possible (for example, new boolean, new string and new number).
...And 20 more matches
Localization - Archive of obsolete content
the sdk supports localization of strings appearing in: your main add-on's javascript code html files packaged with your add-on the title, description and homepage fields of your add-on's metadata the title and description fields of your add-on's preferences.
... localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale.
... the files: use the .properties format are named "xx-yy.properties", where "xx-yy" is the name of the locale in question contain one entry for each string you want to localize, consisting of an identifier for the string and its translation in that locale, in the format identifier=translation need to use utf-8 without bom encoding lines starting with "#" (after optional whitespace) are comments suppose your add-on contains a single localizable string, represented in english as "hello!", and you want to supply us english and french french localizations.
...And 19 more matches
Localizing an extension - Archive of obsolete content
download the sample localizing strings in xul files create the needed locale files each xul file that comprises the user interface for your extension should have a locale file in its locale directory.
... each locale file maps entity names referenced in the xul files to the strings themselves.
... the preference dialog, whose xul file is options.xul, has a corresponding options.dtd file that looks like this: <!entity options_window_title "stockwatcher 2 preferences"> <!entity options_symbol.label "stock to watch: "> the "options_window_title" entity maps to the string "stockwatcher 2 preferences", which is used as the title of the preference window.
...And 19 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
nodename returns the name of the current node as a string.
...for nodes that contain text, such as text and comment nodes, it will return their string value.
... differences in javascript-generating html javascript can, through document.write, generate html on the fly from a string.
...And 19 more matches
TypeScript support in Svelte - Learn web development
give todo.type.ts the following content: export type todotype = { id: number name: string completed: boolean } note: the svelte template uses svelte-preprocess 4.0.0 to support typescript.
...(ts) (message, ms) => { you can fix these by specifying the corresponding types, like so: export let ms = 3000 let visible: boolean let timeout: number const onmessagechange = (message: string, ms: number) => { cleartimeout(timeout) if (!message) { // hide alert if message is empty note: there's no need to specify the ms type with export let ms:number = 3000 because typescript is already inferring it from its default value.
...an> </button> <button class="btn toggle-btn" class:btn__primary={filter === filter.completed} aria-pressed={filter === filter.completed} on:click={()=> filter = filter.completed} > <span class="visually-hidden">show</span> <span>completed</span> <span class="visually-hidden">tasks</span> </button> </div> here we are just importing the filter enum, and using it instead of the string values we used previously.
...And 19 more matches
Python binding for NSS
acronyms always appear as a contiguous string of upper case letters.
... all nss/nspr python objects can print their current value by evaluting the python object in a string context or by using the python str() function.
... convenience functions are provided to translate between the numeric value of an enumerated constant and it's string representation and visa versa.
...And 19 more matches
Shell global objects
scriptpath a string that is a path of script.
... load(['foo.js' ...]) load files named by string arguments.
... loadrelativetoscript(['foo.js' ...]) load files named by string arguments.
...And 19 more matches
mozIStorageBindingParams
void bindstringbyindex(in unsigned long aindex, in astring avalue); native code only!
... void bindutf8stringbyindex(in unsigned long aindex, in autf8string avalue); native code only!
... void bindbyname(in autf8string aname, in nsivariant avalue); void bindblobbyname(in autf8string aname, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyname(in autf8string aname, in double avalue); native code only!
...And 19 more matches
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.
... it is not recommended to use date.parse as until es5, parsing of strings was entirely implementation dependent.
... there are still many differences in how different hosts parse date strings, therefore date strings should be manually parsed (a library can help if many different formats are to be accommodated).
...And 19 more matches
passwords - Archive of obsolete content
optional options: name type username string the username for the credential.
... password string the password for the credential.
... url string the url associated with the credential.
...And 18 more matches
dialog - Archive of obsolete content
l="cancel" buttonlabelaccept="save"> <dialogheader title="options" description="my preferences"/> <groupbox> <caption label="colour"/> <radiogroup> <radio label="red"/> <radio label="green" selected="true"/> <radio label="blue"/> </radiogroup> <label value="nickname"/> <textbox/> </groupbox> </dialog> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... buttonaccesskeyaccept type: string the access key to use for the "accept" button.
... buttonaccesskeycancel type: string the access key to use for the "cancel" button.
...And 18 more matches
CustomizableUI.jsm
edinwindow(awidgetid, awindow); void beginbatchupdate(); void endbatchupdate(aforcedirty); widgetgroupwrapper createwidget(awidgetspecification); void destroywidget(awidgetid); widgetgroupwrapper getwidget(awidgetid); array getunusedwidgets(awindow); array getwidgetidsinarea(aareaid); array getwidgetsinarea(aareaid); string getareatype(aareaid); domelement getcustomizetargetforarea(aareaid, awindow); void reset(); void undoreset(); void removeextratoolbar(); object getplacementofwidget(awidgetid); bool iswidgetremovable(awidgetnodeorwidgetid); bool canwidgetmovetoarea(awidgetid); void getlocalizedproperty(awidget, aprop, aformatargs, adef); ...
... void addpanelcloselisteners(apanel); void removepanelcloselisteners(apanel); void onwidgetdrag(awidgetid, aarea); void notifystartcustomizing(awindow); void notifyendcustomizing(awindow); void dispatchtoolboxevent(aevent, adetails, awindow); bool isareaoverflowable(aareaid); void settoolbarvisibility(atoolbarid, aisvisible); string getplaceforitem(aelement); bool isbuiltintoolbar(atoolbarid); methods addlistener() add a listener object that will get fired for various events regarding customization.
... nb: this is unlikely to be useful unless you're in firefox code, because this code uses the builtin widget stringbundle, and can't be told to use add-on-provided strings.
...And 18 more matches
Creating localizable web applications
take advantage of printf() (or equivalents) and use variables in the english strings.
...you can use one or more of the following techniques: http accept-language headers, the ua string, ip geolocation.
... so in order to display a localized label of a category or a tab, you should create a mapping between the non-localizable english names used in the urls and the localizable english strings used in the interface.
...And 18 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 init() method to indicate whic...
... acstring finish( in prbool aascii ); parameters aascii if true then the returned value is a base-64 encoded string.
...this can be either binary data or a base-64 encoded string.
...And 18 more matches
CSSCounterStyleRule - Web APIs
csscounterstylerule.name is a domstring object that contains the serialization of the <counter-style-name> defined for the associated rule.
... csscounterstylerule.system is a domstring object that contains the serialization of the system descriptor defined for the associated rule.
... if the descriptor was not specified in the associated rule, the attribute returns an empty string.
...And 18 more matches
HTMLImageElement - Web APIs
htmlimageelement.alt a domstring that reflects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded.
... htmlimageelement.crossorigin a domstring specifying the cors setting for this image element.
... htmlimageelement.currentsrc read only returns a usvstring representing the url from which the currently displayed image was loaded.
...And 18 more matches
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.
... syntax b1 = encoder.encodeinto(string, uint8array); parameters string is a usvstring containing the text to encode.
...this may be less than string.length if uint8array did not have enough space.
...And 18 more matches
eval() - JavaScript
warning: executing javascript from a string is an enormous security risk.
... the eval() function evaluates javascript code represented as a string.
... syntax eval(string) parameters string a string representing a javascript expression, statement, or sequence of statements.
...And 18 more matches
The Essentials of an Extension - Archive of obsolete content
the other standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated.
...a localized description and name can be added with the following code: <em:localized> <description> <em:locale>es-es</em:locale> <em:name>xul school hola mundo</em:name> <em:description>bienvenido a xul school!</em:description> </description> </em:localized> the es-es locale string indicates that this is the spanish (es) localization for spain (es).
... sayhello : function(aevent) { let stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); let message = stringbundle.getstring("xulschoolhello.greeting.label"); window.alert(message); } and, finally, this is our function declaration.
...And 17 more matches
Arrays - Learn web development
paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hummus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays.
... we can also mix data types in a single array — we do not have to limit ourselves to storing only numbers in one array, and in another only strings.
... accessing and modifying array items you can then access individual items in the array using bracket notation, in the same way that you accessed the letters in a string.
...And 17 more matches
Addon
overview of required methods void iscompatiblewith(in string appversion, in string platformversion) void findupdates(in updatelistener listener, in integer reason, in string appversion, in string platformversion) overview of optional methods void uninstall() void canceluninstall() boolean hasresource(in string path) nsiuri getresourceuri(in string path) void getdatadirectory(in datadirectorycall...
... id read only string the id of the add-on.
... name read only string the name of the add-on.
...And 17 more matches
NSS environment variables
3.12.3 nsrandfile string (file name) uses this file to seed the pseudo random number generator.
... 3.12.3 nss_debug_pkcs11_module string (module name) name the pkcs#11 module to be traced.
... pkcs #11 module logger 3.6 nss_default_db_type string ("dbm", "sql", or "extern") determines the default database type to open if the app does not specify.
...And 17 more matches
nsIContentPrefService2
method overview void addobserverforname(in astring name, in nsicontentprefobserver observer); void getbydomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void getbysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); nsicontentpref getcachedbydomainandname(in astring doma...
...in, in astring name, in nsiloadcontext context); void getcachedbysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, out unsigned long len, [retval,array,size_is(len)] out nsicontentpref prefs); nsicontentpref getcachedglobal(in astring name, in nsiloadcontext context); void getglobal(in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void removealldomains(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeallglobals(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebydomain(in astring domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); ...
... void removebydomainandname(in astring domain, in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebyname(in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebysubdomain(in astring domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeglobal(in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeobserverforname(in astring name, in nsicontentprefobserver observer); ...
...And 17 more matches
nsIDOMNSHTMLDocument
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 quer...
...ycommandstate(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obsolete since gecko 14.0 domstring querycommandvalue(in domstring commandid); void releaseevents(in long eventflags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writeln(); obsolete since gecko 2.0 attributes attribute type description alinkcolor domstring same as body.alink bgcolor domstring same as body.bgcolor compatmode domstring returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode.
... designmode domstring set to "on" or "off" to enable or disable editing for the entire document at once.
...And 17 more matches
nsIHttpServer
jsm var exported_symbols = ["create"]; components.utils.import("resource://gre/modules/services.jsm"); function create() { var server = components.classes["@mozilla.org/server/jshttp;1"] .createinstance(components.interfaces.nsihttpserver); return { get objectname () { return "webserver"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options.
... * @param function callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, registerfile: function(path, filepath) { var file = components.classes['@mozilla.org/file/local;1']...
...m callback * an asynchronous callback used to notify the user when this server is * stopped and all pending requests have been fully served * @throws ns_error_null_pointer * if callback is null * @throws ns_error_unexpected * if this server is not running */ void stop(in nsihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all requests * which match request.
...And 17 more matches
nsITreeView
tatransfer 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 nsitreecolumn col); astring getcolumnproperties(in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); astring getimagesrc(in long row, ...
...in nsitreecolumn col); long getlevel(in long index); long getparentindex(in long rowindex); long getprogressmode(in long row, in nsitreecolumn col); astring getrowproperties(in long index, in nsisupportsarray properties obsolete since gecko 22); boolean hasnextsibling(in long rowindex, in long afterindex); boolean iscontainer(in long index); boolean iscontainerempty(in long index); boolean iscontaineropen(in long index); boolean iseditable(in long row, in nsitreecolumn col); boolean isselectable(in long row, in nsitreecolumn col); boolean isseparator(in long index); boolean issorted(); void performaction(in wstring action); void performactiononcell(in wstring action, in ...
...long row, in nsitreecolumn col); void performactiononrow(in wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsitreeboxobject tree); void toggleopenstate(in long index); attributes attribute type description rowcount long the total number of rows in the tree (including the offscreen rows).
...And 17 more matches
nsIZipReader
all functions now pass the filenames (both in and out) as autf8string.
... 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 autf8string aentryname); nsiprincipal getcertificateprincipal(in string aentryname); obsolete since gecko 10 nsizipentry getentry(in autf8string zipentry); nsizipentry getentry(in str...
...ing zipentry); obsolete since gecko 10 nsiinputstream getinputstream(in autf8string zipentry); nsiinputstream getinputstream(in string zipentry); obsolete since gecko 10 nsiinputstream getinputstreamwithspec(in autf8string ajarspec, in autf8string zipentry); nsiinputstream getinputstreamwithspec(in autf8string ajarspec, in string zipentry); obsolete since gecko 10 boolean hasentry(in autf8string zipentry); void init(in nsifile zipfile); obsolete since gecko 1.9 void open(in nsifile zipfile); void openinner(in nsizipreader zipreader, in autf8string zipentry); void openinner(in nsizipreader zipreader, in string zipentry); obsolete since gecko 10 void test(in autf8string aentryname); void test(in string aentryname...
...And 17 more matches
JavaScript data types and data structures - JavaScript
variables in javascript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types: let foo = 42; // foo is now a number foo = 'bar'; // foo is now a string foo = true; // foo is now a boolean data and structure types the latest ecmascript standard defines nine types: six data types that are primitives, checked by typeof operator: undefined : typeof instance === "undefined" boolean : typeof instance === "boolean" number : typeof instance === "number" string : typeof instance === "string" bigint : typeof instance === "big...
...for example (and unlike in c), strings are immutable.
... string type javascript's string type is used to represent textual data.
...And 17 more matches
Date - JavaScript
date.parse() parses a string representation of a date and returns the number of milliseconds since 1 january, 1970, 00:00:00 utc, with leap seconds ignored.
... note: parsing of strings with date.parse is strongly discouraged due to browser differences and inconsistencies.
... date.prototype.todatestring() returns the "date" portion of the date as a human-readable string like 'thu apr 12 2018'.
...And 17 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.
... it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts.
...And 17 more matches
page-mod - Archive of obsolete content
gemod({ include: "*.mozilla.org", contentscript: 'window.alert("page matches ruleset");' }); you can modify the document in your script: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can supply the content script(s) in one of two ways: as a string literal, or an array of string literals, assigned to the contentscript option, as above as separate files supplied in your add-on's "data" directory.
...so you can rewrite the above code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./my-script.js" }); unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
... the pagemod constructor takes a number of other options to control its behavior: contentstyle lists stylesheets to attach, supplied as strings.
...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.
...a js::value can be a number, a string, a boolean value, a reference to an object (like an object, array, date, or function), or one of the special values null or undefined.
...in other cases, the jsval is a pointer to an object, string, or number.
...And 16 more matches
nsIPrincipal
method overview short canenablecapability(in string capability); native code only!
... void checkmayload(in nsiuri uri, in boolean report); void disablecapability(in string capability, inout voidptr annotation); native code only!
... void enablecapability(in string capability, inout voidptr annotation); native code only!
...And 16 more matches
URL - Web APIs
WebAPIURL
you normally create a new url object by specifying the url as a string when calling its constructor, or by providing a relative url and a base url.
... constructor new url() creates and returns a url object referencing the url specified using an absolute url string, or a relative url string and a base url string.
... properties hash a usvstring containing a '#' followed by the fragment identifier of the url.
...And 16 more matches
Silly story generator - Learn web development
objective: to test comprehension of javascript fundamentals, such as variables, numbers, operators, strings, and arrays.
... project brief you have been provided with some raw html/css and a few text strings and javascript functions; you need to write the necessary javascript to turn this into a working program, which does the following: generates a silly story when the "generate random story" button is pressed.
...raw text strings".
...And 15 more matches
L20n Javascript API
l20n javascript api var ctx = l20n.getcontext(); ctx.linkresource('./locales/strings.l20n'); ctx.requestlocales(); when you freeze the context by calling requestlocales, the resource files will be retrieved, parsed and compiled.
... ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the context instance before the language negotiation.
... ctx.registerlocalenegotiator(function(available, requested, deflocale, callback) { yourapp.getallavailablelanguages(function(allavailable) { var fallbackchain = yourapp.intersect(allavailable, requested); cb(fallbackchain); }); }); ctx.requestlocales(...requestedlocales: string?) specify the user's preferred locales for the context instance to negotiate against and freeze the context instance.
...And 15 more matches
JS::CompileOptions
source belongs to a dom element if it was assigned to one of the element's event handler idl attributes as a string.
... (note that one may assign both strings and functions to dom elements' event handler idl attributes.
... if one assigns a function, that function's script's source does not belong to the dom element; the function's definition must appear elsewhere.) jsstring *elementattributename() const if this source belongs to a dom element because it is an event handler content attribute or an event handler idl attribute, this returns the name of that attribute, a string.
...And 15 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 aname); void reset(); ...
... astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparamindex, in autf8string avalue); void bindstringparameter(in unsigned long aparamindex, in astring avalue); void binddoubleparameter(in unsigned long aparamindex, in double avalue); void bindint32parameter(in unsigned long aparamindex, in long avalue); void bindint64parameter(in unsigned long aparamindex, in long long avalue); void bindnullparameter(in unsigned long aparamindex); void bindblobparameter(in unsigned long aparamindex, [array,const,size_is(avaluesize)] in octet...
... void initialize( in mozistorageconnection adbconnection, in autf8string asqlstatement ); parameters adbconnection a mozistorageconnection database connection.
...And 15 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 pruint32 count); wstring getnextmisspelledword...
...(); void getpersonaldictionary(); wstring getpersonaldictionaryword(); wstring getsuggestedword(); void ignorewordalloccurrences(in wstring word); void initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void removewordfromdictionary(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.
... void addwordtodictionary( in wstring word ); parameters word the word to add to the current personal dictionary.
...And 15 more matches
nsIErrorService
xpcom/base/nsierrorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages.
... string bundle keys can also be mapped.
... 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.
...And 15 more matches
nsILocalFile
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!
... void appendrelativepath(in astring relativefilepath); acstring getrelativedescriptor(in nsilocalfile fromfile); void initwithfile(in nsilocalfile afile); void initwithnativepath(in acstring filepath); native code only!
... void initwithpath(in astring filepath); void launch(); prlibrarystar load(); native code only!
...And 15 more matches
nsIMsgIdentity
each identity is identified by a key, which is the id string in the identity preferences, such as in mail.identity.<id>.replyto.
... 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 string name, in long value); astring tostring(); attributes attribute type description identityname astring fullname astring user's full name, i.e.
... john doe email astring user's e-mail address, i.e.
...And 15 more matches
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc.
... 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 nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsims...
...gwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow amsgwindow); void geturlforuri(in string amessageuri, out nsiuri aurl, in nsimsgwindow amsgwindow); void displaymessageforprinting(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, out nsiuri aurl); void search(in nsimsgsearchsession asearchsession, in nsimsgwindow amsgwindow, in nsimsgfolder amsgfolder, in string asearchuri); nsiuri streammessage(in string amessageuri, in nsisupports aconsumer, in nsimsgwindow amsgwindow, in nsiurllisten...
...And 15 more matches
nsIAbCard/Thunderbird3
rsarymonth, 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 autf8string name, in nsivariant value); [noscript] void s...
...etpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [noscript] void setpropertyasbool(in string name, in boolean value); void deleteproperty(in autf8string name); autf8string translateto(in autf8string atype); void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description properties nsisimpleenumerator readonly: a list of all the properties that this card has as an enumerator, whose members are all nsiproperty objects.
... firstname astring shorthand for getproperty and setproperty.
...And 15 more matches
Using the clipboard
this component implements the interface nsiclipboardhelper, which has a function copystring that can be used to copy a string.
... const gclipboardhelper = components.classes["@mozilla.org/widget/clipboardhelper;1"] .getservice(components.interfaces.nsiclipboardhelper); gclipboardhelper.copystring("put me on the clipboard, please."); this example will first create a clipboard helper and then copy a short string to the clipboard.
... this method only works to put strings on the clipboard.
...And 15 more matches
XPIDL
the following is the correspondence table: table 1: standard idl types idl c++ in parameter c++ out parameter js type notes boolean bool bool* boolean char char char* string only chars in range \u0000-\u00ff permitted double double double* number float float float* number long int32_t int32_t* number long long int64_t int64_t* number octet uint8_t uint8_t* number short int16_t int16_t* number string const char* char** ...
... string only chars in range \u0000-\u00ff permitted most of the time you don't want to use this type but autf8string or acstring unsigned long uint32_t uint32_t* number unsigned long long uint64_t uint64_t* number unsigned short uint16_t uint16_t* number wchar char16_t char16_t* string full unicode set permitted wstring const char16_t* char16_t** string full unicode set permitted most of the time you don't want to use this type but astring.
...ns[c]string, refptr<t>, or uint32_t) string, wstring, [ptr] native and [ref] native are unsupported as element types.
...And 15 more matches
Add to iPhoto
among these are routines for managing cfstring, cfurl, and cfarray objects, among others.
... cfstring a cfstring is an opaque data type that contains a string.
... the string can be stored in any of a number of encodings, so you use assorted functions that know how to cope with different encodings to set and get values of cfstrings, as well as to perform typical string operations.
...And 15 more matches
Proxy Auto-Configuration (PAC) file - HTTP
this is only for convenience; it is the same string as between :// and the first : or / after that.
... description returns a string describing the configuration.
... the format of this string is defined in return value format below.
...And 15 more matches
Expressions and operators - JavaScript
« previousnext » this chapter describes javascript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.
... assignment operators comparison operators arithmetic operators bitwise operators logical operators string operators conditional (ternary) operator comma operator unary operators relational operators javascript has both binary and unary operators, and one special ternary operator, the conditional operator.
...the operands can be numerical, string, logical, or object values.
...And 15 more matches
l10n - Archive of obsolete content
localize strings appearing in the add-on's javascript code.
... note that you can't currently use localize strings appearing in content scripts or html files, but you can share the localized strings you want by assigning it's values to a json serializable object.
... globals functions get(identifier, count, placeholder1...n) this function takes a string parameter which it uses as an identifier to look up and return a localized string in the locale currently set for firefox.
...And 14 more matches
ui/button/action - Archive of obsolete content
this can be a number or a string, and you can update it at any time.
...to set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently active tab the second parameter is an object containing the state properties you wish to update.
... parameters options : object required options: name type id string the button's id.
...And 14 more matches
ui/button/toggle - Archive of obsolete content
this can contain a number or a string, and you can update it at any time.
...to set state like this, call state() with 2 parameters: the first parameter is a window or tab object or as a shorthand, the string "window" for the currently active window, or the string "tab" for the currently active tab the second parameter is an object containing the state properties you wish to update.
... parameters options : object required options: name type id string the button's id.
...And 14 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
://helloworld/content/clock.js"/> <hbox align="center"> <label value="current time:" /> <textbox id="currenttime" /> </hbox> </dialog> listing 6: content for clock.js function initclock() { showcurrenttime(); window.setinterval(showcurrenttime, 1000); } function showcurrenttime() { var textbox = document.getelementbyid("currenttime"); textbox.value = new date().tolocaletimestring(); textbox.select(); } operations check perform an operations check to make sure that your changes to the source file are correct.
... though they are nested in javascript, the strings should be localized too, for the sake of ui consistency.
... suppose you have these strings nested in a .js file: if ( password == userpassword ) { oprefs.setboolpref("access.authenticated", true); } else { alert ("invalid password"); ......
...And 14 more matches
nsIAccessibleText
ong 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 coordtype); void getselectionbounds(in long selectionnum, out long startoffset, out long endoffset); astring gettext(in long startoffset, in long endoffset); astring gettextafteroffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); astring gettextatoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); nsipersistentproperties gettextattributes(in boolean includedefattrs, in long offset, out l...
...ong rangestartoffset, out long rangeendoffset); astring gettextbeforeoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); void removeselection(in long selectionnum); void scrollsubstringto(in long startindex, in long endindex, in unsigned long scrolltype); void scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in long selectionnum, in long startoffset, in long endoffset); attributes attribute type description caretoffset long the current current caret 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 14 more matches
nsIDBFolderInfo
@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 overriden); void getcharactersetoverride(out boolean charactersetoverride); obsolete since gecko 1.8 string getcharptrcharacterset(); string getcharptrproperty(in string propertyname); void getlocale(in nsstring result); nat...
...obsolete since gecko 1.8 void getmailboxname(in nsstring boxname); native code only!
... obsolete since gecko 1.8 astring getproperty(in string propertyname); nsidbfolderinfo gettransferinfo(); unsigned long getuint32property(in string propertyname, in unsigned long defaultvalue); void initfromtransferinfo(in nsidbfolderinfo transferinfo); long orflags(in long flags); void setbooleanproperty(in string propertyname, in boolean apropertyvalue); void setcharacterset(in string charset); void setcharactersetoverride(in boolean charactersetoverride); obsolete since gecko 1.8 void setcharptrproperty(in string apropertyname, in string apropertyvalue); void sethighwater(in nsmsgkey highwater, in boolean force); void s...
...And 14 more matches
nsIFileProtocolHandler
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.
... a local file will be created if the url string begins with file://.
... nsifile getfilefromurlspec( in autf8string url ); parameters url the url string to convert.
...And 14 more matches
nsIPropertyBag2
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 getprope...
...rtyasuint32(in astring prop); pruint64 getpropertyasuint64(in astring prop); prbool haskey(in astring prop); methods get() this method returns null if the value does not exist, or exists but is null.
... nsivariant get( in astring prop ); parameters prop property to return the value of.
...And 14 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
<input type="reset" name="reset"/> search a single-line text field for entering search strings.
... autocomplete (not a boolean attribute!) the autocomplete attribute takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide.
... form a string specifying the <form> element with which the input is associated (that is, its form owner).
...And 14 more matches
Preferences - Archive of obsolete content
nts.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefbranch); // get the "extensions.myext." branch var prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); prefs = prefs.getbranch("extensions.myext."); simple types there are three types of preferences: string, integer, and boolean.
...var value = prefs.getboolpref("typeaheadfind"); // get a pref (accessibility.typeaheadfind) prefs.setboolpref("typeaheadfind", !value); // set a pref (accessibility.typeaheadfind) complex types as noted in the previous section, each entry in the preferences database (prefs.js) must have a string, an integer, or a boolean value.
... however, there is a concept of complex types, which makes it easier for developers to save and load nsilocalfile and nsisupportsstring objects in preferences (as strings — note that from the preferences system's point of view, complex values have a nsiprefbranch.pref_string type.) there are two nsiprefbranch methods implementing the concept — setcomplexvalue() and getcomplexvalue().
...And 13 more matches
Property Files - Archive of obsolete content
a property file contains a set of strings.
... stringbundles you could write the code to read properties yourself, however xul provides the stringbundle element which does this for you.
... the element has a number of functions which can be used to get strings from the property file and get other locale information.
...And 13 more matches
XUL element attributes - Archive of obsolete content
class type: string the style class of the element.
... flex type: string (representing an integer) indicates the flexibility of the element, which indicates how an element's container distributes remaining empty space among its children.
... height type: string (representing an integer) the preferred height of the element in pixels.
...And 13 more matches
How to implement a custom autocomplete search component
implement the list of matched strings using the nsiautocompleteresult interface.
... = components.interfaces; const cu = components.utils; cu.import('resource://gre/modules/xpcomutils.jsm'); const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} defaultindex * @param {string} errordescription * @param {array.<string>} results * @param {array.<string>|null=} comments */ function providerautocompleteresult(searchstring, searchresult, defaultindex, errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._def...
...aultindex = defaultindex; this._errordescription = errordescription; this._results = results; this._comments = comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _errordescription: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * @return {number} the index of the default item that should be entered if * ...
...And 13 more matches
NetUtil.jsm
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.
... example this example writes a string to a file; it comes from the test suite for the netutil module.
...const test_data = "this is a test string"; let istream = cc["@mozilla.org/io/string-input-stream;1"].
...And 13 more matches
Finishing the Component
in this context, uris are the strings used refer to places or things on the web.
...when you want to download a file using necko, for example, all you probably have is a string that represents the uri of the file.
... when you pass that string to necko, it creates an object that implements at least the nsiuri interface (and perhaps other interfaces as well).
...And 13 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 anumarguments, in mozistorageaggregatefunction afunction); mozistorageasyncstatement createasyncstatement(in autf8string asqlstatement); void createfunction(in autf8string afunctionname, in long anumarguments, in mozistoragefunction afunction); mozistoragestatement createstatement(in autf8string asqlstatement); void createtable(in strin...
...g atablename, in string atableschema); mozistoragependingstatement executeasync([array, size_is(anumstatements)] in mozistoragebasestatement astatements, in unsigned long anumstatements, [optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean indexexists(in autf8string aindexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boole...
...an tableexists(in autf8string atablename); attributes attribute type description connectionready boolean indicates if the connection is open and ready to use.
...And 13 more matches
nsICookieService
there are four possible data strings for this notification; one notification will be broadcast for each change.
... 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 string acookie, in string as...
... methods getcookiestring() get the complete cookie string associated with the uri.
...And 13 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 abase, in astring amode, [optional] in astring achar...
...set, [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.
...files are located by starting at a known directory, specified using a location key string.
...And 13 more matches
nsIURL
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.
... if the url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the empty string.
... filebasename autf8string file basename portion of a filename in a url.
...And 13 more matches
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.
... billboardurl astring the url to a page that is typically localized to display in the update prompt.
... buildid astring the build id of this update.
...And 13 more matches
Debugger.Source - Firefox Developer Tools
debugger.source for javascript for a debugger.source instance representing a piece of javascript source code, its properties provide the source code itself as a string, and describe where it came from.
...each script indicates the substring of the overall source to which it corresponds.
...in this case, there may be either a single debugger.source instance for the entire html document, with each debugger.script referring to its substring of the document; or there may be a separate debugger.source instance for each <script> element and attribute.
...And 13 more matches
HTMLObjectElement - Web APIs
htmlobjectelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... htmlobjectelement.archive is a domstring that reflects the archive html attribute, containing a list of archives for resources for this object.
... htmlobjectelement.border is a domstring that reflects the border html attribute, specifying the width of a border around the object.
...And 13 more matches
HTMLTextAreaElement - Web APIs
="_top"><rect x="301" y="65" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltextareaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties accesskey string: returns / sets the element's accesskey attribute.
... autocapitalize string: returns / sets the element's capitalization behavior for user input.
... defaultvalue string: returns / sets the control's default value, which behaves like the node.textcontent property.
...And 13 more matches
Using XMLHttpRequest - Web APIs
manually parsing and serializing xml to strings or objects.
... using xmlserializer to serialize dom trees to strings or to files.
... processing a responsetext property containing an html document if you use xmlhttprequest to get the content of a remote html webpage, the responsetext property is a string containing the raw html.
...And 13 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.
... it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts.
...And 13 more matches
RegExp - JavaScript
when using the constructor function, the normal string escape rules (preceding special characters with \ when included in a string) are necessary.
... instance properties regexp.prototype.flags a string that contains the flags of the regexp object.
... regexp.prototype.global whether to test the regular expression against all possible matches in a string, or only against the first.
...And 13 more matches
parseInt() - JavaScript
the parseint() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).
... syntax parseint(string [, radix]) parameters string the value to parse.
... if this argument is not a string, then it is converted to one using the tostring abstract operation.
...And 13 more matches
Finding window handles - Archive of obsolete content
note: starting in gecko 17.0, nsibasewindow.nativehandle provides the handle (hwnd [widows], gdkwindow* [linux], nswindow* [macosx],...) of a top-level window, for all plateforms, as a string.
...d'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.void...
...ptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.tostring()); user32.close(); mac os x objective-c components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) ...
...And 12 more matches
Working with JSON - Learn web development
json exists as a string — useful when you want to transmit data across a network.
... note: converting a string to a native object is called deserialization, while converting a native object to a string so it can be transmitted across the network is called serialization.
... json structure as described above, a json is a string whose format very much resembles javascript object literal format.
...And 12 more matches
IPDL Tutorial
the following ipdl code defines a very basic interaction of browser and plugin actors: async protocol pplugin { child: async init(nscstring pluginpath); async shutdown(); parent: async ready(); }; this code declares the pplugin protocol.
...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.
... */ bool recvready() = 0; }; class ppluginchild { protected: bool recvinit(const nscstring& pluginpath) = 0; bool recvshutdown() = 0; public: bool sendready() { // generated code to send a ready() message } }; these parent and child abstract classes take care of all the "protocol layer" concerns: serializing data, sending and receiving messages, and checking protocol safety.
...And 12 more matches
Localizing with Koala
translating to x-testing will basically consist of converting any strings to uppercase, for example "file" in original version (en-us) will become "file" in x-testing.
...if you click on the highlighted arrow pointing down while reading this tutorial on mdc, you will see two string that need to be translated: add "mdc search" manage search engines...
...koala features a very handy tool called compare-locales, which compares the files from en-us with your files in x-testing and gives you statistics about new, changed, missing and obsolete files and strings.
...And 12 more matches
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); unsigned long long getcontentstate(in nsidomelement aelement); ...
... void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselectorindex); unsigned long long getspecificity(in nsidomcssstylerule arule, in unsigned long aselectorindex); nsidomfontfacelist getusedfontfaces(in...
... nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void setcontentstate(in nsidomelement aelement, in unsigned long long astate); constants constant value description ...
...And 12 more matches
nsIScriptError
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.
... errormessage astring the error message in a string format without any context/line number information.
...And 12 more matches
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 the url of the icon that can be show...
... id astring the guid of the item.
... installlocationkey astring the name of the install location where this item is installed.
...And 12 more matches
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...
...estobserver acallback); acstring providerurlforerror(in unsigned long aerror); attributes attribute type description type acstring readonly: the type is a unique string identifier which can be used by interface elements for styling.
... as such, the type should be an alphanumpheric string with no spaces.
...And 12 more matches
Signaling and video calling - Web APIs
readying the chat server for signaling our chat server uses the websocket api to send information as json strings between each client and the server.
...as the name suggests, this sends a stringified json message to a particular username.
... function sendtooneuser(target, msgstring) { var isunique = true; var i; for (i=0; i<connectionarray.length; i++) { if (connectionarray[i].username === target) { connectionarray[i].send(msgstring); break; } } } this function iterates over the list of connected users until it finds one matching the specified username, then sends the message to that user.
...And 12 more matches
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
value a domstring representing the path to the selected file.
...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).
... note: if multiple files are selected, the string represents the first selected file.
...And 12 more matches
Deprecated and obsolete features - JavaScript
this does not affect their use in replacement strings: property description $1-$9 parenthesized substring matches, if any.
... input the string against which a regular expression is matched.
... lastparen the last parenthesized substring match, if any.
...And 12 more matches
Array - JavaScript
arrays cannot use strings as element indexes (as in an associative array) but must use integers.
... let arr = ['this is the first 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).
... the 2 in years[2] is coerced into a string by the javascript engine through an implicit tostring conversion.
...And 12 more matches
Index - XPath
WebXPathIndex
21 concat xslt, xslt_reference the concat function concatenates two or more strings and returns the resulting string.
... 22 contains xslt, xslt_reference the contains function determines whether the first argument string contains the second argument string and returns boolean true or false.
... 29 format-number xslt, xslt_reference the format-number function evaluates a number and returns a string representing the number in a given format.
...And 12 more matches
page-worker - Archive of obsolete content
with contentscript you pass the script as a string, as in the examples above.
...length; i++) { " + " postmessage(elements[i].textcontent) " + "}"; // create a page worker that loads wikipedia: pageworkers.page({ contenturl: "http://en.wikipedia.org/wiki/internet", contentscript: script, contentscriptwhen: "ready", onmessage: function(message) { console.log(message); } }); for conciseness, this example creates the content script as a string and uses the contentscript property.
... unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
...And 11 more matches
panel - Archive of obsolete content
var myscript = "window.addeventlistener('click', function(event) {" + " var t = event.target;" + " if (t.nodename == 'a')" + " self.port.emit('click-link', t.tostring());" + "}, false);" var mypanel = require("sdk/panel").panel({ contenturl: "http://www.bbc.co.uk/mobile/index.html", contentscript: myscript }); mypanel.port.on("click-link", function(url) { console.log(url); }); mypanel.show(); this example uses contentscript to supply the script as a string.
... warning: unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
... contenturl string,url the url of the content to load in the panel.
...And 11 more matches
Creating Reusable Modules - Archive of obsolete content
a hashing add-on a hash function takes a string of bytes of any length, and produces a short, fixed length string of bytes as output.
...r;1"] .createinstance(nsifilepicker); var window = require("sdk/window/utils").getmostrecentbrowserwindow(); fp.init(window, "select a file", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filterall | nsifilepicker.filtertext); var rv = fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the path as string.
... note that you usually won't // need to work with the string paths.
...And 11 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
you can perform a full-text search of the firefox source code in mozilla cross-reference using character strings, filenames, etc as search keys.
... opening binary files listing 13 shows how to get a files contents as a bytestring (where 1 byte = an array of 8 bits).
...eam); filestream.init(file, 1, 0, false); var binarystream = components.classes['@mozilla.org/binaryinputstream;1'] .createinstance(components.interfaces.nsibinaryinputstream); binarystream.setinputstream(filestream); var array = binarystream.readbytearray(filestream.available()); binarystream.close(); filestream.close(); alert(array.map( function(aitem) {return aitem.tostring(16); } ).join(' ').touppercase( )); when we initialized nsifileinputstream, we set the second and third parameters to initialize it in read-only mode.
...And 11 more matches
Install script template - Archive of obsolete content
ore.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 disk space if(verifydiskspace(pluginsfolder, p...
... * * @param rootkey must be one of these two string values hkey_local_machine or hkey_current_user * @param plidid plid for plugins * @param dllabsolutepath the fully qualified path to the dll * @param xptabsolutepath the fully qualified path to the xpt * @param plugindescription a string describing the plugin * @param vendor a string describing the vendor * @param productname the name of this software * @param pluginv...
...ersion version string of the plugin * @param mimetype mime type handled by the plugin plugins with more than one mime type might use an array * @param suffix suffix handled by plugin (e.g.
...And 11 more matches
prefwindow - Archive of obsolete content
<preference id="pref-backup" name="myapp.mybackups" type="bool"/> <preference id="pref-backupduration" name="myapp.mybackups.duration" type="int"/> </preferences> <checkbox label="automatically save backups" preference="pref-backup"/> <textbox label="duration:" preference="pref-backupduration"/> </prefpane> </prefwindow> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... buttonalign type: string the value of the align attribute for the box containing the buttons.
... buttondir type: string the value of the dir attribute for the box containing the buttons.
...And 11 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
27 base64 advanced, base64, javascript, typed arrays, uri, url, unicode problem, atob(), btoa() base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation.
... 71 character codingscripting, glossary, strings a character is either a symbol (letters, numbers, punctuation) or non-printing "control" (e.g., carriage return or soft hyphen).
...an element, text string, or comment).
...And 11 more matches
Extending a Protocol
the method will take one argument, a domstring, which we will pass to the parent process.
... then we will send that same string back to the child process.
... the webidl for this will be: partial interface navigator { promise<domstring> echo(domstring somestring); }; learning goals are: extending an existing ipdl protocol.
...And 11 more matches
JNI.jsm
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.
... return value blah blah newstring() blah blah cdata newstring( ajenv, astr ); parameters ajenv the return value of getforthread().
... astr a javascript string, use any encoding desired.
...And 11 more matches
Scripting Java
the reason is that javascript has its own top-level objects boolean, math, number, object, and string that are different from the classes by those names defined in the java.lang package.
...using the javascript for..in construct, we can print out all these values: js> for (i in f) { print(i) } exists parentfile mkdir tostring wait [44 others] note that not only the methods of the file class are listed, but also the methods inherited from the base class java.lang.object (like wait).
... public class overload { public string f(object o) { return "f(object)"; } public string f(string s) { return "f(string)"; } public string f(int i) { return "f(int)"; } public string g(string s, int i) { return "g(string,int)"; } public string g(int i, string s) { return "g(int,string)"; } public static void main(string[] args) { overload o = new overload(); object[] a = new object[] { new inte...
...And 11 more matches
nsICategoryManager
xpcom/components/nsicategorymanager.idlscriptable this interface provides access to a data structure that holds a list of name-value pairs, called categories, where each value is a list of strings.
...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 acategory); string getcategoryentry(in string acategory, i...
...n string aentry); methods addcategoryentry() this method sets the value for the given entry on the given category.
...And 11 more matches
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...
...idomattr oldattr) void removeattributens(in domstring namespaceuri, in domstring localname) void setattribute(in domstring name, in domstring value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in domstring namespaceuri, in domstring qualifiedname, in domstring value) attributes attribute type description tagname domstring the element tag name.
...domstring getattribute( in domstring name ); parameters name attribute name return value a domstring containing the attribute value.
...And 11 more matches
nsIEffectiveTLDService
it is not recommended to use this interface for determining whether a given string "is a domain name".
... 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 public suffix with a given ...
... acstring getbasedomain( in nsiuri auri, [optional] in pruint32 aadditionalparts ); parameters auri the uri to be analyzed.
...And 11 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); void setreferrerwithpolicy(in nsiuri referrer, in ...
...unsigned long referrerpolicy); void setrequestheader(in acstring aheader, in acstring avalue, in boolean amerge); void setresponseheader(in acstring header, in acstring value, in boolean merge); void visitoriginalresponseheaders(in nsihttpheadervisitor avisitor); void visitrequestheaders(in nsihttpheadervisitor avisitor); void visitresponseheaders(in nsihttpheadervisitor avisitor); constants constant description referrer_policy_no_referrer_when_downgrade default; indicates not to pass on the referrer when downgrading from https to http referrer_policy_no_referrer indicates no referrer will be sent referrer_policy_origin only send the origin of the referring uri referrer_policy_origin_w...
... requestmethod acstring set or get the http request method (default is "get").
...And 11 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 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, size_is(count)] out wstring hostnames); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in astring 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.
... nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearchstring missing description apreviousresult missing description aelement missing description return value missing description countlogins() returns the number of logins matching the specified criteria.
...And 11 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, size_is(count)] out wstring hostnames); void getallencryptedlogins([optional] out unsigned ...
...long count, [retval, array, size_is(count)] out nsilogininfo logins); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in astring ahost); void init(); void initwithfile(in nsifile ainputfile, in nsifile aoutputfile); 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); attributes attribute type description uibusy boolean true when a master password prompt is being shown.
...unsigned long countlogins( in astring ahostname, in astring aactionurl, in astring ahttprealm ); parameters ahostname the hostname to which to restrict the search.
...And 11 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 folder, in print64 oldp...
...arent, in print32 oldindex, in print64 newparent, in print32 newindex); obsolete since gecko 1.9 void onfolderremoved(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onitemadded(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, in prtime adateadded, in acstring aguid, in acstring aparentguid); void onitemchanged(in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); void onitemmoved(in long long aitemid, in long long aoldparentid, in long aoldindex, in long long anewparenti...
...d, in long anewindex, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentguid); void onitemreplaced(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 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 ...
...And 11 more matches
nsITransferable
to create an instance, use: var transferable = components.classes["@mozilla.org/widget/transferable;1"] .createinstance(components.interfaces.nsitransferable); it's important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the mime type of the format supported by the flavor.
... 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 ); void init(in nsiloadcontext acontext); boolean islargedataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code ...
... kfilemime application/x-moz-file an arbitrary file (is this an nsifile?) kurlmime text/x-moz-url a mozilla url object; this is a text string containing the url, a newline (\n), then the title of the page.
...And 11 more matches
PaymentAddress - Web APIs
properties paymentaddress.addressline read only an array of domstring objects providing each line of the address not included among the other properties.
... paymentaddress.country read only a domstring specifying the country in which the address is located, using the iso-3166-1 alpha-2 standard.
... the string is always given in its canonical upper-case form.
...And 11 more matches
RTCIceCandidate - Web APIs
note: for backward compatibility, the constructor also accepts as input a string containing the value of the candidate property instead of a rtcicecandidateinit object, since the candidate includes all of the information that rtcicecandidateinit does and more.
... properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks.
...this string is empty ("") if the rtcicecandidate is an "end of candidates" indicator.
...And 11 more matches
simple-prefs - Archive of obsolete content
you can store booleans, integers, and string values, and users can configure these preferences in the add-ons manager.
... "preferences": [{ "name": "somepreference", "title": "some preference title", "description": "some short description for the preference", "type": "string", "value": "this is the default string value" }, { "description": "how many of them we have.", "name": "myinteger", "type": "integer", "value": 8, "title": "how many?" }] } each preference is defined by a group of attributes.
...depending on the preference type, this may be an integer, string, or boolean value.
...And 10 more matches
preferences/service - Archive of obsolete content
parameters name : string preference name.
... value : string,number,boolean preference value.
... parameters name : string defaultvalue : string,number,boolean preference value.
...And 10 more matches
File I/O - Archive of obsolete content
here are some of the special locations the directory service supports: (scope: d = product-wide, f = profile wide) string scope meaning achrom d %curprocd%/chrome aplugns d %curprocd%/plugins (deprecated - use aplugnsdl) aplugnsdl d comsd n/a %curprocd%/components curprocd n/a current working directory (usually the application's installation directory).
... look in the source for other strings available: xpcom/io/nsappdirectoryservicedefs.h, xpcom/io/nsdirectoryservicedefs.h.
... nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share".
...And 10 more matches
XPCOM Objects - Archive of obsolete content
the string between the brackets is just an identifier, in this case corresponding to the observer service.
... you'll usually know what string to use by reading examples and documentation.
...if you want to see the list in your current firefox installation, just run the following code in the error console: var str = ""; for (var i in components.classes) { str += i + "\n" }; str a run on firefox 3.6.2 with a few extensions installed yields 876 strings.
...And 10 more matches
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
(note that any falsey value will suffice, including undefined, null, and the empty string.
...string a simple menuitem with the given string label.
... data string an arbitrary string that the feature may associate with the menuitem.
...And 10 more matches
textbox - Archive of obsolete content
emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value.
... label type: string if present and not empty, this will be exposed to screen readers through the label property.
... placeholder type: string a string that appears in the textbox when it has no value.
...And 10 more matches
Parsing microformats in JavaScript - Archive of obsolete content
return value a string containing the normalized date.
... return value a string containing the property's value.
... return value a string containing the email address.
...And 10 more matches
Dict.jsm
note: you can actually specify non-strings as keys; these are converted to strings before being used, so they're documented here as if they were a string parameter.
... in firefox 19 and above, you may also pass a json string to initialize the dictionary: var somejson = '{key1: "foo", key2: {}}'; var newdict = new dict(somejson); note: any string you pass will be assumed to be json.
... method overview dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type description count number the number of items in the dictionary.
...And 10 more matches
Localization and Plurals
this page is to help explain how to localize these strings so that the correct plural form is shown to the user.
...you may also need to localize the initial strings for your code, so it would be good to read through at least the usage section as well.
...for example, english uses plural rule 1, and localizing plurals would require a string of "plural;plurals" where the first word is the singular form and the second is the general plural form.
...And 10 more matches
Rhino shell
the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160 or 170.
... arguments the arguments object is an array containing the strings of all the arguments given at the command line when the shell was invoked.
... defineclass(classname) define an extension using the java class named with the string argument classname.
...And 10 more matches
SpiderMonkey 1.8.5
the rooting apis (js_addroot, js_removeroot, etc.) have been replaced with a family of type-safe functions (js_addstringroot, js_removestringroot, etc.) that are easier to use correctly.
... js_getstringbytes and js_getstringchars are gone.
... there is no longer an infallible way to examine string characters.
...And 10 more matches
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
primitive input streams type native class contract id interface how to bind to a data source generic nsstorageinputstream n/a nsiinputstream, nsiseekablestream storagestream.newinputstream(); string (8-bit characters) nsstringstream @mozilla.org/io/string-input-stream;1 nsistringinputstream stream.setdata(data, length); file nsfileinputstream @mozilla.org/network/file-input-stream;1 nsifileinputstream stream.init(file, ioflags, perm, behaviorflags); zip nsjarinputstream n/a nsiinputstream zipreader.getinputstream(zipentry); ...
...however, it is usually better to create an input stream that you then feed to the output stream: var outstream = components.classes["@mozilla.org/storagestream;1"] .createinstance(components.interfaces.nsistoragestream) .getoutputstream(); var instream = components.classes["@mozilla.org/io/string-input-stream;1"] .createinstance(components.interfaces.nsistringinputstream); var data = "hello world"; instream.setdata(data, data.length); while (instream.available()) { outstream.writefrom(instream, instream.available()); } note this is an inefficient example: the only important part is how to feed the output stream.
... a note about unicode strings versus nsiinputstream nsiinputstream and nsioutputstream work with 8-bit characters.
...And 10 more matches
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 nsistringbundle abundle) ...
... astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description firstname astring lastname astring phoneticfirstname astring phoneticlastname astring displayname astring nickname astring primaryemail astring secondemail astring workphone astring homephone astring faxnumber astring pagernumber astring cellularnumber astring workphonetype astring homephonetype astring faxnumbertype astring pagernumbertype astring cellularnumbertype astring ...
... homeaddress astring homeaddress2 astring homecity astring homestate astring homezipcode astring homecountry astring workaddress astring workaddress2 astring workcity astring workstate astring workzipcode astring workcountry astring jobtitle astring department astring company astring aimscreenname astring anniversaryyear astring anniversarymonth astring anniversaryday astring spousename astring familyname astring defaultaddress astri...
...And 10 more matches
nsIAccessibleRetrieval
ccessible(); nsiaccessible getattachedaccessiblefor(in nsidomnode anode); nsiaccessible getcachedaccessible(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsidomnode getrelevantcontentnodefor(in nsidomnode anode); astring getstringeventtype(in unsigned long aeventtype); astring getstringrelationtype(in unsigned long arelationtype); astring getstringrole(in unsigned long arole); nsidomdomstringlist getstringstates(in unsigned long astates, in unsigned long aextrastates); methods getaccessiblefor() return an nsiaccessible for a dom node in pres shell 0.
...getstringeventtype() get the type of accessible event as a string.
... astring getstringeventtype( in unsigned long aeventtype ); parameters aeventtype the accessible event type constant.
...And 10 more matches
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.
... nsiutf8stringenumerator getkeys( in autf8string asection ); parameters asection the name of the section whose keys you wish to enumerate.
... return value an nsiutf8stringenumerator object that can be used to access the section's keys.
...And 10 more matches
nsIIOService
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,...
...fo(in nsiuri auri, in nsiloadinfo aloadinfo); nsichannel newchannelfromuriwithproxyflags2(in nsiuri auri, in nsiuri aproxyuri, in uint32_t aproxyflags,in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsiuri newfileuri(in nsifile afile); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description offline boolean returns true if networking is in "offline" mode.
... boolean allowport( in long aport, in string ascheme ); parameters aport the port to check ascheme the scheme for the protocol handler that could override the ioservice's decision.
...And 10 more matches
Type conversion
s.char.array(10)(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.ptr); somecfunction(buffer); // here ctypes.char.array(10)() is converted to ctypes.char.ptr type implicit conversion can be tested in the following way: var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.bool } ])(); mystruct.v = 1; console.log(mystruct.v.tostring()); // 'true' boolean type target type source converted value ctypes.bool js boolean src js number (0 or 1) if src == 0: false if src == 1: true var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.bool } ])(); mystruct.v = true; console.log(mystruct.v.tostring()); // 'true' mystruct.v = false; console.log(mystruct.v.tostr...
...ing()); // 'false' mystruct.v = 1; console.log(mystruct.v.tostring()); // 'true' mystruct.v = 0; console.log(mystruct.v.tostring()); // 'false' mystruct.v = 10; // throws error mystruct.v = "a"; // throws error integer types target type source converted value ctypes.char16_t js string (only if its length == 1) src.charcodeat(0) any integer types js number (only if fits to the size) src js boolean if src == true: 1 if src == false: 0 var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.char16_t } ])(); mystruct.v = 0x41; console.log(mystruct.v.tostring()); // "a" mystruct.v = true; console.log(mystruct.v.tostring()); // "\x01" mystruct.v = "x"; console.log(mystruct.v.tostring()); // "x" ...
...mystruct.v = "xx"; // throws error var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.int16_t } ])(); mystruct.v = 0x41; console.log(mystruct.v.tostring()); // 65 mystruct.v = true; console.log(mystruct.v.tostring()); // 1 mystruct.v = "x"; // throws error integer/float types are implicitly convertible if any data of source type could be representable in the target type.
...And 10 more matches
Web Console Helpers - Firefox Developer Tools
$(selector, element) looks up a css selector string selector , returning the first node descended from element that matches.
... $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match.
...the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used.
...And 10 more matches
Document.execCommand() - Web APIs
parameters acommandname a domstring specifying the name of the command to execute.
... avalueargument for commands which require an input argument, is a domstring providing that information.
...this requires a <color> value string to be passed in as a value argument.
...And 10 more matches
Element - Web APIs
WebAPIElement
element.classname is a domstring representing the class of the element.
... element.computedname read only returns a domstring containing the label exposed to accessibility.
... element.computedrole read only returns a domstring containing the aria role that has been applied to a particular element.
...And 10 more matches
SubtleCrypto.importKey() - Web APIs
syntax const result = crypto.subtle.importkey( format, keydata, algorithm, extractable, usages ); parameters format is a string describing the data format of the key to import.
... for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm.
... for pbkdf2 : pass the string pbkdf2.
...And 10 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
here are some functions to handle this: function getgenericpref(branch,prefname) { switch (branch.getpreftype(prefname)) { default: case 0: return undefined; // pref_invalid case 32: return getucharpref(prefname,branch); // pref_string case 64: return branch.getintpref(prefname); // pref_int case 128: return branch.getboolpref(prefname); // pref_bool } } function setgenericpref(branch,prefname,prefvalue) { switch (typeof prefvalue) { case "string": setucharpref(prefname,prefvalue,branch); return; case "number": branch.setintpref(prefname,prefvalue); ...
...branch : services.prefs; return branch.getcomplexvalue(prefname, components.interfaces.nsisupportsstring).data; } function setucharpref(prefname,text,branch) // unicode setcharpref { var string = components.classes["@mozilla.org/supports-string;1"] .createinstance(components.interfaces.nsisupportsstring); string.data = text; branch = branch ?
... branch : services.prefs; branch.setcomplexvalue(prefname, components.interfaces.nsisupportsstring, string); } just grab the above, move your default preferences file to your chrome mapping, and then do the following line once during your startup: services.scriptloader.loadsubscript("chrome://myaddon/content/defaultprefs.js", {pref:setdefaultpref} ); that's it.
...And 9 more matches
Solve common problems in your JavaScript code - Learn web development
what are strings?
... strings how do you create a string in javascript?
... how do you escape characters in strings?
...And 9 more matches
Application Translation with Mercurial
either translate a different product now or contact the person responsible for localization from the team's page (see above) so he can notify you by mail when the next strings for translation become available.
... file comparison program for the translation, it is recommend to use file comparison program to compare the english file (containing the new texts) with the file of your locale (which is still missing the new strings).
... progress tracking tool to track which strings and files already have been translated and later also to see which new strings have already been tested in the product as being a good translation for the functionality behind the translated strings and that the translated texts fit into the available, the translation progress should be tracked.
...And 9 more matches
Localizing with Pontoon
only the toolbar on top belongs to pontoon, containing the following items (from left to right): list of strings opens a sidebar with a list of all strings to localize.
... translate strings when using pontoon for localization, you have a couple of options to translate your strings.
...here's how you translate your first string: hover over the text you want to translate with your mouse.
...And 9 more matches
Mozilla DOM Hacking Guide
this is because, if we had a setlocation() method, it would take an nsidomlocation parameter, and not a url string.
...here is the description of the structure: const char *mname: c-style string that is passed as second argument to the macro.
... static nsresult definestaticjsvals(jscontext *cx);: used to define all the static jsstring data members of nsdomclassinfo.
...And 9 more matches
sample2
ture-----" #define ns_cert_header "-----begin certificate-----" #define ns_cert_trailer "-----end certificate-----" /* missing publically from nss versions earlier than 3.13 */ #ifndef sec_error_base #define sec_error_base (-0x2000) typedef enum { sec_error_io = sec_error_base + 0, sec_error_token_not_logged_in = (sec_error_base + 155), sec_error_end_of_list } secerrorcodes; #endif /* port_errortostring introduced in nss 3.13.
... on earlier versions of nss that * don't support error tables, pr_errortostring will return "unknown code".
... */ #ifndef port_errortostring #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif /* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s %s %s %s %s %s %s %s %s %s\n\n", progname, " -<g|a|h|e|ds|v> -d <dbdirpath> ", "[-p <dbpwd> | -f <dbpwdfile>] [-z <noisefilename>] [-a <\"\">]", "-s <subject> -r <csr> | ", "-n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ] | ", "-n <nickname> -b <headerfi...
...And 9 more matches
NSS tools : modutil
-rawadd add the module spec string to the secmod.db database.
... -string config_string pass a configuration string for the module being added to the database.
...unix/fort.so { relativepath{%root%/lib/fort.so} absolutepath{/usr/local/netscape/lib/fort.so} filepermissions{555} } xplat/instr.html { relativepath{%root%/docs/inst.html} absolutepath{/usr/local/netscape/docs/inst.html} filepermissions{555} } } } irix:6.2:mips { equivalentplatform { sunos:5.5.1:sparc } } } script grammar the script is basic java, allowing lists, key-value pairs, strings, and combinations of all of them.
...And 9 more matches
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
-rawadd add the module spec string to the secmod.db database.
... -string config_string pass a configuration string for the module being added to the database.
... filepermissions{555} } xplat/instr.html { relativepath{%root%/docs/inst.html} absolutepath{/usr/local/netscape/docs/inst.html} filepermissions{555} } } } irix:6.2:mips { equivalentplatform { sunos:5.5.1:sparc } } } script grammar the script is basic java, allowing lists, key-value pairs, strings, and combinations of all of them.
...And 9 more matches
SpiderMonkey Internals
compiler the compiler consumes javascript source code and produces a script which contains bytecode, source annotations, and a pool of string, number, and identifier literals.
...it is used to hold js objects and string descriptors (jsstring), but not string bytes.
... because the gc is exact, c/c++ applications must ensure that all live objects, strings, and numbers are gc-reachable.
...And 9 more matches
JS_EncodeCharacters
convert a 16-bit string to an 8-bit string.
... src const jschar * the pointer to 16-bit values of jsstring.
... this can be obtained with js_getstringchars.
...And 9 more matches
Redis Tips
redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc.
... event logging lists, zsets, pubsub queues lists (rpush, blpop, blpoprpush, etc.) priority queues zsets membership sets, bitstrings state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse indexes (never use keys in production) documentation redis has fantastic documentation.
... things are strings, mostly as you can see from that last example, the values pointed to by keys are strings or they are nil.
...And 9 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 attributes these bits allow you to control the conversion of text...
... wstring scantxt( in wstring text, in unsigned long whattodo ); parameters text the original, plain text to scan and convert into html.
... return value the html version of the specified string.
...And 9 more matches
nsIDialogParamBlock
embedding/components/windowwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog.
... 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.
...getstring() get a previously set string.
...And 9 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 long long asessionid); obs...
... nsinavhistoryquery getnewquery(); nsinavhistoryqueryoptions getnewqueryoptions(); nsinavhistoryresult executequery(in nsinavhistoryquery aquery, in nsinavhistoryqueryoptions options); nsinavhistoryresult executequeries([array,size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryoptions options); void querystringtoqueries(in autf8string aquerystring, [array, size_is(aresultcount)] out nsinavhistoryquery aqueries, out unsigned long aresultcount, out nsinavhistoryqueryoptions options); autf8string queriestoquerystring([array, size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryoptions options); void addobserver(in nsinavhistoryobserver o...
...bserver, in boolean ownsweak); void removeobserver(in nsinavhistoryobserver observer); void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports aclosure); void importhistory(in nsifile file); astring getcharsetforuri(in nsiuri auri); astring setcharsetforuri(in nsiuri auri, in astring acharset); attributes attribute type description hashistoryentries boolean true if there is any history.
...And 9 more matches
Using Objective-C from js-ctypes
#import <appkit/appkit.h> int main(void) { nsspeechsynthesizer* synth = [[nsspeechsynthesizer alloc] initwithvoice: nil]; [synth startspeakingstring: @"hello, firefox!"]; // wait until start speaking.
... // [nsstring getbytes:maxlength:usedlength:encoding:options:range:remainingrange:] sel foo = sel_registername("getbytes:maxlength:usedlength:encoding:options:range:remainingrange:"); method which returns non-id type if a method returns a type which is compatible with id, we can cast it, or just use it as id type (since we don't need to use a different type for each instance, in terms of c).
... nsstring literals another objective-c syntax used is the @"..." literal, which creates nsstring instance.
...And 9 more matches
Web Console remoting - Firefox Developer Tools
starting with firefox 24 the errormessage and linetext properties can be long string actor grips if the string is very long.
...in the case of long strings we use the longstringactor.
... javascript evaluation the evaluatejs request and response packets the web console client provides the evaluatejs(requestid, string, onresponse) method which sends the following packet: { "to": "conn0.console9", "type": "evaluatejs", "text": "document", "bindobjectactor": null, "frameactor": null, "url": null, "selectednodeactor": null, } the bindobjectactor property is an optional objectactor id that points to a debugger.object.
...And 9 more matches
HTMLButtonElement - Web APIs
htmlbuttonelement.accesskey is a domstring indicating the single-character keyboard key to give access to the button.
... htmlbuttonelement.formaction is a domstring reflecting the uri of a resource that processes information submitted by the button.
... htmlbuttonelement.formenctype is a domstring reflecting the type of content that is used to submit the form to the server.
...And 9 more matches
HTMLHyperlinkElementUtils - Web APIs
htmlhyperlinkelementutils.href this a stringifier property that returns a usvstring containing the whole url, and allows the href to be updated.
... htmlhyperlinkelementutils.protocol this is a usvstring containing the protocol scheme of the url, including the final ':'.
... htmlhyperlinkelementutils.host this is a usvstring containing the host, that is the hostname, and then, if the port of the url is not empty (which can happen because it was not specified or because it was specified to be the default port of the url's scheme), a ':', and the port of the url.
...And 9 more matches
HTMLIFrameElement - Web APIs
htmliframeelement.align is a domstring that specifies the alignment of the frame with respect to the surrounding context.
... htmliframeelement.frameborder is a domstring that indicates whether to create borders between frames.
... htmliframeelement.height is a domstring that reflects the height html attribute, indicating the height of the frame.
...And 9 more matches
HTMLTableCellElement - Web APIs
htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell..
... htmltablecellelement.scope a domstring indicating the scope of a <th> cell.
... the empty string ("") the header cell has no predefined scope; the user agent will establish the scope based on contextual clues.
...And 9 more matches
Location - Web APIs
WebAPILocation
unction(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
... location.href is a stringifier that returns a usvstring containing the entire url.
... location.protocol is a usvstring containing the protocol scheme of the url, including the final ':'.
...And 9 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
the string "webvtt".
... you may use anything in the text header except newlines or the string "-->".
... on the same line, we then have a string of "-->".
...And 9 more matches
content - CSS: Cascading Style Sheets
WebCSScontent
r values */ content: normal; content: none; /* <image> values */ content: url("http://www.example.com/test.png"); content: linear-gradient(#e66465, #9198e5); /* alt text for generated content, added in the level 3 specification */ content: url("http://www.example.com/test.png") / "this is the alt text"; /* values below can only be applied to generated content using ::before and ::after */ /* <string> value */ content: "prefix"; /* <counter> values */ content: counter(chapter_counter); content: counters(section_counter, "."); /* attr() value linked to the html attribute value */ content: attr(value string); /* language- and position-dependent keywords */ content: open-quote; content: close-quote; content: no-open-quote; content: no-close-quote; /* except for normal and none, several value...
... <string> specifies the "alt text" for the element.
... the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'.
...And 9 more matches
text-transform - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | capitalize | uppercase | lowercase | full-width | full-size-kana examples none <p>initial string <strong>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</strong> </p> <p>text-transform: none <strong><span>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</span></strong> </p> span { text-transform: none; } strong { float: right; } this demonstrates no text transformation.
... capitalize (general) <p>initial string <strong>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</strong> </p> <p>text-transform: capitalize <strong><span>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</span></strong> </p> span { text-transform: capitalize; } strong { float: right; } this demonstrates text capitalization.
... capitalize (punctuation) <p>initial string <strong>(this) “is” [a] –short– -test- «for» *the* _css_ ¿capitalize?
...And 9 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
value a domstring representing a date and time (in the local time zone), or empty.
... methods select(), stepdown(), stepup() value a domstring representing the value of the date entered into the input.
... the format of the date and time value used by this input type is described in local date and time strings in date and time formats used in html.
...And 9 more matches
Details of the object model - JavaScript
a simple object hierarchy with the following objects: employee has the properties name (whose value defaults to the empty string) and dept (whose value defaults to "general").
...it adds the projects property (whose value defaults to an empty array, intended to have an array of strings as its value).
...it adds the machine property (whose value defaults to the empty string) and also overrides the dept property with the value "engineering".
...And 9 more matches
Functions - JavaScript
for example, the following function definition defines myfunc only if num equals 0: var myfunc; if (num === 0) { myfunc = function(theobject) { theobject.make = 'toyota'; } } in addition to defining functions as described here, you can also use the function constructor to create functions from a string at runtime, much like eval().
...console.log(square(5)) // uncaught typeerror: square is not a function const square = function(n) { return n * n; } the arguments of a function are not limited to strings and numbers.
... var createpet = function(name) { var sex; return { setname: function(newname) { name = newname; }, getname: function() { return name; }, getsex: function() { return sex; }, setsex: function(newsex) { if(typeof newsex === 'string' && (newsex.tolowercase() === 'male' || newsex.tolowercase() === 'female')) { sex = newsex; } } } } var pet = createpet('vivie'); pet.getname(); // vivie pet.setname('oliver'); pet.setsex('male'); pet.getsex(); // male pet.getname(); // oliver in the code above, the name variable of the outer function is accessibl...
...And 9 more matches
Numbers and dates - JavaScript
st 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.
... number.parseint() parses a string argument and returns an integer of the specified radix or base.
... methods of number.prototype method description toexponential() returns a string representing the number in exponential notation.
...And 9 more matches
Number - JavaScript
description when used as a function, number(value) converts a string or other value to the number type.
... number.parsefloat(string) this is the same as the global parsefloat() function.
... number.parseint(string, [radix]) this is the same as the global parseint() function.
...And 9 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.
... the replacement can be a string or a function to be called for each match.
... syntax regexp[symbol.replace](str, newsubstr|function) parameters str a string that is a target of the replacement.
...And 9 more matches
RegExp.prototype.exec() - JavaScript
the exec() method executes a search for a match in a specified string.
...using this internally, exec() can be used to iterate over multiple matches in a string of text (with capture groups), as opposed to getting just the matching strings with string.prototype.match().
... a newer function has been proposed to simplify matching multiple parts of a string (with capture groups): string.prototype.matchall().
...And 9 more matches
Understanding WebAssembly text format - WebAssembly
what if we wanted to log a text string?
... to deal with strings and other more complex data types, webassembly provides memory (although we also have reference types in newer implementation of webassembly).
... so a string is just a sequence of bytes somewhere inside this linear memory.
...And 9 more matches
Content Scripts - Archive of obsolete content
odules in "lib", can use the sdk high-level and low-level apis, but can't access web content directly content scripts can't use the sdk's apis (no access to globals exports, require) but can access web content sdk apis that use content scripts, like page-mod and tabs, provide functions that enable the add-on's main code to load content scripts into web pages content scripts can be loaded in as strings, but are more often stored as separate files under the add-on's "data" directory.
...in this case the content script is passed in as a string.
... the content script simply replaces the content of the page: // main.js var tabs = require("sdk/tabs"); var contentscriptstring = 'document.body.innerhtml = "<h1>this page has been eaten</h1>";' tabs.activetab.attach({ contentscript: contentscriptstring }); the following high-level sdk modules can use content scripts to modify web pages: page-mod: enables you to attach content scripts to web pages that match a specific url pattern.
...And 8 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
autocompletesearchparam new in thunderbird 2 requires seamonkey 1.1 type: string a string which is passed to the search component.
... inputtooltiptext type: string the tooltip text for the textbox.
... label type: string the label that will appear on the element.
...And 8 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
autocompletesearchparam new in thunderbird 2 requires seamonkey 1.1 type: string a string which is passed to the search component.
... inputtooltiptext type: string the tooltip text for the textbox.
... label type: string the label that will appear on the element.
...And 8 more matches
toolbarbutton - Archive of obsolete content
group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group.
... label type: string the label that will appear on the element.
... title type: string this functionality only applies when toolbarbutton is used in the customize toolbar dialog.
...And 8 more matches
The First Install Problem - Archive of obsolete content
add the following values to the newly created key -- some are string values (reg_sz), and some are actually subkeys.
... string values take the form stringvalue=valuedata, and subkeys contain their own string values and value data.
... "path" -- string value -- this would be the absolute path to the plugin module.
...And 8 more matches
PKCS #11 Module Specs
manufacturerid override the default manufactureid value for the module returned in the ck_info, ck_slot_info, and ck_token_info structures with an internationalize string (utf8).
... librarydescription override the default librarydescription value for the module returned in the ck_info structure with an internationalize string (utf8).
... cryptotokendescription override the default label value for the internal crypto token returned in the ck_token_info structure with an internationalize string (utf8).
...And 8 more matches
NSS PKCS11 Functions
tokendescription the label value for this token returned in the ck_token_info structure with an internationalize string (utf8).
...slotdescription the slotdescription value for this token returned in the ck_slot_info structure with an internationalize string (utf8).
... for more info on module strings see pkcs11_module_specs.
...And 8 more matches
NSS Tools modutil
to see a usage string, issue the command without options.
...str.html { relativepath{%root%/docs/inst.html} absolutepath{/usr/local/netscape/docs/inst.html} filepermissions{555} } } } irix:6.2:mips { equivalentplatform { sunos:5.5.1:sparc } }} script grammar the script file grammar is as follows: --> valuelistvaluelist --> value valuelist <null>value ---> key_value_pair stringkey_value_pair --> key { valuelist }key --> stringstring --> simple_string "complex_string"simple_string --> [^ \t\n\""{""}"]+ (no whitespace, quotes, or braces.)complex_string --> ([^\"\\\r\n]|(\\\")|(\\\\))+ (quotes andbackslashes must be escaped with a backslash.
... a complex string must notinclude newlines or carriage returns.) outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.
...And 8 more matches
Introduction to the JavaScript shell
-e script runs the specified script, which is a literal string containing the code to execute.
...kind is either 'all' (default) to count all things or one of 'object', 'double', 'string', 'function', 'qname', 'namespace', 'xml' to count only things of that kind.
... evalcx(string[, object]) evaluates the javascript code in string.
...And 8 more matches
Accessing the Windows Registry Using XPCOM
a simple example here's a simple example showing how to read your windows productid: var wrk = components.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft\\windows\\currentversion", wrk.access_read); var id = wrk.readstringvalue("productid"); wrk.close(); this example, while simple, shows several important things about using the interface.
...also notice that the path to the key has backslashes escaped, a necessity in javascript and c++ string constants.
... the value is read using readstringvalue().
...And 8 more matches
Component Internals
as a component in the xpcom framework illustrates, in addition to the nsgetmodule entry point, there are nsimodule and nsifactory interfaces that control the actual creation of the component, and also the string and xpcom glue parts, which we'll discuss in some detail in the next section (see xpcom glue).
... these latter supply ease-of-development utilities like smart pointers, generic modules support, and simple string implementations.
... xpcom string classes the base string types that xpcom uses are nsastring and nsacstring.
...And 8 more matches
nsIComponentRegistrar
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 nsifil...
...e afile, in string aloaderstr, in string atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactorylocation(in nscidref aclass, in nsifile afile); methods autoregister() register a component (.manifest) file or all component files in a directory.
...string cidtocontractid( in nscidref aclass ); parameters aclass the classid to be queried.
...And 8 more matches
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 attribute type description formsubmiturl astring the origin, not url, a form-based login was submitted to.
... hostname astring the origin, not hostname, to which the login applies (for example, "https://www.site.com").
... httprealm astring the http realm for which the login was requested.
...And 8 more matches
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.
... string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters propertyname the name of the property to retrieve.
...And 8 more matches
nsIMsgDBView
nsmsgnavigationtypevalue motion, out nsmsgkey resultid, out nsmsgviewindex resultindex, out nsmsgviewindex threadindex, in boolean wrap); boolean navigatestatus(in nsmsgnavigationtypevalue motion); nsmsgkey getkeyat(in nsmsgviewindex index); nsimsgdbhdr getmsghdrat(in nsmsgviewindex index); nsimsgfolder getfolderforviewindex(in nsmsgviewindex index); acstring geturiforviewindex(in nsmsgviewindex index); nsimsgdbview clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgviewindex indices, out unsigned long ...
...count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyviewindex(in nsmsgviewindex aindex); void loadmessagebyurl(in string aurl); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); void ondeletecompleted(in boolean succeeded); nsmsgviewindex findindexfromkey(in nsmsgkey amsgkey, in boolean aexpand); void expandandselectthreadbyindex(in nsmsgviewindex aindex, in boolean aaugment); void addcolumnhandler(in astring acolumn, in nsimsgcustomcolumnhandler ahandler); void removecolumnhandler(in astring acolumn); nsimsgcustomcolumnhandler getcolumnhandler(in ...
...astring acolumn); attributes attribute type description viewtype nsmsgviewtypevalue readonly: type of view.
...And 8 more matches
nsIScriptableUnicodeConverter
this legacy api represents binary data using the lower haft of each 16-bit code unit in a javascript string.
...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); nsiinputstream converttoinpu...
...tstream(in astring astring); attributes attribute type description charset string current character set.
...And 8 more matches
nsISecurityCheckedComponent
inherits from: nsisupports last changed in gecko 1.7 capability strings in gecko, a "capability" is a string identifying a set of actions that code is allowed to perform.
...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.
... string cancallmethod( in nsiidptr iid, in wstring methodname ); parameters iid the iid of the interface this method exists on.
...And 8 more matches
nsIWritablePropertyBag2
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 pruint32 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.
... setpropertyasastring() void setpropertyasastring( in astring prop, in astring value ); parameters prop property to set the value of.
...And 8 more matches
nsIXULAppInfo
attributes attribute type description appbuildid acstring the application's build id/date, for example "2004051604".
... id acstring the xul application's uuid.
... can be an empty string, if id is not set.
...And 8 more matches
Debugger.Memory - Firefox Developer Tools
reason a very short string describing the reason why the collection was triggered.
...stroy” “set_new_document” “set_doc_shell” “dom_utils” “dom_ipc” “dom_worker” “inter_slice_gc” “refresh_frame” “full_gc_timer” “shutdown_cc” “user_inactive” nonincrementalreason if spidermonkey’s collector determined it could not incrementally collect garbage, and had to do a full gc all at once, this is a short string describing the reason it determined the full gc was necessary.
... strings spidermonkey has three representations of strings: normal: the string’s text is counted in its size.
...And 8 more matches
Debugger.Object - Firefox Developer Tools
class a string naming the ecmascript [[class]] of the referent.
...for example: function h() { var i = function() {}; // display name: h/i f(function () {}); // display name: h/< } var s = f(function () {}); // display name: s< parameternames if the referent is a debuggee function, the names of the its parameters, as an array of strings.
... errormessagename if the referent is an error created with an engine internal message template this is a string which is the name of the template; undefined otherwise.
...And 8 more matches
HTMLLinkElement - Web APIs
htmllinkelement.as is a domstring representing the type of content being loaded by the html link.
... htmllinkelement.crossorigin is a domstring that corresponds to the cors setting for this link element.
... htmllinkelement.href is a domstring representing the uri for the target resource.
...And 8 more matches
MediaTrackConstraints - Web APIs
properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are acceptable and/or required.
... groupid a constraindomstring object specifying a group id or an array of group ids which are acceptable and/or required.
... properties of image tracks whitebalancemode a string specifying one of "none", "manual", "single-shot", or "continuous".
...And 8 more matches
URLUtilsReadOnly - Web APIs
urlutilsreadonly.href read only is a domstring containing the whole url.
... urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url, including the final ':'.
... urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url.
...And 8 more matches
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).
... syntax var encodeddata = scope.btoa(stringtoencode); parameters stringtoencode the binary string to encode.
... return value an ascii string containing the base64 representation of stringtoencode.
...And 8 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
value a domstring representing a url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange().
... value the <input> element's value attribute contains a domstring which is automatically validated as conforming to url syntax.
... more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed.
...And 8 more matches
itemprop - HTML: Hypertext Markup Language
property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>.
...cal-trailer.html" itemprop="trailer">trailer</a> </div> structured data item itemprop name itemprop value itemprop name avatar itemprop director james cameron itemprop genre science fiction itemprop trailer ../movies/avatar-theatrical-trailer.html properties properties have values that are either a string or a url.
... when a string value is a url, it is expressed using the <a> element and its href attribute, the <img> element and its src attribute, or other elements that link to or embed external resources.
...And 8 more matches
Regular expression syntax cheatsheet - JavaScript
/oon\b/ matches the "oon" in "moon", because "oon" is the end of the string, thus not followed by a word character.
...the beginning and end of a string are considered non-words.
...if you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below).
...And 8 more matches
Functions - JavaScript
the function constructor note: using the function constructor to create functions is not recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems.
... functionbody a string containing the javascript statements comprising the function body.
... note: using the generatorfunction constructor to create functions is not recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems.
...And 8 more matches
Intl.Locale.prototype.collation - JavaScript
the intl.locale.prototype.collation property is an accessor property that returns the collation type for the locale, which is used to order strings according to the locale's rules.
... description collation is the process of ordering strings of characters.
... it is used whenever strings must be sorted and placed into a certain order, from search query results to ordering records in a database.
...And 8 more matches
requiredFeatures - SVG: Scalable Vector Graphics
the requiredfeatures attribute takes a list of feature strings, with the individual strings separated by white space.
...if a null string or empty string value is given to attribute requiredfeatures, the attribute is evaluate to false.
..." x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures supported</text> </g> <g requiredfeatures=""> <rect fill="crimson" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures not supported</text> </g> </svg> usage notes value <list-of-features> default value true if not defined, false if null or empty string as value animatable no <list-of-features> this is a list of feature strings, separated using white space.
...And 8 more matches
self - Archive of obsolete content
globals properties uri this property represents an add-on associated unique uri string.
... this uri can be used for apis which require a valid uri string, such as the passwords module.
... id this property is a printable string that is unique for each add-on.
...And 7 more matches
lang/type - Archive of obsolete content
isstring(value) returns true if value is a string, false otherwise.
... uses typeof operator to check type, and will only properly detect string primitives: for example, a string created with new string() will always return false.
... let { isstring } = require('sdk/lang/type'); isstring('my string'); // true isstring(100); // false isstring('100'); // true parameters value : mixed the variable to check.
...And 7 more matches
Miscellaneous - Archive of obsolete content
var osstring = services.appinfo.os; detecting the host application and version // get the name of the application running us services.appinfo.name; // returns "firefox" for firefox services.appinfo.version; // returns "2.0.0.1" for firefox version 2.0.0.1 retrieving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-guid@example.org", function(addon) { // this is an asynchronous callback function that might not be called immediately alert("my extensio...
...ils = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindowutils); utils.sendmouseevent("mousedown", 10, 10, 0, 1, 0); utils.sendmouseevent("mouseup", 10, 10, 0, 1, 0); getting the currently selected text from browser.xul overlay context: var selectedtext = document.commanddispatcher.focusedwindow.getselection().tostring(); or: content.getselection(); // |window| object is implied; i.e., window.content.getselection() or: getbrowserselection(); // |window| object is implied; i.e., window.getbrowserselection() this final option massages the selection to remove leading and trailing whitespace.
...note that it returns the empty string (""), not false, when nothing is selected.
...And 7 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
passing around functions/code as strings often you'll want to pass functions or code to other functions, most notoriously settimeout and addeventlistener.
... often this is done passing around strings.
...settimeout("dosomething();", 100); addeventlistener("load", "myaddon.init(); myaddon.onload();", true); setinterval(am_i_a_string_or_function_reference_qmark, 100); that in itself is certainly not elegant, but it may also become a security issue if you pass code that was externally retrieved (or at least contains bits of externally retrieved data): // do not use!
...And 7 more matches
Editor Embedding Guide - Archive of obsolete content
getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommandblock >all string cmd_acronym toggles acronym on selection.
... getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) note for color values, use the cstring representation of rrggbb, e.g., red="#ff0000" and black="#000000".
... getcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) note for color values, use the cstring representation of rrggbb, e.g., red="#ff0000" and black="#000000".
...And 7 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
351 stringbundle.src xul attributes, xul reference no summary!
...an output stream is an object which can be used to write bytes, strings and other values to a file.
... 485 getformattedstring xul methods, xul reference if you need to handle substitutions involving plurals, take a look at localization and plurals.
...And 7 more matches
button - Archive of obsolete content
group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group.
... icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons.
... label type: string the label that will appear on the element.
...And 7 more matches
panel - Archive of obsolete content
ArchiveMozillaXULpanel
flip type: string normally, when a popup opens near the edge of the screen, it flips over to open on the opposite side of the anchor, so that it doesn't extend off the screen.
... label type: string for panels with titlebars, the label on the titlebar.
... position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.
...And 7 more matches
toolbar - Archive of obsolete content
currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar.
...the value of this attribute should be a comma-separated list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer".
... grippytooltiptext seamonkey only type: string the text to appear on the tooltip for the toolbar's grippy when the toolbar is collapsed.
...And 7 more matches
Gecko Compatibility Handbook - Archive of obsolete content
set up browsers for testing the various gecko-based browsers do not always contain netscape in the user-agent string.
...or, if you are using user-agent detection, you can install an extension in firefox or mozilla which allows you to "spoof" the user-agent strings of the various gecko browsers.
... after restarting your browser, add the the user-agent strings that you want to test to the list (tools | user agent switcher | options | options...
...And 7 more matches
Date.prototype.toLocaleFormat() - Archive of obsolete content
the non-standard tolocaleformat() method converts a date to a string using the specified formatting.
...see also the newer version of date.prototype.tolocaledatestring().
... syntax dateobj.tolocaleformat(formatstring) parameters formatstring a format string in the same format expected by the strftime() function in c.
...And 7 more matches
JSObject - Archive of obsolete content
tostring converts a jsobject to a string.
... declaration public object call(string methodname, object args[]) equals method.
...the expression is a string of javascript source code which will be evaluated in the context given by "this".
...And 7 more matches
mozbrowsercontextmenu
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
...its properties are as follows: documenturi a domstring representing the url of the document the menu is associated with.
... uri a domstring.
...And 7 more matches
Localizing without a specialized tool
if you click on the highlighted arrow pointing down while reading this tutorial on mdc, you will see two string that need to be translated: add "mdc search" manage search engines...
...get the source change your current directory to your working directory with the following command: $ cd /path/to/your/working/directory first, you will need to check out the sources of mozilla-1.9.2 together with the en-us strings.
...localizing step-by-step dtd files in order to provide an example that can be viewed quickly in your ui, we'll start by translating a dtd file named searchbar.dtd that contains the string "manage search engines...".
...And 7 more matches
JSAPI Cookbook
to query whether a value has a particular type, use a correspondingly named member testing function: // javascript var v = computesomevalue(); var isstring = typeof v === "string"; var isnumber = typeof v === "number"; var isnull = v === null; var isboolean = typeof v === "boolean"; var isobject = typeof v === "object" && v !== null; /* jsapi */ js::rootedvalue v(cx, computesomevalue()); bool isstring = v.isstring(); bool isnumber = v.isnumber(); bool isint32 = v.isint32(); // note: internal representation, not numeric value bool isnull = v.isnull...
...(); bool isboolean = v.isboolean(); bool isobject = v.isobject(); // note: not broken like typeof === "object" is :-) to set a value use a correspondingly named member mutator function, or assign the result of the correspondingly named standalone function: // javascript var v; v = 0; v = 0.5; v = somestring; v = null; v = undefined; v = false; /* jsapi */ js::rootedvalue v(cx); js::rootedstring somestring(cx, ...); v.setint32(0); // or: v = js::int32value(0); v.setdouble(0.5); // or: v = js::doublevalue(0.5); v.setstring(somestring); // or: v = js::stringvalue(somestring); v.setnull(); // or: v = js::nullvalue(); v.setundefined(); // or: v = js::undefinedvalue(); v.setboolean(false); // or: v = js::booleanvalue(false); finding the global object many...
...*/ js::rootedstring name_str(cx, js_newstringcopyz(cx, "dave")); if (!name_str) return false; js::autovaluearray<2> args(cx); args[0].setstring(name_str); args[1].setint32(24); /* step 3 - call |new person(...args)|, passing the arguments.
...And 7 more matches
Secure Development Guidelines
call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows format string bugs integer overflows/underflows writing secure code: input validation input validation most vulnerabilities are a result of un-validated input always perform input validation could save you without knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the input doesn’t have to be > 512, cut it off there if the input should only b...
...ome browsers) with a simple request such as: http://www.victim.com?something=<script>alert('oops')</script> xss: prevention escape all dynamic input that will be sent back to the user html encoding &amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted input is mixed with a sql string sql is a language used to interact with databases code injection attack that is similar to xss but targeted at sql rather than html and javascript if input is mixed with sql, it could itself become an sql instruction and be used to: query data from the database (passwords) insert ...
...a/b : 0; } writing secure code: memory management string handling c-style strings are byte arrays that end with a \0 byte some string handling functions won’t perform any kind of length checking, so don’t use them ensure your string is always \0 terminated!
...And 7 more matches
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 word,in wstring correction, in wstring lang...
...); void removeword(in wstring word, in wstring lang); void save(); attributes attribute type description wordlist nsistringenumerator get the (lexicographically sorted) list of words.
... void addcorrection( in wstring word, in wstring correction, in wstring lang ); parameters word the incorrect spelling of the word to add to the list of corrections.
...And 7 more matches
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); attributes attribute type description copyright wstrin...
...g a string indicating the copyright of the engine.
... dictionary wstring the name of the current dictionary used by check() and suggest().
...And 7 more matches
nsIAuthInformation
attributes attribute type description authenticationscheme autf8string the authentication scheme used for this request, if applicable.
... if the protocol for this authentication does not support schemes, this will be the empty string.
... otherwise, this will be a string such as "basic" or "digest".
...And 7 more matches
nsIDOMGeoPositionAddress
attributes attribute type description city domstring the city.
... country domstring the country.
... countrycode obsolete since gecko 11 domstring removed in firefox 11, since it isn't defined in the specification; use country instead.
...And 7 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, in unsigned long awhat, in astring avalue); void onpageexpi...
...red(in nsiuri auri, in prtime avisittime, in boolean awholeentry); obsolete since gecko 2.0 void ontitlechanged(in nsiuri auri, in astring apagetitle); void onvisit(in nsiuri auri, in long long avisitid, in prtime atime, in long long asessionid, in long long areferringid, in unsigned long atransitiontype, in acstring aguid, out unsigned long aadded); constants constant value description attribute_favicon 3 the page's favicon changed.
... note: see using onbeforedeleteuri() in gecko 1.9.1 for how to implement this in gecko 1.9.1 void onbeforedeleteuri( in nsiuri auri, in acstring aguid ); parameters auri the uri of the page about to be deleted.
...And 7 more matches
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...
..., out unsigned long extensionpos, out long extensionlen); void parsepath(in string path, in long pathlen, out unsigned long filepathpos, out long filepathlen, out unsigned long parampos, out long paramlen, out unsigned long querypos, out long querylen, out unsigned long refpos, out long reflen); void parseserverinfo(in string serverinfo, in long serverinfolen, out unsigned long hostnamepos, out long 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.
...And 7 more matches
nsIWindowMediator
nsisimpleenumerator getenumerator(in wstring awindowtype); nsidomwindow getmostrecentwindow(in wstring awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native code only!
... nsisimpleenumerator getzorderdomwindowenumerator(in wstring awindowtype, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in wstring awindowtype, in boolean afronttoback); void registerwindow(in nsixulwindow awindow); native code only!
... void updatewindowtitle(in nsixulwindow awindow, in wstring intitle ); native code only!
...And 7 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(in autf8string azipentry, in prtime amodtime, in print32...
... acompression, in nsiinputstream astream, in boolean aqueue); void close(); nsizipentry getentry(in autf8string azipentry); boolean hasentry(in autf8string azipentry); void open(in nsifile afile, in print32 aioflags); void processqueue(in nsirequestobserver aobserver, in nsisupports acontext); void removeentry(in autf8string azipentry, in boolean aqueue); attributes attribute type description comment acstring gets or sets the comment associated with the currently open zip file.
... void addentrychannel( in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue ); parameters azipentry the path of the file entry to add to the zip file.
...And 7 more matches
Toolkit version format
version format a version string consists of one or more version parts, separated with dots.
... each version part is itself parsed as a sequence of four parts: <number-a><string-b><number-c><string-d>.
...numbers are integers base 10 (may be negative), strings are non-numeric ascii characters.
...And 7 more matches
UInt64
this may be specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number.
... the string is then converted into the corresponding 64-bit integer value.
... you can therefore use a string to represent a 64-bit value that is too large to represent as a 32-bit javascript number.
...And 7 more matches
CSS Typed Object Model API - Web APIs
the css typed object model api simplifies css property manipulation by exposing css values as typed javascript objects rather than strings.
... generally, css values can be read and written in javascript as strings, which can be slow and cumbersome.
... css typed object model api provides interfaces to interact with underlying values, by representing them with specialized js objects that can be manipulated and understood more easily and more reliably than string parsing and concatenation.
...And 7 more matches
ContentIndex.add() - Web APIs
WebAPIContentIndexadd
syntax contentindex.add(contentdescription).then(...); parameters contentdescription the item registered is an object containing the following data: id: a unique string identifier.
... title: a string title for the item.
... title: a string title of the item.
...And 7 more matches
HTMLImageElement.srcset - Web APIs
the htmlimageelement property srcset is a string which identifies one or more image candidate strings, separated using commas (,) each specifying image resources to use under given circumstances.
... each image candidate string contains an image url and an optional width or pixel density descriptor that indicates the conditions under which that candidate should be used instead of the image specified by the src property.
... syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the htmlimageelement.
...And 7 more matches
IDBDatabaseSync - Web APIs
method overview idbobjectstoresync createobjectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domstring version); idbtransactionsync transaction...
... (in optional domstringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly domstring the human-readable description of the connected database.
... name readonly domstring the name of the connected database.
...And 7 more matches
RTCPeerConnection - Web APIs
tiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates.connectionstate the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connection by returning one of the string values specified by the enum rtcpeerconnectionstate.currentlocaldescription read only the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondescription object describing the local end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer.
...if it has not yet been set, this is null.peeridentity read only the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.pendinglocaldescription read only the read-only property rtcpeerconnection.pendinglocaldescription returns an rtcsessiondescription object describing a pending configuration change for the local end of the connection.
...if sctp hasn't been negotiated, this value is null.signalingstate read only the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
...And 7 more matches
Using DTMF with WebRTC - Web APIs
when the tone buffer is empty, indicating that all the tones have been sent, a tonechange event with its tone property set to "" (an empty string) is delivered to the connection object.
...when the button is clicked, a dtmf string is sent over the connection using rtcdtmfsender.insertdtmf().
... let dialstring = "12024561111"; let callerpc = null; let receiverpc = null; let dtmfsender = null; let hasaddtrack = false; let mediaconstraints = { audio: true, video: false }; let offeroptions = { offertoreceiveaudio: 1, offertoreceivevideo: 0 }; let dialbutton = null; let logelement = null; these are, in order: dialstring the dtmf string the caller will send when the "dial" button is click...
...And 7 more matches
WorkerLocation - Web APIs
urlutilsreadonly.href read only is a stringifier that returns a domstring containing the whole url of the script executed in the worker.
... urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url of the script executed in the worker, including the final ':'.
... urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url of the script executed in the worker.
...And 7 more matches
<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 v...
...more specifically, there are three possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed.
...however, if you add the multiple attribute, a list of zero e-mail addresses (an empty string, or one which is entirely whitespace) is a valid value.
...And 7 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
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 s...
...tring indicating a browsing context from where to load the results of submitting the form height the height, in css pixels, at which to draw the image src the url from which to load the image width the width, in css pixels, at which to draw the image alt the alt attribute provides an alternate string to use as the button's label if the image cannot be shown (due to error, a user agent that cannot or is configured not to show images, or if the user is using a screen reading device).
... if provided, it must be a non-empty string appropriate as a label for the button.
...And 7 more matches
Working with objects - JavaScript
objects are sometimes called associative arrays, since each property is associated with a string value that can be used to access it.
... so, for example, you could access the properties of the mycar object as follows: mycar['make'] = 'ford'; mycar['model'] = 'mustang'; mycar['year'] = 1969; an object property name can be any valid javascript string, or anything that can be converted to a string, including the empty string.
...examples are as follows: // four variables are created and assigned in a single go, // separated by commas var myobj = new object(), str = 'mystring', rand = math.random(), obj = new object(); myobj.type = 'dot syntax'; myobj['date created'] = 'string with space'; myobj[str] = 'string value'; myobj[rand] = 'random number'; myobj[obj] = 'object'; myobj[''] = 'even an empty string'; console.log(myobj); please note that all keys in the square bracket notation are conv...
...And 7 more matches
Array.prototype.sort() - JavaScript
the default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of utf-16 code units values.
...if omitted, the array elements are converted to strings, then sorted according to each character's unicode code point value.
... description if comparefunction is not supplied, all non-undefined array elements are sorted by converting them to strings and comparing strings in utf-16 code units order.
...And 7 more matches
io/text-streams - Archive of obsolete content
charset : string inputstream is expected to be in the character encoding named by this value.
... charset : string text will be written to outputstream using the character encoding named by this value.
... read(numchars) reads and returns a string from the stream.
...And 6 more matches
ui/frame - Archive of obsolete content
to receive such messages in the frame script, listen for the window's message event: window.addeventlistener("message", handlepong, false); sending json in all cases, you can send a string as a message or a json object.
...ated, the frame needs to be added to a toolbar for it to be visible: var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ name: "my-toolbar", title: "my toolbar", items: [frame] }); parameters options : object required options: name type url url, string a url pointing to the html file specifying the frame's content.
...you can specify the url in one of two ways: as a resource:// url pointing at a file under your add-on's "data" directory, typically constructed using self.data.url(filename) as a relative path: a string in the form "./relativepath", where "relativepath" is a relative path to the file beginning in your add-on's "data" directory var { frame } = require("sdk/ui/frame"); var self = require("sdk/self"); var frame1 = new frame({ url: require("sdk/self").data.url("content1.html") }); var frame2 = new frame({ url: "./content2.html" }); optional options: name type name string the frame's name.
...And 6 more matches
package.json - Archive of obsolete content
defaults to an empty string.
... contributors an array of additional author strings, identifying other contributors to the add-on.
... dependencies a string or an array of strings specifying the names of packages that this add-on requires in order to function properly.
...And 6 more matches
Dehydra Object Reference - Archive of obsolete content
each member of the array has the following properties: { name: string, value: string or number, if applicable } see an example on enforcing final classes.
... code can be annotated with arbitrary user attributes: __attribute__((user("customstring"))).
...the following properties are usually available: property type description .name string the function or variable name.
...And 6 more matches
window - Archive of obsolete content
activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... chromemargin type: margin string controls the amount of chrome that should be visible on each side of the window.
... the specified string should contain four numbers, separated by commas, indicating the margin in pixels for the top, right, bottom, and left edges of the window, respectively.
...And 6 more matches
Graceful asynchronous programming with Promises - Learn web development
that means we want to run the promise.all() block when we get back usable blobs representing the images, and a usable text string.
...e === '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); }); } this looks a bit complex, so let's run through it step by step: first of all, we define the function, passing it a url and a string representing the type of resource it is fetching.
... let's have a look at a simple example to get you started — here we wrap a settimeout() call with a promise — this runs a function after two seconds that resolves the promise (using the passed resolve() call) with a string of "success!".
...And 6 more matches
SourceMap.jsm
new sourcemapconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object).
... mappings: a string of base64 vlqs which contain the actual mappings.
... sourcemapgenerator.prototype.tostring() renders the source map being generated to a string.
...And 6 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag = sec_oid_pkcs1_md5_with_rsa_encryption; params ...
...aturealgorithmoidtag(privkey->keytype, hashalgtag); if (algid == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type for issuer.\n"); goto cleanup; } rv = secoid_setalgorithmid(arena, &cert->signature, algid, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not set signature algorithm id.\n%s\n", port_errortostring(rv)); goto cleanup; } /* we only deal with cert v3 here */ *(cert->version.data) = 2; cert->version.len = 1; der.len = 0; der.data = null; dummy = sec_asn1encodeitem (arena, &der, cert, sec_asn1_get(cert_certificatetemplate)); if (!dummy) { pr_fprintf(pr_stderr, "could not encode certificate.\n"); ...
...t_arenazalloc (arena, sizeof (secitem)); if (result == null) { pr_fprintf(pr_stderr, "could not allocate item for certificate data.\n"); goto cleanup; } rv = sec_dersigndata(arena, result, der.data, der.len, privkey, algid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not sign encoded certificate data : %s\n", port_errortostring(rv)); /* result allocated out of the arena, it will be freed * when the arena is freed */ result = null; goto cleanup; } cert->dercert = *result; cleanup: if (caprivatekey) { seckey_destroyprivatekey(caprivatekey); } return result; } /* * makev1cert */ static certcertificate * makev1cert(certcertdbhandle *handle...
...And 6 more matches
JS_AddArgumentFormatter
add or remove a format string handler for js_convertarguments, js_pusharguments, js_convertargumentsva, and js_pushargumentsva.
... format const char * the format string prefix that should be handled by formatter, or whose handler should be removed.
... description js_addargumentformatter establishes formatter as the conversion function for format strings beginning with format in the context cx.
...And 6 more matches
mozIStorageValueArray
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); attributes attribute type description numentries unsigned long the number of entries in the ar...
... getutf8string() obtains a utf8string from the specified index.
... note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string.
...And 6 more matches
nsIApplicationCache
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 typebits); attributes attribute type description active boolean true if the cache is the ac...
... clientid acstring the client id for this application cache.
... groupid acstring the group id for this cache group.
...And 6 more matches
nsIBinaryInputStream
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(alength), retval] out string astring); acstring readcstring(); double readdouble(); float readfloat(); astring readstring(); void setinputstream(in nsiinputstream ainputstream); methods read8() reads from the stream.
... void readbytes( in pruint32 alength, [size_is(alength), retval] out string astring ); parameters alength the number of bytes to read.
... astring a string containing the bytes read from the stream.
...And 6 more matches
nsIDocShell
method overview void addsessionstorage(in nsiprincipal principal, in nsidomstorage storage); void addstate(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface guidelines void finishrestore(); void firepagehid...
...obsolete since gecko 1.8 nsisimpleenumerator getdocshellenumerator(in long aitemtype, in long adirection); nsidomstorage getsessionstorageforprincipal(in nsiprincipal principal, in domstring documenturi, in boolean create); nsidomstorage getsessionstorageforuri(in nsiuri uri, in domstring documenturi); void historypurged(in long numentries); void internalload(in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in wstring awindowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocs...
... boolean isbeingdestroyed(); void loadstream(in nsiinputstream astream, in nsiuri auri, in acstring acontenttype, in acstring acontentcharset, in nsidocshellloadinfo aloadinfo); native code only!
...And 6 more matches
nsIFilePicker
to create an instance, use: var filepicker = components.classes["@mozilla.org/filepicker;1"] .createinstance(components.interfaces.nsifilepicker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorecentdocs boolean if true, the file i...
... defaultextension astring the extension for the type of files you want to work with.
... defaultstring astring the filename, including extension, that should be suggested to the user as a default.
...And 6 more matches
nsIIDNService
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.
... this combines two operations: running the rfc 3490 "tounicode" operation on the original string, then converting the resulting unicode string into utf-8 format.
... autf8string convertacetoutf8( in acstring input ); parameters input the ace encoded hostname to convert into utf-8 format.
...And 6 more matches
nsIMsgDatabase
pen(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); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); void listallkeys(in nsmsgkeyarrayref outputkeys); native code only!
...istener instigator,in boolean commit, in boolean notify); void removeheadermdbrow(in nsimsgdbhdr msghdr); void undodelete(in nsimsgdbhdr msghdr); void markmarked(in nsmsgkey key, in boolean mark, in nsidbchangelistener instigator); void markoffline(in nsmsgkey key, in boolean offline, in nsidbchangelistener instigator); void setlabel(in nsmsgkey key, in nsmsglabelvalue label); void setstringproperty(in nsmsgkey akey, in string aproperty, in string avalue); void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); void applyretentionsettings(in nsimsgretentionsettings amsgretentionsettings, in boolean adeleteviafolder); boolean hasnew(); void clearnewlist(in boolean notify); void addtonewlist(in nsmsgkey key); void startbatch(); void e...
... void setattributesonpendinghdr(in nsimsgdbhdr pendinghdr, in string property, in string propertyval, in long flags); void createcollationkey(in astring sourcestring, out octetptr key, out unsigned long len); native code only!
...And 6 more matches
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 profileexists(in wstring profilename); ...
... void renameprofile(in wstring oldname, in wstring newname); void shutdowncurrentprofile(in unsigned long shutdowntype); attributes attribute type description currentprofile wstring the name of the profile currently in use.
...void cloneprofile( in wstring profilename ); parameters profilename the name to assign to the new clone of the current profile.
...And 6 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.
... warning: if the data contains a null byte, then this method will return a truncated string.
... note: it is also important to consider how a language bindings may interpret the string data type.
...And 6 more matches
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, [optional] in unsigned long long processid); methods createsmsmessage() [implicit_jscontext] nsido...
...mmozsmsmessage 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.
... delivery a domstring which can either be "received" or "sent" and is representing the way the sms was delivered.
...And 6 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...
... responsestring readonly unsigned long the most recent http status code returned from this server.
... 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.
...And 6 more matches
Using js-ctypes
note: this example will not work on 64bit os x, see below for core foundation for 64bit os x /* build a str255 ("pascal style") string from the passed-in string */ function makestr(str) { return string.fromcharcode(str.length) + str; } components.utils.import("resource://gre/modules/ctypes.jsm"); var carbon = ctypes.open("/system/library/frameworks/carbon.framework/carbon"); stdalert = carbon.declare("standardalert", /* function name */ ctypes.default_abi, /* abi type */ ...
...ypes.uint32_t, /* alert param */ ctypes.int16_t); /* item hit */ var hit = 0; var msgerr = makestr("carbon says..."); var msgexp = makestr("we just called the standardalert carbon function from javascript!"); var err = stdalert(1, msgerr, msgexp, 0, hit); carbon.close(); the makestr() function is a utility routine that takes as input a standard javascript string and returns a carbon-style "pascal" string, which is a length byte followed by the characters of the string itself.
... note that this only works correctly if the string is in fact under 256 characters; if it's longer, this will fail spectacularly.
...And 6 more matches
Int64
this may be specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number.
... the string is then converted into the corresponding 64-bit integer value.
... you can therefore use a string to represent a 64-bit value that is too large to represent as a 32-bit javascript number.
...And 6 more matches
ctypes
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.
... for example, ctypes.char.array(30)(str) converts the string str to utf-8 and returns a new cdata object of array type.
...this is different from uint16_t in that c jschar values are automatically converted into 1-character javascript strings.
...And 6 more matches
CSSPrimitiveValue - Web APIs
the value can be obtained by using the getstringvalue() method.
...the value can be obtained by using the getstringvalue() method.
... css_string the value is a <string>.
...And 6 more matches
ContentIndex.getAll() - Web APIs
contentdescription each item returned is an object containing the following data: id: a unique string identifier.
... title: a string title for the item.
... title: a string title of the item.
...And 6 more matches
DOMParser - Web APIs
WebAPIDOMParser
the domparser interface provides the ability to parse xml or html source code from a string into a dom document.
... 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.
...And 6 more matches
HTMLTableElement - Web APIs
htmltableelement.align is a domstring containing an enumerated value reflecting the align attribute.
... htmltableelement.bgcolor is a domstring containing the background color of the cells.
... htmltableelement.border is a domstring containing the width in pixels of the border of the table.
...And 6 more matches
Node - Web APIs
WebAPINode
node.baseuriread only returns a domstring representing the base url of the document containing the node.
... node.nodenameread only returns a domstring containing the name of the node.
...an htmlelement will contain the name of the corresponding tag, like 'audio' for an htmlaudioelement, a text node will have the '#text' string, or a document node will have the '#document' string.
...And 6 more matches
SVGLength - Web APIs
WebAPISVGLength
interface overview also implement none methods void newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void converttospecifiedunits(in unsigned short unittype) properties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative doc...
...="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ", valueinspecifiedunits: " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // set x = 20pt and read it out in pixel and pt units val.newvaluespecifiedunits(svglength.svg_lengthtype_pt, 20); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // convert x = 20pt to inches and read out in pixel and inch units ...
... val.converttospecifiedunits(svglength.svg_lengthtype_in); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); } ]]></script> <rect id="myrect" x="1cm" y="1cm" fill="green" stroke="black" stroke-width="1" width="1cm" height="1cm" /> </svg> results on a desktop monitor (pixel units will be dpi-dependent): value: 37.7952766418457, valueinspecifiedunits: 6: 1, valueasstring: 1cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueasstring: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, valueasstring: 0.277778in constants name value description svg_lengthtype_unknown 0 ...
...And 6 more matches
ServiceWorkerRegistration.showNotification() - Web APIs
it may contain the following values: action: a domstring identifying a user action to be displayed on the notification.
... title: a domstring containing action text to be shown to the user.
... icon: a usvstring containing the url of an icon to display with the action.
...And 6 more matches
Window.open() - Web APIs
WebAPIWindowopen
syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded.
...if the empty string ("") is specified as url, a blank page is opened into the targeted browsing context.
... windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname.
...And 6 more matches
text-overflow - CSS: Cascading Style Sheets
it can be clipped, display an ellipsis ('…'), or display a custom string.
... each value is specified as one of: one of the keyword values: clip, ellipsis, fade the function fade(), which is passed a <length> or a <percentage> to control the fade distance a <string>.
...to clip at the transition between characters you can specify text-overflow as an empty string, if that is supported in your target browsers: text-overflow: '';.
...And 6 more matches
Getting Started - Developer guides
form data should be sent in a format that the server can parse, like a query string: "name=value&anothername="+encodeuricomponent(myvar)+"&so=on" or other formats, like multipart/form-data, json, xml, and so on.
...for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); step 2 – handling the server response when you sent the request, you provided the name of a javascript function to handle the response: httprequest.onreadystatechange = nameofthefunction; what should this function do?
...you have two options to access that data: httprequest.responsetext – returns the server response as a string of text httprequest.responsexml – returns the response as an xmldocument object you can traverse with javascript dom functions note that the steps above are valid only if you used an asynchronous request (the third parameter of open() was unspecified or set to true).
...And 6 more matches
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
among browsers with custom interfaces for selecting dates are chrome and opera, whose data control looks like so: the edge date control looks like: and the firefox date control looks like this: value a domstring representing a date in yyyy-mm-dd format, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasdate, valueasnumber.
... methods select(), stepdown(), stepup() value a domstring representing the date entered in the input.
... the date is formatted according to iso8601, described in format of a valid date string in date and time formats used in html.
...And 6 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.
...a submit button with a default label in your browser: <input type="submit"> 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.
... formnovalidate a boolean which, if present, means the form's fields will not be subjected to constraint validation before submitting the data to the server formtarget the browsing context into which to load the response returned by the server after submitting the form formaction a string indicating the url to which to submit the data.
...And 6 more matches
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
value a domstring representing the text contained in the text field.
... value the value attribute is a domstring that contains the current value of the text entered into the text field.
... let thetext = mytextinput.value; if no validation constraints are in place for the input (see validation for more details), the value may be an empty string ("").
...And 6 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
it, like chrome, uses a 12- or 24-hour format for inputting times, based on system locale: 12-hour 24-hour value a domstring representing a time, or empty.
... value a domstring containing the value of the time entered into the input.
...you can learn more about the format of the time value used by this input type in time strings in date and time formats used in html.
...And 6 more matches
User-Agent - HTTP
the user-agent request header is a characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent.
... firefox ua string for more on firefox- and gecko-based user agent strings, see the firefox user agent string reference.
... the ua string of firefox is broken down into 4 components: mozilla/5.0 (platform; rv:geckoversion) gecko/geckotrail firefox/firefoxversion mozilla/5.0 is the general token that says the browser is mozilla-compatible.
...And 6 more matches
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.
... syntax arr.join([separator]) parameters separator optional specifies a string to separate each pair of adjacent elements of the array.
... the separator is converted to a string if necessary.
...And 6 more matches
Intl.Collator() constructor - JavaScript
the intl.collator object is a constructor for collators, objects that enable language sensitive string comparison.
...a string with a bcp 47 language tag, or an array of such strings.
... usage whether the comparison is for sorting or for searching for matching strings.
...And 6 more matches
JSON - JavaScript
description javascript and json differences json is a syntax for serializing objects, arrays, numbers, strings, booleans, and null.
... objects and arrays property names must be double-quoted strings; trailing commas are forbidden.
...in engines that haven't implemented the proposal, u+2028 line separator and u+2029 paragraph separator are allowed in string literals and property keys in json; but their use in these features in javascript string literals is a syntaxerror.
...And 6 more matches
RegExp.prototype.test() - JavaScript
the test() method executes a search for a match between a regular expression and a specified string.
... syntax regexobj.test(str) parameters str the string against which to match the regular expression.
... returns true if there is a match between the regular expression and the string str.
...And 6 more matches
Lexical grammar - JavaScript
[1954, 1974, 1990, 2014] string literals a string literal is zero or more unicode code points enclosed in single or double quotes.
...all code points may appear literally in a string literal except for these closing quote code points: u+005c \ (backslash), u+000d <cr>, and u+000a <lf>.
... prior to the proposal to make all json text valid ecma-262, u+2028 <ls> and u+2029 <ps>, were also disallowed from appearing unescaped in string literals.
...And 6 more matches
test/assert - Archive of obsolete content
message : string optional message to log, providing extra information about the test.
... message : string optional message to log, providing extra information about the test.
... message : string optional message to log, providing extra information about the test.
...And 5 more matches
Observer Notifications - Archive of obsolete content
the first parameter (subject) can be any xpcom object, the second parameter is a notification topic, and the final parameter is a string that further describes the notification.
...the first parameter can be any xpcom object to pass to those observers (can be null), the second parameter is the notification topic and the last parameter is an additional string to pass to those observers (can be null).
... getservice(components.interfaces.nsiobserverservice); let subject = components.classes["@mozilla.org/supports-string;1"].
...And 5 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) a regular expression is a special kind of string (i.e.
... a sequence of characters) that matches patterns of characters in other strings.
... urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters.
...And 5 more matches
Dehydra Function Reference - Archive of obsolete content
builtin functions the following functions are provided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping output).
... msg is a string to output to customize the location info printed set this._loc before calling print() include(file [, namespace]) include a javascript file into a namespace.
... file is a string representing the file to include optional: namespace is an object to include the file into.
...And 5 more matches
menuitem - Archive of obsolete content
, labelelement, parentcontainer, selected, tabindex, value style classes menuitem-iconic, menuitem-non-iconic 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 acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
...for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description type: string descriptive text to appear in addition to the dialog title.
... label type: string the label that will appear on the element.
...And 5 more matches
tooltip - Archive of obsolete content
label type: string the label that will appear on the element.
... example <tooltip id="pagetooltip" page="true"/> <browser tooltip="pagetooltip"/> position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.
... positions specified as a single word string are shortcuts for the values above.
...And 5 more matches
Adobe Flash - Archive of obsolete content
every plugin exposes a description string that typically includes the plugin's name and version number.
... the flash plugin's description string uses a standard versioning nomenclature that can then be parsed for meaningful information.
...the description string exposes this version.
...And 5 more matches
Processing XML with E4X - Archive of obsolete content
the first is to pass a string to the xml constructor: var languages = new xml('<languages type="dynamic"><lang>javascript</lang><lang>python</lang></languages>'); the second is to embed the xml directly in your script, as an xml literal: var languages = <languages type="dynamic"> <lang>javascript</lang> <lang>python</lang> </languages>; in both cases, the resulting object will be an e4x xml object, which provid...
... var h = 'html'; var text = "here's some text"; var doc = <{h}><body>{text}</body></{h}>; alert(doc.toxmlstring()); // gives <html> <body>here's some text</body> </html> working with attributes xml literal syntax has a significant advantage over the xml constructor when you need to create markup dynamically.
... var b = 'he said "don\'t go there."'; var el = <foo a={b}/>; alert(el.toxmlstring()); // gives: <foo a="he said &quot;don't go there.&quot;"/> less than and ampersand signs are escaped into their entity equivalents.
...And 5 more matches
Plug-in Development Overview - Gecko Plugin API Reference
for this the version stamp of the embedded resource of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will be loaded...
...this exported c function should return a string containing the type, extension list, and type description separated by colons.
...'str#' 128 should contain a list of mime types and file extensions in alternating strings.
...And 5 more matches
JavaScript basics - Learn web development
also, you can do both these operations on the same line: let myvariable = 'bob'; you retrieve the value by calling the variable name: myvariable; after assigning a value to a variable, you can change it later in the code: let myvariable = 'bob'; myvariable = 'steve'; note that variables may hold values that have different data types: variable explanation example string this is a sequence of text known as a string.
... to signify that the value is a string, enclose it in single quote marks.
... operator explanation symbol(s) example addition add two numbers together or combine two strings.
...And 5 more matches
Index - Learn web development
75 javascript first steps arrays, article, assessment, beginner, codingscripting, guide, javascript, landing, module, numbers, operators, variables, l10n:priority, maths, strings in our first javascript module, we first answer some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?", before moving on to taking you through your first practical experience of writing javascript.
... after that, we discuss some key building blocks in detail, such as variables, strings, numbers and arrays.
... 79 handling text — strings in javascript article, beginner, codingscripting, guide, javascript, join, quotes, concatenation, l10n:priority, strings next, we'll turn our attention to strings — this is what pieces of text are called in programming.
...And 5 more matches
A first splash into JavaScript - Learn web development
variables are basically containers for values (such as numbers, or strings of text).
... operators javascript operators allow us to perform tests, do math, join strings together, and other such things.
... first let's look at arithmetic operators, for example: operator name example + addition 6 + 9 - subtraction 20 - 15 * multiplication 3 * 7 / division 10 / 5 you can also use the + operator to join text strings together (in programming, this is called concatenation).
...And 5 more matches
Storing the information you need — Variables - Learn web development
a variable is a container for a value, like a number we might use in a sum, or a string that we might use as part of a sentence.
... another special thing about variables is that they can contain just about anything — not just strings and numbers.
...when you give a variable a number value, you don't include quotes: let myage = 17; strings strings are pieces of text.
...And 5 more matches
Creating our first Vue component - Learn web development
registering props in vue, there are two ways to register props: the first way is to just list props out as an array of strings.
...set the value for this property as the javascript string type (note the capital "s").
... this tells vue that we expect the value of this property to be a string.
...And 5 more matches
mozbrowsershowmodalprompt
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property is an anonymous javascript object with the following properties: prompttype a domstring defining the type of the prompt.
... title a domstring representing the title of the prompt.
...And 5 more matches
Downloads.jsm
some of the most common properties in this object include: source: string containing the uri for the download source.
... alternatively, may be an nsiuri, a downloadsource object, or an object with the following properties: url: string containing the uri for the download source.
... referrer: optional string containing the referrer uri of the download source.
...And 5 more matches
PopupNotifications.jsm
notification getnotification( string id xulelement browser ); parameters id the notification id to search for.
... id a unique id string for the type of notification being displayed.
... message a string to display in the notification panel.
...And 5 more matches
Localizing with Mozilla Translator
this will remove obsolete strings and files from the internal database of mt, and will present you with a list of new and updated strings.
... if you are starting a new localization, all strings will be marked as new or updated.mt puts a fuzzy flag on each flag and saves it in its database.
... all this means is that the strings have yet to be translated.
...And 5 more matches
PR_dtoa
converts a floating point number to a string.
... syntax #include <prdtoa.h> prstatus pr_dtoa( prfloat64 d, printn mode, printn ndigits, printn *decpt, printn *sign, char **rve, char *buf, prsize bufsz); parameters the function has these parameters: d the floating point number to be converted to a string.
... ndigits the number of digits desired in the output string.
...And 5 more matches
pkfnc.html
returns the function returns one of these values: if successful, a pointer to the name of the slot (a string).
... description if the slot is freed, the string with the slot name may also be freed.
... if you want to preserve it, copy the string before freeing the slot.
...And 5 more matches
JS_Add*Root
syntax jsbool js_addvalueroot(jscontext *cx, jsval *vp); jsbool js_addstringroot(jscontext *cx, jsstring **spp); jsbool js_addobjectroot(jscontext *cx, jsobject **opp); jsbool js_addgcthingroot(jscontext *cx, void **rp); jsbool js_addnamedvalueroot(jscontext *cx, jsval *vp, const char *name); jsbool js_addnamedstringroot(jscontext *cx, jsstring **spp, const char *name); jsbool js_addnamedobjectroot(jscontext *cx, jsobject **opp, const char *name); jsbool js_addnamedgcthi...
... vp jsval * (in js_addvalueroot and js_addnamedvalueroot) the address of the jsval variable to root spp jsstring ** (in js_addstringroot and js_addnamedstringroot) the address of the jsstring* variable to root opp jsobject ** (in js_addobjectroot and js_addnamedobjectroot) the address of the jsobject* variable to root rp void ** (in js_addgcthingroot and js_addnamedgcthingroot) the address of the jsstring* or jsobject* (not jsval) variable to root name const char * (in ...
... vp/spp/opp/rp is the address of a c/c++ variable (or field, or array element) of type jsstring *, jsobject *, or jsval.
...And 5 more matches
SpiderMonkey 1.8.7
js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_addstringroot; similar changes were made for js_addnamedroot and js_removeroot.
...new c apis js_assert_string_is_flat js_addgcthingroot js_addnamedgcthingroot js_addnamedobjectroot js_addnamedstringroot js_addnamedvalueroot js_addobjectroot js_addstringroot js_addvalueroot js_alreadyhasownpropertybyid js_anchorptr js_beginjsonparse (removed in future releases, replaced with js_parsejson) js_compilefilehandleforprincipalsversion js_compilescriptforprincipalsversion js_compileucfunctionforpri...
...ncipalsversion js_compileucscriptforprincipalsversion js_consumejsontext (removed in future releases, replaced with js_parsejson) js_decompilescriptobject js_deepfreezeobject js_definefunctionbyid js_defineownproperty js_definepropertybyid js_deletepropertybyid js_deletepropertybyid2 js_doubleisint32 js_encodestringtobuffer js_entercrosscompartmentcall js_evaluatescriptforprincipalsversion js_evaluateucscriptforprincipalsversion js_executeregexp js_executeregexpnostatics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstringequalsascii js_flattenstring js_flushcaches js_freezeobject js_getcompartmentprivate js_getemptystring js_getflatstringchars js_getgcparameter...
...And 5 more matches
Querying Places
nsigned long time_relative_today = 1 const unsigned long time_relative_now = 2 attribute prtime begintime attribute unsigned long begintimereference readonly attribute boolean hasbegintime readonly attribute prtime absolutebegintime attribute prtime endtime attribute unsigned long endtimereference readonly attribute boolean hasendtime readonly attribute prtime absoluteendtime attribute astring searchterms readonly attribute boolean hassearchterms attribute long minvisits attribute long maxvisits attribute boolean onlybookmarked attribute boolean domainishost attribute autf8string domain readonly attribute boolean hasdomain attribute boolean uriisprefix attribute nsiuri uri readonly attribute boolean hasuri attribute boolean annotationisnot attribute autf8string annotation ...
...3 const unsigned short sort_by_lastmodified_descending = 14 const unsigned short sort_by_annotation_ascending = 15 const unsigned short sort_by_annotation_descending = 16 const unsigned short results_as_uri = 0 const unsigned short results_as_visit = 1 const unsigned short results_as_full_visit = 2 (not yet implemented -- see bug 320831) attribute unsigned short sortingmode attribute autf8string sortingannotation attribute unsigned short resulttype attribute boolean excludeitems attribute boolean excludequeries attribute boolean excludereadonlyfolders attribute boolean expandqueries attribute boolean includehidden attribute boolean showsessions attribute unsigned long maxresults const unsigned short query_type_history = 0 const unsigned short query_type_bookmarks = 1 const uns...
... // |query| and |options| are objects created in the previous section query.setparents([placesutils.bookmarks.toolbarguid], 1); let result = placesutils.history.executequery(query, options); serializing queries query and options objects can be serialized into a string starting with "place:" using queriestoquerystring.
...And 5 more matches
Setting up the Gecko SDK
this window is where you add the include paths to the gecko sdk as well as two preprocessor defines: xpcom_glue mozilla_strict_api at a minimum, you must include the nspr, the embedstring and string include directories, and the xpcom include subdirectory.
... assuming you are using the example location for your project, these paths are the following: c:\gecko-sdk\embedstring\include c:\gecko-sdk\xpcom\include c:\gecko-sdk\nspr\include c:\gecko-sdk\string\include under the c++ language category, disable exception handling.
...in this panel, instead of linking to the include subdirectories of the nspr, embedstring, and xpcom directories, add the paths to the bin subdirectories.
...And 5 more matches
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer.
... void insert( const self_type& astring, index_type aposition ); parameters astring [in] a nsacstring to append to this string.
... aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
...And 5 more matches
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer.
... void insert( const self_type& astring, index_type aposition ); parameters astring [in] a nsastring to append to this string.
... aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
...And 5 more matches
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), retval] out string grou...
...void cacheopportunistically( in nsiapplicationcache cache, in acstring key ); parameters cache the cache in which the entry is currently cached.
...nsiapplicationcache chooseapplicationcache( in acstring key ); parameters key the cache entry key for which to select an application cache.
...And 5 more matches
nsIBinaryOutputStream
eam 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.
...void writebytes( [size_is(alength)] in string astring, in pruint32 alength ); parameters astring the byte array to write to the stream.
... writestringz() writes an 8-bit pascal style string to the stream.
...And 5 more matches
nsIBrowserSearchService
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(enginecount)] out ...
...nsisearchengine engines); nsisearchengine getenginebyalias(in astring alias); nsisearchengine getenginebyname(in astring aenginename); void getengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void getvisibleengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void init([optional] in nsibrowsersearchinitobserver observer); void moveengine(in nsisearchengine engine, in long newindex); void removeengine(in nsisearchengine engine); void restoredefaultengines(); attributes attribute type description ...
...void addengine( in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback ); parameters engineurl the url to the search engine's description file.
...And 5 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...
...meta data is a table of key/value string pairs.
... the strings do not have to conform to any particular charset, but they must be null terminated.
...And 5 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); attributes attribute type descript...
...long findflag( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to locate.
...astring getargument( in long aindex ); parameters aindex the argument to retrieve.
...And 5 more matches
nsIConsoleService
.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.
... void logstringmessage( in wstring message ); parameters message the string to log.
...And 5 more matches
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...
...contentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra); attributes attribute type description allowseval boolean whether this policy allows eval and eval-like functions such as settimeout("code string", time).
... policy astring a read-only string version of the policy for debugging.
...And 5 more matches
nsIEditorIMESupport
obsolete since gecko 1.9.1 void getreconversionstring(in nsreconversioneventreplyptr areply); native code only!
...obsolete since gecko 2.0 void setcompositionstring(in domstring acompositionstring, in nsiprivatetextrangelistptr atextrange, in nstexteventreplyptr areply); native code only!
...void getquerycaretrect( in nsquerycaretrecteventreplyptr areply ); parameters areply native code only!getreconversionstring obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete.
...And 5 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 nsiuri getfaviconforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiu...
...oid removefailedfavicon(in nsiuri afaviconuri); void setandloadfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); obsolete since gecko 22.0 void setfavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in prtime aexpiration); obsolete since gecko 22.0 void setfavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, in prtime aexpiration); obsolete since gecko 22.0 void setfaviconurlforpage(in nsiuri apageuri, in nsiuri afaviconuri); obsolete since gecko 22.0 attributes attribute type description defaultfavicon nsiuri th...
...void getfavicondata( in nsiuri afaviconuri, out autf8string amimetype, out unsigned long adatalen, optional from gecko 2.0 [array,retval,size_is(adatalen)] out octet adata ); parameters afaviconuri uri of the favicon whose data is being read.
...And 5 more matches
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 whether or not the ...
... name astring the string identifier of this install location.
...astring getidforlocation( in nsifile file ); parameters file the location where an item might live.
...And 5 more matches
nsIJSID
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.
... name string read only.
... number string read only.
...And 5 more matches
nsIMsgCustomColumnHandler
you must implement: nsitreeview.iseditable() nsitreeview.getcellproperties() nsitreeview.getimagesrc() nsitreeview.getcelltext() nsitreeview.cyclecell() nsimsgcustomcolumnhandler.getsortstringforrow() nsimsgcustomcolumnhandler.getsortlongforrow() nsimsgcustomcolumnhandler.isstring() and optionally: nsitreeview.getrowproperties() from c++ you must implement all of nsitreeview and nsimsgcustomcolumnhandler.
... example implementation an example javascript implementation that does nothing: var columnhandler = { iseditable: function(arow, acol) {return false;}, cyclecell: function(arow, acol) { }, getcelltext: function(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.getcolum...
...nhandler() method: var handler = gdbview.getcolumnhandler("newcolumn"); and removed using the nsimsgdbview.removecolumnhandler() method: gdbview.removecolumnhandler("newcolumn"); method overview astring getsortstringforrow(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.
...And 5 more matches
nsIObserverService
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 for a notifications regarding the specified topic.
... void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobserver the nsiobserver object which will receive notifications.
... nsisimpleenumerator enumerateobservers( in string atopic ); parameters atopic the notification topic or subject.
...And 5 more matches
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 nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(...
...in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
..._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 for making and managing phone calls.
...And 5 more matches
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.
... description astring a text description describing the engine.
... name astring the display name of the search engine.
...And 5 more matches
nsIStackFrame
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description caller nsistackframe read only.
... filename string filename location.
... languagename string see nsiprogramminglanguage for a list of language constants.
...And 5 more matches
nsIWifiAccessPoint
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) attributes attribute type description mac acstring the wifi access point's mac address.
... this string is in the format "xx-xx-xx-xx-xx-xx".
... rawssid acstring the public name of the wireless network, as an ascii string.
...And 5 more matches
nsIXPConnect
nsistackframe createstackframelocation(in pruint32 alanguage, in string afilename, in string afunctionname, in print32 alinenumber, in nsistackframe acaller); void debugdump(in short depth); void debugdumpevalinjsstackframe(in pruint32 aframenumber, in string asourcetext); void debugdumpjsstack(in prbool showargs, in prbool showlocals, in prbool showthisprops); void debugdumpobject(in nsisupports acomobj, in short depth); ...
...[noscript,notxpcom] prbool definedomquickstubs(in jscontextptr cx, in jsobjectptr proto, in pruint32 flags, in pruint32 interfacecount, [array, size_is(interfacecount)] in nsiidptr interfacearray); jsval evalinsandboxobject(in astring source, in jscontextptr cx, in nsixpconnectjsobjectholder sandbox, in prbool returnstringonly); native code only!
... void flagsystemfilenameprefix(in string afilenameprefix, in prbool awantnativewrappers); void garbagecollect(); [noscript,notxpcom] void getcaller(out jscontextptr ajscontext, out jsobjectptr aobject); jsval getcowforobject(in jscontextptr ajscontext, in jsobjectptr aparent, in jsobjectptr awrappedobj); native code only!
...And 5 more matches
CType
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.
... property type description name string the type's name.
...for structure and opaque pointer types, this is simply the string that was passed to the constructor.
...And 5 more matches
StructType
must be a string.
... exceptions thrown typeerror the name is not a string, or one or more of the fields does not have a defined size.
... property type description name string the type's name.
...And 5 more matches
Plug-in Development Overview - Plugins
for this the version stamp of the embedded resource of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will be loaded...
...this exported c function should return a string containing the type, extension list, and type description separated by colons.
...'str#' 128 should contain a list of mime types and file extensions in alternating strings.
...And 5 more matches
Debugger.Object - Firefox Developer Tools
class a string naming the ecmascript [[class]] of the referent.
...for example: function h() { var i = function() {}; // display name: h/i f(function () {}); // display name: h/< } var s = f(function () {}); // display name: s< parameternames if the referent is a debuggee function, the names of the its parameters, as an array of strings.
... by convention, host annotation objects have a string-valued "type" property that, taken together with the object's class, indicate what sort of thing the referent is.
...And 5 more matches
Network request list - Firefox Developer Tools
(click the icon again when you want to close the sidebar.) enter a string in the field with the placeholder text block resource when url contains.
...these accept any string, and affect any url containing the string.
...the list of network requests is filtered to include only requests that contain your filter string, in either the domain or the file portions.
...And 5 more matches
The JavaScript input interpreter - Firefox Developer Tools
$(selector, element) looks up a css selector string selector , returning the first node descended from element that matches.
... $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match.
...the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used.
...And 5 more matches
console - Web APIs
WebAPIConsole
you may use string substitution and additional arguments with this method.
...you may use string substitution and additional arguments with this method.
...you may use string substitution and additional arguments with this method.
...And 5 more matches
Element.setAttribute() - Web APIs
syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set.
... value a domstring containing the value to assign to the attribute.
... any non-string value specified is converted automatically into a string.
...And 5 more matches
Using files from web applications - Web APIs
name the file's name as a read-only string.
... type the mime type of the file as a read-only string or "" if the type couldn't be determined.
... const reader = new filereader(); reader.onload = (function(aimg) { return function(e) { aimg.src = e.target.result; }; })(img); reader.readasdataurl(file); } } here our loop handling the user-selected files looks at each file's type attribute to see if its mime type begins with the string "image/").
...And 5 more matches
FontFace - Web APIs
WebAPIFontFace
fontface.display a cssomstring that determines how a font face is displayed based on whether and when it is downloaded and ready to use.
... fontface.family a cssomstring that retrieves or sets the family of the font.
... fontface.featuresettings a cssomstring that retrieves or sets infrequently used font features that are not available from a font's variant properties.
...And 5 more matches
HTMLElement - Web APIs
htmlelement.accesskey is a domstring representing the access key assigned to the element.
... htmlelement.accesskeylabel read only returns a domstring containing the element's assigned access key.
... htmlelement.contenteditable is a domstring, where a value of true means the element is editable and a value of false means it isn't.
...And 5 more matches
HTMLFormElement - Web APIs
htmlformelement.name a domstring reflecting the value of the form's name html attribute, containing the name of the form.
... htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit the form.
... htmlformelement.target a domstring reflecting the value of the form's target html attribute, indicating where to display the results received from submitting the form.
...And 5 more matches
HTMLKeygenElement - Web APIs
challenge is a domstring that reflects the challenge html attribute, containing a challenge string that is packaged with the submitted key.
... keytype is a domstring that reflects the keytype html attribute, containing the type of key used.
... name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with form data.
...And 5 more matches
HTMLSelectElement - Web APIs
htmlselectelement.name a domstring reflecting the name html attribute, containing the name of this control used by servers and dom search functions.
... htmlselectelement.typeread only a domstring represeting the form control's type.
... htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
...And 5 more matches
Drag Operations - Web APIs
the format is a type string (such as text/plain for text data), and the value is a string of text.
... the drag data's types property returns a list of mime-type like domstrings, such as text/plain or image/jpeg.
... const dt = event.datatransfer; dt.setdata("application/x.bookmark", bookmarkstring); dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); here, data is added in three different types.
...And 5 more matches
Timing element visibility with the Intersection Observer API - Web APIs
these are accessed through each ad's htmlelement.dataset attribute, which provides a domstringmap mapping each custom attribute's name to its value.
... the values are strings, but we can convert those to numbers easily enough—in fact, javascript generally does it automatically, although we'll have one instance where we have to do it ourselves.
...note the use of parsefloat() here; because these values are strings, javascript tries to do a string concatenation instead of addition without it.
...And 5 more matches
KeyboardEvent - Web APIs
keyboardevent.code read only returns a domstring with the code value of the physical key represented by the event.
... keyboardevent.key read only returns a domstring representing the key value of the key represented by the event.
... keyboardevent.locale read only returns a domstring representing a locale string indicating the locale the keyboard is configured for.
...And 5 more matches
MediaTrackSettings - Web APIs
properties of all media tracks deviceid a domstring indicating the current value of the deviceid property.
... the device id is a origin-unique string identifying the source of the track; this is usually a guid.
... groupid a domstring indicating the current value of the groupid property.
...And 5 more matches
Capabilities, constraints, and settings - Web APIs
function switchcameras(track, camera) { let constraints = track.getconstraints(); constraints.facingmode = camera; track.applyconstraints(constraints); } this function accepts a mediastreamtrack and a string indicating the camera facing mode to use, fetches the current constraints, sets the value of the mediatrackconstraints.facingmode to the specified value, then applies the updated constraint set.
... defaults and variables first we have the default constraint sets, as strings.
... these strings are presented in editable <textarea>s, but this is the initial configuration of the stream.
...And 5 more matches
Navigator - Web APIs
WebAPINavigator
navigatorid.appname read only returns a domstring with the official name of the browser.
... navigatorid.appversion read only returns the version of the browser as a domstring.
... navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui.
...And 5 more matches
RTCIceCandidate.candidate - Web APIs
the read-only property candidate on the rtcicecandidate interface returns a domstring describing the candidate in detail.
... most of the other properties of rtcicecandidate are actually extracted from this string.
... syntax var candidate = rtcicecandidate.candidate; value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate".
...And 5 more matches
SecurityPolicyViolationEvent - Web APIs
properties securitypolicyviolationevent.blockeduriread only a usvstring representing the uri of the resource that was blocked because it violates a policy.
... securitypolicyviolationevent.documenturiread only a usvstring representing the uri of the document or worker in which the violation was found.
... securitypolicyviolationevent.effectivedirectiveread only a domstring representing the directive whose enforcement uncovered the violation.
...And 5 more matches
attr() - CSS: Cascading Style Sheets
WebCSSattr
if omitted, it defaults to string.
... the list of valid values are: keyword associated type comment default value string <string> the attribute value is treated as a css <string>.
... an empty string.
...And 5 more matches
Parsing and serializing XML - Developer guides
xmlserializer serializes dom trees, converting them into strings containing xml.
... domparser constructs a dom tree by parsing a string containing xml, returning a xmldocument or document as appropriate based on the input data.
... xpath a technology for creating strings that contain addresses for specific portions of an xml document, and locating xml nodes based on those addresses.
...And 5 more matches
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
the value is a string whose value is in the format "yyyy-mm", where yyyy is the four-digit year and mm is the month number.
... the microsoft edge month control looks like this: value a domstring representing a month and year, or empty.
... value a domstring representing the value of the month and year entered into the input, in the form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month).
...And 5 more matches
Intl.Locale.prototype.numeric - JavaScript
if numeric is set to false, there will be no special handling of numeric values in strings.
... if numeric is set to true, then the locale will take numeric characters into account when collating strings.
...for example, the string "a-21" will be considered less than "a-123".
...And 5 more matches
typeof - JavaScript
the typeof operator returns a string indicating the type of the unevaluated operand.
... type result undefined "undefined" null "object" (see below) boolean "boolean" number "number" bigint (new in ecmascript 2020) "bigint" string "string" symbol (new in ecmascript 2015) "symbol" function object (implements [[call]] in ecma-262 terms) "function" any other object "object" note: ecmascript 2019 and older permitted implementations to have typeof return any implementation-defined string value for non-callable non-standard exotic objects.
...of 37 === 'number'; typeof 3.14 === 'number'; typeof(42) === 'number'; typeof math.ln2 === 'number'; typeof infinity === 'number'; typeof nan === 'number'; // despite being "not-a-number" typeof number('1') === 'number'; // number tries to parse things into numbers typeof number('shoe') === 'number'; // including values that cannot be type coerced to a number typeof 42n === 'bigint'; // strings typeof '' === 'string'; typeof 'bla' === 'string'; typeof `template literal` === 'string'; typeof '1' === 'string'; // note that a number within a string is still typeof string typeof (typeof 1) === 'string'; // typeof always returns a string typeof string(1) === 'string'; // string converts anything into a string, safer than tostring // booleans typeof true === 'boolean'; typeof false === 'bo...
...And 5 more matches
The "codecs" parameter in common media types - Web media technologies
this guide briefly examines the syntax of the media type codecs parameter and how it's used with the mime type string to provide details about the contents of audio or video media beyond simply indicating the container type.
... to do so, append a semicolon (;) followed by codecs= and then the string describing the format of the contents of the file.
... av1 the syntax of the codecs parameter for av1 is defined the av1 codec iso media file format binding specification, section 5: codecs parameter string.
...And 5 more matches
request - Archive of obsolete content
parameters options : object optional options: name type url string,url this is the url to which the request will be made.
... can either be a string or an instance of the sdk's url.
... content string,object the content to send to the server.
...And 4 more matches
/loader - Archive of obsolete content
these modules don't share scope and get their own set of built-ins (object, array, string ...).
... the function returns a string representing the resolved module id, which is then resolved to its location url using the mapping provided in the paths option.
...if the function assigned to resolve does not return a string value, an exception will still be thrown as the loader will be unable to resolve the required module's location.
...And 4 more matches
loader/sandbox - Archive of obsolete content
the argument may be: a url string, in which case the sandbox will get the same privileges as a script loaded from that url a dom window object, to inherit privileges from the window being passed.
... parameters source : string|window|null an object that determines the privileges that will be given to the sandbox.
... this argument can be: a uri string, giving the sandbox the same privileges as a script loaded from that url a dom window object, giving the sandbox the same privileges as the dom window null, to give the sandbox chrome privileges.
...And 4 more matches
tabs/utils - Archive of obsolete content
url : string url for the document to load.
... returns string : the current uri.
... returns string : settabtitle(tab, title) set the title of the document hosted by the specified tab, or the tab's label if the tab doesn't host a document.
...And 4 more matches
window/utils - Archive of obsolete content
parameters uri : string uri of the document to be loaded into the window.
... name string name that is assigned to the window.
... parameters options : object options for the function, with the following properties: name type url string uri of the document to be loaded into the window.
...And 4 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = bsmedberg library_name = bsmedberg_stub is_component = 1 force_shared_lib = 1 requires = \ xpcom \ string \ $(null) cppsrcs = bdsstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" extensions/stub/bdsstubloader.cpp // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h...
..." #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h" static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be listed first.
... // assume that we're in <extensiondir>/components, and we want to find // <extensiondir>/libraries nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); prlibrary *lib; library->load(&lib); // 1) we don't care if this failed!
...And 4 more matches
Basics - Archive of obsolete content
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.
...methods show(titlestringbodystringiconstring)draws a notification box.
...And 4 more matches
Writing textual data - Archive of obsolete content
.5), you can use nsiconverteroutputstream: var charset = "utf-8"; // can be any character encoding name that mozilla supports var os = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); // this assumes that fos is the nsioutputstream you want to write to os.init(fos, charset, 0, 0x0000); os.writestring("umlaute: \u00fc \u00e4\n"); os.writestring("hebrew: \u05d0 \u05d1\n"); // etc.
... os.close(); you can also write character arrays using the write function, although using writestring is simpler from javascript code.
...they work by manually converting the string you want to write to a byte sequence using nsiscriptableunicodeconverter, and writing that to the stream.
...And 4 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.
... (note that this path points into the xpi itself.) args a parameter string that is passed to the executable.
... passing arguments to the executable the args parameter, when present, passes a string to the executable as command-line parameters.
...And 4 more matches
NPVariant - Archive of obsolete content
syntax typedef struct _npvariant { npvarianttype type; union { bool boolvalue; int32_t intvalue; double_t doublevalue; npstring stringvalue; npobject *objectvalue; } value; } npvariant; fields the data structure has the following fields: type a member of the npvarianttype enumeration specifying the data type contained in the npvariant.
...it may be a boolean, integer, double, string, or object, depending on the variant type.
...s javascript objects in the browser, or vise versa, the mapping of javascript values to npvariants is as follows: javascript type npvarianttype undefined npvarianttype_void null npvarianttype_null boolean npvarianttype_bool number npvarianttype_int32 or npvarianttype_double string npvarianttype_string all other types npvarianttype_object functions npn_releasevariantvalue() npn_getstringidentifier() npn_getstringidentifiers() npn_getintidentifier() npn_identifierisstring() npn_utf8fromidentifier() npn_intfromidentifier() macros plugin developers are not expected to directly manipulate or access the members of the npv...
...And 4 more matches
NPAPI plugin reference - Archive of obsolete content
npidentifier npidentifier is an opaque type used for method and property identifiers, such as strings or integers.
... npidentifiers are unique, in that for any given string or integer, there is only one npidentifier.
... npn_getstringidentifier returns an opaque identifier for the string that is passed in.
...And 4 more matches
Developing cross-browser and cross-platform pages - Archive of obsolete content
there are 2 known approaches for such goals: the browser identification approach (also known as useragent string detection and often referred as "browser sniffing") and the object/feature support detection approach.
... the browser identification approach relies on functions that check the browser type string value and browser version string value and that search for certains characters or sub-strings in the navigator.useragent property string.
... }; } else if (navigator.appversion.indexof("msie") != -1) { isie = true; alert("internet explorer"); }; while this kind of checking in the above code can work in a crude sense, sharp readers may wonder what happens when internet explorer 8 is released or when an opera 8.x user visits the page or even when an user with any non-netscape browser starting with a "8" character in the appversion string visits that page.
...And 4 more matches
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation.
... in javascript there are two functions respectively for decoding and encoding base64 strings: btoa(): creates a base-64 encoded ascii string from a "string" of binary data ("btoa" should be read as "binary to ascii").
... atob(): decodes a base64 encoded string("atob" should be read as "ascii to binary").
...And 4 more matches
Gecko info for Windows accessibility vendors
if it is, than variant.bstrval contains the role string.
... the role string may be an html tag name followed by comma, space and the namespace of the current element.
...neither "description:" or "of" in the above strings is ever localized, so they should be parsed out.
...And 4 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
how mozilla browsers handle non-ascii domain names unicode and nameprep when mozilla receives idn input from the user via the location bar or a request to process non-ascii host name links, it first turns them into unicode, then normalizes the input string to make it conform to general uri requirement.
...arabic and hebrew), and check whether or not unassigned characters in the unicode repertoire are used -- allowing them for "query strings" but disallowing them for "stored strings" such as the data input for domain name registration.
... this process is called "nameprep" and is performed according to rfc 3491 (nameprep: a stringprep profile for internationalized domain names (idn)) and rfc 3454 (preparation of internationalized strings ("stringprep")).
...And 4 more matches
AddonScreenshot
attributes attribute type description url string the url of the screenshot.
... thumbnailurl optional string the url of a thumbnail version of the screenshot.
... caption optional string the caption of the screenshot.
...And 4 more matches
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.
...string create( adate ); parameters adate a javascript date object to translate into an iso 8601 format string.
...And 4 more matches
Memory reporting
a simple example imagine a simple string class with the following data fields: class mystring { private: char *mbuffer; // heap-allocated size_t mlen; // ...
... 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.
... they let you measure the mystring object itself or not as necessary.
...And 4 more matches
NSS 3.21 release notes
209) tls extended master secret extension (rfc 7627) is supported (bug 1117022) new info functions added for use during mid-handshake callbacks (bug 1084669) new functions in nss.h nss_optionset - sets nss global options nss_optionget - gets the current value of nss global options in secmod.h secmod_createmoduleex - create a new secmodmodule structure from module name string, module parameters string, nss specific parameters string, and nss configuration parameter string.
...the difference with secmod_createmodule is the new function handles nss configuration parameter strings.
...ureprefset - configures the enabled signature and hash algorithms for tls ssl_signatureprefget - retrieves the currently configured signature and hash algorithms ssl_signaturemaxcount - obtains the maximum number signature algorithms that can be configured with ssl_signatureprefset in utilpars.h nssutil_argparsemodulespecex - takes a module spec and breaks it into shared library string, module name string, module parameters string, nss specific parameters string, and nss configuration parameter strings.
...And 4 more matches
NSS Tools certutil
to see a usage string, issue the command without options, or with the -h option.
...bracket theissuer string with quotation marks if it contains spaces.
...this slot can also be explicitly named with the string "internal".
...And 4 more matches
Tutorial: Embedding Rhino
string s = ""; for (int i=0; i < args.length; i++) { s += args[i]; } evaluating a script the code object result = cx.evaluatestring(scope, s, "<cmd>", 1, null); uses the context cx to evaluate a string.
... printing the result the code system.out.println(cx.tostring(result)); prints the result of evaluating the script (contained in the variable result).
... result could be a string, javascript object, or other values.
...And 4 more matches
The JavaScript Runtime
string java.lang.charsequence (java.lang.string or org.mozilla.javascript.consstring) object org.mozilla.javascript.scriptable in addition, ecma refers to objects that implement [[call]] as functions.
...(this caveat does not apply to scripts that use liveconnect; the java values are wrapped and unwrapped as appropriate to conform to the above type constraints.) property access properties in javascript objects may be accessed using either string or numeric identifiers.
... conceptually, all accessors are converted to strings in order to perform the lookup of the property in the object.
...And 4 more matches
JS_ValueToId
syntax bool js_valuetoid(jscontext *cx, js::handlevalue v, js::mutablehandleid idp); bool js_stringtoid(jscontext *cx, js::handlestring s, js::mutablehandleid idp); // added in spidermonkey 38 bool js_indextoid(jscontext *cx, uint32_t index, js::mutablehandleid idp); // added in spidermonkey 17 bool js_charstoid(jscontext* cx, js::twobytechars chars, js::mutablehandleid idp); // added in spidermonkey 24 void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context.
... s js::handlestring the js string to convert.
... chars js::twobytechars the string to convert.
...And 4 more matches
SpiderMonkey 38
this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location.
... js::clonefunctionobject (bug 1088228) interned_string_to_jsid (bug 1045900) js::construct (bug 1017109) js::createerror (bug 984048) js::falsehandlevalue (bug 959787) js::handlesymbol (bug 645416) js::identifystandardconstructor (bug 976148) js::iscallable (bug 1065811) js::isconstructor (bug 1065811) js::mutablehandlesymbol (bug 645416) js::ordinarytoprimitive (bug 1103152) js::propertyspecnameequalsid (bug 1082672) js::propertyspecnamei...
...l (bug 645416) jsid_to_symbol (bug 645416) jsprop_define_late (bug 825199) jsprop_ignore_enumerate (bug 1037770) jsprop_ignore_permanent (bug 1037770) jsprop_ignore_readonly (bug 1037770) jsprop_ignore_value (bug 1037770) jsprop_propop_accessors (bug 1088002) jsprop_redefine_nonconfigurable (bug 1101123) js_addfinalizecallback (bug 996785) js_defineconstintegers (bug 1066020) js_getflatstringcharat (bug 1034627) js_getfunctionscript (bug 1069694) js_getlatin1flatstringchars (bug 1037869) js_getlatin1internedstringchars (bug 1037869) js_getlatin1stringcharsandlength (bug 1032726) js_getstringcharat (bug 1034627) js_gettwobyteexternalstringchars (bug 1034627) js_gettwobyteflatstringchars (bug 1037869) js_gettwobyteinternedstringchars (bug 1037869) js_gettwobytestringcharsandlen...
...And 4 more matches
XPCOM glue classes
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.
... this class is typically used to represent ascii or utf-8 character arrays.nsacstring (external)class declarationnsacstring_internalclass declarationnsadoptingcstringclass declarationnsadoptingstringclass declarationnsastringthe nsastring abstract class represents a character string composed of double-byte storage units.
... this class is typically used to represent unicode character arrays.nsastring (external)class declarationnsastring_internalclass declarationnsautorefnsautoref<t> is a template class implementing an object that holds a handle to a resource that must be released, typically on destruction of the object.</t>nsautoreftraitsnsautoreftraits<t> is a template class describing traits of resources held by objects of class nsautoref<t> and/or nscountedref<t>.</t>nsautostringclass declarationnsautostring (external)class declarationnscautostringclass declarationnscautostring (external)class declarationnscomptrthis utility class simplifies managing xpcom interface references from c++ code.nscountedrefnscountedref<t> is a template class implementing an object that takes a strong reference to a reference-counted...
...And 4 more matches
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 startimageencode(in pruint32...
... width, in pruint32 height, in pruint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support saving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endianness) input_format_rgba 1 input is rgb each pixel is represented by four bytes: r, g, and b (in that order, regardless of host endianness).
... 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.
...And 4 more matches
nsIAccessibleScrollType
accessible/public/nsiaccessibletypes.idlscriptable these constants control the scrolling of an object or substring into a window.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) constants constant value description scroll_type_top_left 0x00 scroll the top left of the object or substring to the top left of the window (or as close as possible).
... scroll_type_bottom_right 0x01 scroll the bottom right of the object or substring to the bottom right of the window (or as close as possible).
...And 4 more matches
nsICookieManager2
to create an object implementing this interface: components.utils.import("resource://gre/modules/services.jsm"); var cookieservice = services.cookies; method overview void add(in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry); boolean cookieexists(in nsicookie2 acookie); unsigned long countcookiesfromhost(in autf8string ahost); boolean findmatchingcookie(in nsicookie2 acookie, out unsigned long acountfromhost); obsolete since gecko 1.9...
... nsisimpleenumerator getcookiesfromhost(in autf8string ahost); void importcookies(in nsifile acookiefile); methods add() adds a cookie.
... void add( in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry ); parameters ahost the host or domain for which the cookie is set.
...And 4 more matches
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.
... localname domstring read only.
... namespaceuri domstring read only.
...And 4 more matches
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.
...domstring getitem( in domstring key ); parameters key the key for which data should be returned.
... return value a string containing the data corresponding to the specified key, or null if no data exists for the given key.
...And 4 more matches
getFile
nsifile getfile( in string aname, out boolean apersistent ); parameters aname [in] the symbolic name for a file or directory location.
... c constant string value notes ns_os_home_dir "home" ns_os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_os_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by passing a "bin directory" to ns_initxpcom2().
... c constant string value notes ns_os_system_dir "sysd" available on mac os x only these locations are supported only on mac os x versions of gecko.
...And 4 more matches
nsIEditor
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal void deleteselection(in short action, in short stripwrappers)...
...tiontype); selection methods void selectall(); void beginningofdocument(); void endofdocument(); drag/drop methods boolean candrag(in nsidomevent aevent); void dodrag(in nsidomevent aevent); void insertfromdrop(in nsidomevent aevent); node manipulation methods void setattribute(in nsidomelement aelement, in astring attributestr,in astring attvalue); boolean getattributevalue(in nsidomelement aelement, in astring attributestr, out astring resultvalue); void removeattribute(in nsidomelement aelement, in astring aattribute); void cloneattribute(in astring aattribute, in nsidomnode asourcenode); void cloneattributes(in nsidomnode destnode, in nsidomnode sourcenode); ...
...nsidomnode createnode(in astring tag, in nsidomnode parent, in long position); void insertnode(in nsidomnode node, in nsidomnode parent, in long aposition); void splitnode(in nsidomnode existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection(); output methods astring outputtostring(in astring formattype, in unsigned long flags); example: // flags are declared in base/public/nsidocumentencoder.idl // outputselectiononly = 1, outputformatted = 2, // outputraw = 4, ou...
...And 4 more matches
nsIEditorMailSupport
inherits from: nsisupports last changed in gecko 1.7 method overview nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
...insertascitedquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any), including, if possible, a "cite" attribute.
... nsidomnode insertascitedquotation( in astring aquotedtext, in astring acitation, in boolean ainserthtml ); parameters aquotedtext the actual text to be quoted.
...And 4 more matches
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.
... filename string filename location.
... message string a custom message set by the thrower.
...And 4 more matches
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.
...observers can look at request headers in aextrastringdata activity_subtype_request_body_sent 0x5002 the http request's body has been sent.
...void observeactivity( in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahttpchannel the nsihttpchannel on which the activity occurred.
...And 4 more matches
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.
... void sendmessage( in astring amessagename, [optional] in jsval v1, optional [optional] in jsval v2, optional ...
...And 4 more matches
nsILocale
intl/locale/idl/nsilocale.idlscriptable represents one locale, which can be used for things like sorting text strings and formatting numbers, dates and times.
... 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.
... astring getcategory( in astring category ); parameters category a string representing the category to retrieve the locale for.
...And 4 more matches
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.
...astring decrypt( in astring ciphertext ); parameters ciphertext the string to be decrypted.
...And 4 more matches
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.
... void addmessagelistener(in astring messagename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed); parameters messagename a string indicating the name of the message to listen for.
...And 4 more matches
nsINavHistoryResultObserver
ened(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containerstatechanged(in nsinavhistorycontainerresultnode acontainernode, in unsigned long aoldstate, in unsigned long anewstate); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodeinserted(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long an...
...ewindex); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodelastmodifiedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode aitem, in unsigned long aoldindex); void nodereplaced(in nsinavhistorycontainerresultnode aparentnode, in nsinavhistoryresultnode aoldnode, in nsinavhistoryresultnode anewnode, in unsigned long aindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodetitlechanged(in nsinavhistoryresultnode anode, in a...
...utf8string anewtitle); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); void sortingchanged(in unsigned short sortingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this observer monitors.
...And 4 more matches
nsINavHistoryResultViewObserver
ast 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.
...for example, when the delete key is pressed, this method is called with the string "delete".
... void onperformaction( in wstring action ); parameters action a string identifying the action to be performed.
...And 4 more matches
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.
... scheme acstring the scheme for this protocol ("file", "http", and so forth).
... boolean allowport( in long port, in string scheme ); parameters port the port for which an override is being requested.
...And 4 more matches
nsITelemetry
.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 snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession...
..., in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); 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 ad...
...ataset, [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); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data).
...And 4 more matches
nsIURIFixup
docshell/base/nsiurifixup.idlscriptable interface implemented by objects capable of fixing up strings into uris.
... 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 fixup flags.
... createfixupuri() converts the specified string into a uri, first attempting to correct any errors in the syntax or other vagaries.
...And 4 more matches
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.
... if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8.
... autf8string convertstringtoutf8( in acstring astring, in string acharset, in boolean askipcheck, in boolean aallowsubstitution ); parameters astring a string to ensure its utf8ness.
...And 4 more matches
nsIVersionComparator
xpcom/base/nsiversioncomparator.idlscriptable this interface is used to compare version strings.
... 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) version strings are dot-separated sequences of version-parts.
... a version-part consists of up to four parts, all of which are optional: <number-a><string-b><number-c><string-d (everything else)> a version-part may also consist of a single asterisk "*" which indicates * "infinity".
...And 4 more matches
nsIWebContentHandlerRegistrar
sisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in domstring ...
...mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters mimetype the desired mime type as a string uri the uri to the handler as a string.
... title the title of the handler presented to the user as a string.
...And 4 more matches
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-extensions response header value.
... protocol acstring sec-websocket-protocol value.
...void asyncopen( in nsiuri auri, in acstring aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext ); parameters auri the uri of the websocket protocol; this may be redirected.
...And 4 more matches
nsIXULTemplateQueryProcessor
method overview void addbinding(in nsidomnode arulenode, in nsiatom avar, in nsiatom aref, in astring aexpr); print32 compareresults(in nsixultemplateresult aleft, in nsixultemplateresult aright, in nsiatom avar, in unsigned long asorthints); nsisupports compilequery(in nsixultemplatebuilder abuilder, in nsidomnode aquery, in nsiatom arefvariable, in nsiatom amembervariable); void done(); nsisimpleenumerator generateresults(in nsisupports adatasource, in nsixultemplateresult aref, in nsis...
...upports aquery); nsisupports getdatasource(in nsiarray adatasources, in nsidomnode arootnode, in boolean aistrusted, in nsixultemplatebuilder abuilder, out boolean ashoulddelaybuilding); void initializeforbuilding(in nsisupports adatasource, in nsixultemplatebuilder abuilder, in nsidomnode arootnode); nsixultemplateresult translateref(in nsisupports adatasource, in astring arefstring); methods addbinding() add a variable binding for a particular rule.
...as an example, if the reference aref is the variable ?count which holds the value 5, and the expression aexpr is the string '+2', the value of the variable avar would be 7, assuming the query processor considers the syntax '+2' to mean add two to the reference.
...And 4 more matches
Using the CSS Typed Object Model - Web APIs
converting css object model value strings into meaningfully-typed javascript representations and back (via htmlelement.style) can incur a significant performance overhead.
... 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.
... cssunitvalue and csskeywordvalue the power of the css typed om is that values are separate from units; parsing and concatenating string values may become be a thing of the past.
...And 4 more matches
Applying styles and colors - Web APIs
color is a string representing a css <color>, a gradient object, or a pattern object.
... the valid strings you can enter should, according to the specification, be css <color> values.
...the position is a number between 0.0 and 1.0 and defines the relative position of the color in the gradient, and the color argument must be a string representing a css <color>, indicating the color the gradient should reach at that offset into the transition.
...And 4 more matches
CharacterData - Web APIs
characterdata.data is a domstring representing the textual data contained in this object.
... characterdata.length read only returns an unsigned long representing the size of the string contained in characterdata.data.
... characterdata.appenddata() appends the given domstring to the characterdata.data string; when this method returns, data contains the concatenated domstring.
...And 4 more matches
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
syntax const content = element.innerhtml; element.innerhtml = htmlstring; value a domstring containing the html serialization of the element's descendants.
... setting the value of innerhtml removes all of the element's descendants and replaces them with nodes constructed by parsing the html given in the string htmlstring.
... exceptions syntaxerror an attempt was made to set the value of innerhtml using a string which is not properly-formed html.
...And 4 more matches
Using Fetch - Web APIs
ude, *same-origin, omit headers: { 'content-type': 'application/json' // 'content-type': 'application/x-www-form-urlencoded', }, redirect: 'follow', // manual, *follow, error referrerpolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url body: json.stringify(data) // body data type must match "content-type" header }); return response.json(); // parses json response into native javascript objects } postdata('https://example.com/answer', { answer: 42 }) .then(data => { console.log(data); // json data parsed by `data.json()` call }); note that mode: "no-cors" only allows a limited set of headers in the request: accept accept-langua...
... const data = { username: 'example' }; fetch('https://example.com/profile', { method: 'post', // or 'put' headers: { 'content-type': 'application/json', }, body: json.stringify(data), }) .then(response => response.json()) .then(data => { console.log('success:', data); }) .catch((error) => { console.error('error:', error); }); uploading a file files can be uploaded using an html <input type="file" /> input element, formdata() and fetch().
...'photos', photos.files[i]); } fetch('https://example.com/posts', { method: 'post', body: formdata, }) .then(response => response.json()) .then(result => { console.log('success:', result); }) .catch(error => { console.error('error:', error); }); processing a text file line by line the chunks that are read from a response are not broken neatly at line boundaries and are uint8arrays, not strings.
...And 4 more matches
FileSystemEntrySync - Web APIs
method overview metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system w...
... fullpath readonly domstring the full absolute path from the root to the entry.
... name readonly domstring the name of the entry, excluding the path leading to it.
...And 4 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element.
... htmlmediaelement.currentsrc read only returns a domstring with the absolute url of the chosen media resource.
... htmlmediaelement.mediagroup a domstring that reflects the mediagroup html attribute, which indicates the name of the group of elements it belongs to.
...And 4 more matches
HTMLOutputElement - Web APIs
htmloutputelement.defaultvalue a domstring representing the default value of the element, initially the empty string.
... htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with form data.
... htmloutputelement.typeread only the domstring "output".
...And 4 more matches
HTMLScriptElement - Web APIs
htmlscriptelement.type is a domstring representing the mime type of the script.
... htmlscriptelement.src is a domstring representing the url of an external script.
... htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document.
...And 4 more matches
IDBObjectStoreSync - Web APIs
method overview any add (in any value, in optional any key) raises (idbdatabaseexception); idbindexsync createindex (in domstring name, in domstring storename, in domstring keypath, in optional boolean unique); any get (in any key) raises (idbdatabaseexception); idbcursorsync opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); idbindexsync openindex (in domstring name) raises (idbdatabaseexception); any put (in any value, in op...
...tional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type description indexnames readonly domstringlist a list of the names of the indexes on this object store.
... keypath readonly domstring the key path of this object store.
...And 4 more matches
Using IndexedDB - Web APIs
the following table shows the different ways the keys are supplied: key path (keypath) key generator (autoincrement) description no no this object store can hold any kind of value, even primitive values like numbers and strings.
...since there's only one object store, you can avoid passing a list of object stores you need in your transaction and just pass the name as a string.
...by default, indexeddb didn’t handle internationalization of sorting strings at all, and everything was sorted as if it were english text.
...And 4 more matches
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
if the pressed key has a printed representation, the returned value is a non-empty unicode character string containing the printable representation of the key.
... case 1 when the shift key is pressed, a keydown event is first fired, and the key property value is set to the string shift.
... when key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event is set to the string @ for the u.s keyboard type and " for the uk keyboard type, because of the active modifier shift key.
...And 4 more matches
PaymentCurrencyAmount.value - Web APIs
the paymentcurrencyamount property value is a string containing the decimal numeric value of the payment, specified in the currency units indicated by the currency property.
... the contents of this string must be a valid decimal number; that is, some number of digits between 0 and 9 with up to one optional decimal point.
... important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma.
...And 4 more matches
RTCDTMFSender.toneBuffer - Web APIs
the rtcdtmfsender interface's tonebuffer property returns a string containing a list of the dtmf tones currently queued for sending to the remote peer over the rtcpeerconnection.
... tones are removed from the string as they're played, so only upcoming tones are listed.
... syntax var tonebuffer = rtcdtmfsender.tonebuffer; value a domstring listing the tones to be played.
...And 4 more matches
RTCIceCandidateInit.candidate - Web APIs
value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate".
... the candidate string specifies the network connectivity information for the candidate.
... if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker.
...And 4 more matches
TextTrack - Web APIs
WebAPITextTrack
texttrack.id read only a domstring which identifies the track, if it has one.
... if it doesn't have an id, then this value is an empty string ("").
... texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type.
...And 4 more matches
Writing WebSocket client applications - Web APIs
protocols optional either a single protocol string or an array of protocol strings.
... these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol).
... if you don't specify a protocol string, an empty string is assumed.
...And 4 more matches
Writing a WebSocket server in C# - Web APIs
to create an ipaddress object from a string, use the parse static method of ipaddress.
... using system.text; using system.text.regularexpressions; while(client.available < 3) { // wait for enough bytes to be available } byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); //translate bytes of request to string string data = encoding.utf8.getstring(bytes); if (regex.ismatch(data, "^get")) { } else { } the response is easy to build, but might be a little bit difficult to understand.
...-websocket-key" request header without any leading or trailing whitespace concatenate it with "258eafa5-e914-47da-95ca-c5ab0dc85b11" (a special guid specified by rfc 6455) compute sha-1 and base64 hash of the new value write the hash back as the value of "sec-websocket-accept" response header in an http response if (new system.text.regularexpressions.regex("^get").ismatch(data)) { const string eol = "\r\n"; // http/1.1 defines the sequence cr lf as the end-of-line marker byte[] response = encoding.utf8.getbytes("http/1.1 101 switching protocols" + eol + "connection: upgrade" + eol + "upgrade: websocket" + eol + "sec-websocket-accept: " + convert.tobase64string( system.security.cryptography.sha1.create().computehash( encoding.utf8...
...And 4 more matches
Window.getSelection() - Web APIs
when cast to string, either by appending an empty string ("") or using selection.tostring(), this object returns the text selected.
... 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 4 more matches
Window - Web APIs
WebAPIWindow
domparser domparser can parse xml or html source stored in a string into a dom document.
... windoworworkerglobalscope.origin read only returns the global object's origin, serialized as a string.
... window.find() searches for a given string in a window.
...And 4 more matches
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.
... if a network error happened, an empty string is returned.
... return value a bytestring representing all of the response's headers (except those whose field name is set-cookie or set-cookie2) separated by crlf, or null if no response has been received.
...And 4 more matches
CSS values and units - CSS: Cascading Style Sheets
textual data types <custom-ident> pre-defined keywords as an <ident> <string> <url> text data types are either <string>, a quoted series of characters, or an <ident>, a "css identifier" which is an unquoted string.
... a <string> must be quoted with either single or double quotes.
... in the css specifications, values that can be defined by the web developer, like keyframe animations, font-family names, or grid areas are listed as a <custom-ident>, <string>, or both.
...And 4 more matches
regexp:match() - EXSLT
WebEXSLTregexpmatch
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:match() performs regular expression matching on a string, returning the submatches found as a result.
... syntax regexp:match(targetstring, regexpstring[, flagsstring]) parameters targetstring the string to perform regular expression matching upon.
... regexpstring the javascript style regular expression to evaluate.
...And 4 more matches
regexp:replace() - EXSLT
WebEXSLTregexpreplace
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.
... syntax regexp:replace(originalstring, regexpstring, flagsstring, replacestring) parameters originalstring the string perform a search-and-replace operation upon.
... regexpstring the javascript style regular expression to evaluate.
...And 4 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
hexadecimal string notation hexadecimal string notation represents a color using hexadecimal digits to represent each of the color components (red, green, and blue).
... a color in hexadecimal string notation always begins with the character "#".
...the string is case-insensitive.
...And 4 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content (it’s decoration or a tracking pixel), and that non-visual browsers may omit it from rendering.
... referrerpolicy a string indicating which referrer to use when fetching the resource: no-referrer: the referer header will not be sent.
... origin-when-cross-origin: navigating to other origins will limit the included referral data to the scheme, host, and port, while navigating from the same origin will include the full path and query string.
...And 4 more matches
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
value a domstring representing a week and year, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list.
... methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input.
... the format of the date and time value used by this input type is described in format of a valid week string in date and time formats used in html.
...And 4 more matches
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
challenge a challenge string that is submitted along with the public key.
... defaults to an empty string if not specified.
... the element is written as follows: <keygen name="name" challenge="challenge string" keytype="type" keyparams="pqg-params"> the keytype parameter is used to specify what type of key is to be generated.
...And 4 more matches
Data URLs - HTTP
syntax data urls are composed of four parts: a prefix (data:), a mime type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> the mediatype is a mime type string, such as 'image/jpeg' for a jpeg image file.
... encoding data into base64 format base64 is a group of binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation.
... by consisting only in ascii characters, base64 strings are generally url-safe, and that's why they can be used to encode data in data urls.
...And 4 more matches
BigInt - JavaScript
const thebiggestint = 9007199254740991n const alsohuge = bigint(9007199254740991) // ↪ 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 wit...
... instance methods bigint.prototype.tolocalestring() returns a string with a language-sensitive representation of this number.
... overrides the object.prototype.tolocalestring() method.
...And 4 more matches
Date() constructor - JavaScript
syntax new date() new date(value) new date(datestring) new date(year, monthindex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator.
... if you simply call the date object directly, such as now = date(), the returned value is a string rather than a date object.
... timestamp string datestring a string value representing a date, specified in a format recognized by the date.parse() method.
...And 4 more matches
translate - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the translate function evaluates a string and a set of characters to translate and returns the translated string.
... syntax translate(string, abc, xyz) arguments string the string to evaluate.
... abc the string of characters that will be replaced.
...And 4 more matches
Compiling from Rust to WebAssembly - WebAssembly
it allows javascript to call a rust api with a string, or a rust function to catch a javascript exception.
...it says "the alert function takes one argument, a string named s." as you might suspect, this is the alert function provided by javascript.
... this function is named greet, and takes one argument, a string (written &str), name.
...And 4 more matches
clipboard - Archive of obsolete content
the following types are supported: text (plain text) html (a string of html) image (a base-64 encoded png) if no data type is provided, then the module will detect it for you.
...if the intention is set the clipboard to a data url as string and not as image, it can be done by specifying a different flavor, like text.
... parameters data : string the data to put on the clipboard.
...And 3 more matches
event/core - Archive of obsolete content
type : string the type of event.
... type : string the type of event.
... type : string the type of event.
...And 3 more matches
stylesheet/style - Archive of obsolete content
stylesheet file url(s) are verified to be local to an add-on, while css rules are verified to be a string or array of strings.
... parameters options : object required options: name type uri string,array a string, or an array of strings, that represents local uri to stylesheet.
... source string,array a string, or an array of strings, that contains css rules.
...And 3 more matches
system/events - Archive of obsolete content
var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
...data refers to a string that you would like to pass through this event.
... on(type, listener, strong) listen to events of a given type parameters type : string the event type name to watch.
...And 3 more matches
ui/sidebar - Archive of obsolete content
r', url: require("sdk/self").data.url("sidebar.html"), onattach: function (worker) { console.log("attaching"); }, onshow: function () { console.log("showing"); }, onhide: function () { console.log("hiding"); }, ondetach: function () { console.log("detaching"); } }); parameters options : object required options: name type title string a title for the sidebar.
... url string the url of the content to load in the sidebar.
... optional options: name type id string the id of the sidebar.
...And 3 more matches
JavaScript Daemons Management - Archive of obsolete content
the date argument can be a date object, a string expressing the date in gmtstring format, or a number expressing the number of milliseconds since january 1, 1970, 00:00:00 utc.
...the date argument can be a date object, a string expressing the date in gmtstring format, or a number expressing the number of milliseconds since january 1, 1970, 00:00:00 utc.
...ton> <button onclick="orecompose.makeloop();alert('changed');">makeloop</button> <button onclick="orecompose.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="orecompose.close();">close</button> <button onclick="orecompose.reclose();">reclose</button><br /> frame rate: <input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){orecompose.setrate(this.value);}" /></p> </body> </html> example #2: a practical instantiation – daemon.buildaround() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>daemon.buildaround(&hellip;)</title> <script type="text/javascript" src="daemon...
...And 3 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
as a rough overview this is a version string split by periods, some examples: 2.0 1.0b1 3.0pre1 5.0.1.2 note: before firefox 1.5 the more basic firefox version format was used: major.minor.release.build[+] where only digits were allowed.
... for later versions, the compatible add-on version with the greatest version string will be used by the client for automatic updates.
...you may also use the other substitution strings supported by updateurl, although those may be less useful.
...And 3 more matches
Install Manifests - Archive of obsolete content
some have simple string values, some are complex resources.
... id the id of the extension, which must be one of the following: guid (firefox 1.0) a string formatted like so: extensionname@example.org the latter format is significantly easier to generate and manipulate.
...these version strings are formatted in the same fashion as the version property and will be compared to the application version; this allows the extension author to specify which versions of firefox an extension has been tested with.
...And 3 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
event listeners can be defined on the given nodes by passing functions rather than strings to on* attributes: var href = "http://www.google.com/"; var text = "google"; var nodes = {}; document.documentelement.appendchild( jsontodom(["xul:hbox", {}, ["div", {}, ["a", { href: href, key: "link", onclick: function (event) { alert(event.target.href); } }, text], ["span", { class: "stuff" }, "stuff"]]],...
... ['html:label', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-static strings to methods such as .append() and .html().
...hould be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattribute("onclick", "openwindow(this.getattribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or number.
...And 3 more matches
Adding preferences to an extension - Archive of obsolete content
inside that, we create a file, defaults.js, that describes the default value of our preferences: pref("extensions.stockwatcher2.symbol", "goog"); the standard for third-party preferences, such as those used in extensions, is to use the string "extensions", a period, the name of the extension, another period, then a preference name, as seen in the example above.
... refreshinformation() this method is slightly revised from previous versions, in that it needs to fetch the preference for the stock to watch and use that to construct the url to monitor, as well as to construct the string to be displayed in the status bar panel.
...// it by its full name var symbol = stockwatcher.tickersymbol; var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher2'); var output = httprequest.responsetext; if (output.length) { // remove any whitespace from the end of the string output = output.replace(/\w*$/, ""); // build the tooltip string var fieldarray = output.split(","); samplepanel.label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " + fieldarray[5] + " | " + "low: " + fieldarray[6] + " | " + "high: " + fieldarray[7] + " | " ...
...And 3 more matches
Index of archived content - Archive of obsolete content
high-level apis addon-page base64 clipboard context-menu hotkeys indexed-db l10n notifications page-mod page-worker panel passwords private-browsing querystring request selection self simple-prefs simple-storage system tabs timers ui url widget windows low-level apis /loader chrome ...
...spaceuri lookupprefix miscellaneous modules on page load page loading post data to window preferences progress listeners queryselector rosetta running applications svg animation svg general scrollbar sidebar stringview tabbox toolbar tree uri parsing view source for xul applications windows xml-related code snippets xml:base support in old browsers xpath getattributens common pitfalls commun...
... sxsw 2007 presentations safe browsing safe browsing: design documentation safely loading uris same origin policy for xbl space manager detailed design space manager high level design standalone xpcom standard makefile header static analysis for windows code under linux stress testing string quick reference string rosetta stone structure of an installable bundle supporting per-window private browsing supporting private browsing mode table cellmap table cellmap - border collapse table layout regression tests table layout strategy tamarin abcasm ...
...And 3 more matches
importUserCertificates - Archive of obsolete content
resultstring = crypto.importusercertificates("nicknamestring","certstring",forcebackup); argument description "nicknamestring" this is the nickname that will be used to describe the certificate in the client's certificate management ui.
...however, if this certificate has the same dn as one or more certificates that already exist in the user's certificate store, the nickname associated with the certificate(s) of the same dn in the certificate store is used, and the <tt>"nicknamestring"</tt> parameter is ignored.
... if the string is null and no certificate with the same dn exists in the user's certificate store, personal security manager uses the following pattern to derive the nickname: <tt><common name>'s <issuer name> id</tt>.
...And 3 more matches
popChallengeResponse - Archive of obsolete content
resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message.
... the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value.
... witness octet string, -- the result of applying the one-way function (owf) to a -- randomly-generated integer, a.
...And 3 more matches
Clipboard Test - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...string contentthe content to be copied to the clipboard.
... if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...And 3 more matches
Clipboard - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...string contentthe content to be copied to the clipboard.
... if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...And 3 more matches
Monitoring downloads - Archive of obsolete content
onload: function() { // initialization code this.initialized = true; this.strings = document.getelementbyid("downloadlogger-strings"); this.dlmgr = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); this.dlmgr.addlistener(downloadlogger); // open the database, placing its file in the profile directory this.dbfile = components.classes["@mozilla.org/file/directory_service;1"] ...
... var dbconn = this.storageservice.opendatabase(this.dbfile); statement = dbconn.createstatement("replace into items values " + "(?1, ?2, ?3, 0, 0.0, 0)"); statement.bindstringparameter(0, adownload.source.spec); statement.bindint64parameter(1, adownload.size); statement.bindint64parameter(2, adownload.starttime); statement.execute(); statement.reset(); dbconn.close(); break; // record the completion (whether failed or successful) of the download case components.interfaces.nsidownloadmanager.download_finished: c...
...ile); var statement = dbconn.createstatement("update items set size=?1, " + "endtime=?2, speed=?3, status=?4 where source=?5 and starttime=?6"); statement.bindint64parameter(0, adownload.size); statement.bindint64parameter(1, endtime.gettime()); statement.binddoubleparameter(2, adownload.speed); statement.bindint32parameter(3, adownload.state); statement.bindstringparameter(4, adownload.source.spec); statement.bindint64parameter(5, adownload.starttime); statement.execute(); statement.reset(); dbconn.close(); }, this simply opens the database and builds and executes a update sqlite command that finds the download item whose source uri and start time match the download that has completed and updates its information.
...And 3 more matches
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.
... atext the string to be displayed in the confirmation dialog.
... this string is typically in the form of a prompt for the user (e.g., "are you sure you want to delete the selected file(s)?").
...And 3 more matches
Writing to Files - Archive of obsolete content
an output stream is an object which can be used to write bytes, strings and other values to a file.
...for text files, you will usually use the writestring method.
... var file = io.getfile("desktop", "myinfo.txt"); var stream = io.newoutputstream(file, "text"); stream.writestring("this is some text"); stream.close(); in this example, a text input stream is created for the file 'myinfo.txt'.
...And 3 more matches
Complete - Archive of obsolete content
in the custom toolbar button extension, the only things that might depend on the locale are the text strings displayed in the user interface.
...xul and javascript each have mechanisms for loading text strings from the correct locale directory.
...its javascript code gets the text strings it needs from the xul.
...And 3 more matches
Localization - Archive of obsolete content
usually, a table of strings is created for each language.
... instead of hard-coding text directly into an application, each piece of text is only a reference into the string table.
...you can use these so that the entity is replaced with its value, which can be a string of text.
...And 3 more matches
listitem - Archive of obsolete content
label type: string the label that will appear on the element.
... type type: string you can make an item in a listbox a checkbox by setting this attribute to the value checkbox.
... value type: string the string attribute allows you to associate a data value with an element.
...And 3 more matches
menulist - Archive of obsolete content
label type: string the label that will appear on the element.
... value type: string the string attribute allows you to associate a data value with an element.
... crop type: string gets and sets the value of the crop attribute.
...And 3 more matches
menupopup - Archive of obsolete content
position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.
... positions specified as a single word string are shortcuts for the values above.
... position type: string gets and sets the value of the position attribute.
...And 3 more matches
menuseparator - Archive of obsolete content
cted, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value examples <menu label="menu"> <menupopup> <menuitem label="item1"/> <menuseparator/> <menuitem label="item2"/> <menuitem label="item3"/> </menupopup> </menu> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
... label type: string the label that will appear on the element.
... value type: string the string attribute allows you to associate a data value with an element.
...And 3 more matches
notification - Archive of obsolete content
label type: string the label that will appear on the element.
... value type: string the string attribute allows you to associate a data value with an element.
... label type: string gets and sets the value of the label attribute.
...And 3 more matches
radio - Archive of obsolete content
ArchiveMozillaXULradio
group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group.
... label type: string the label that will appear on the element.
... value type: string the string attribute allows you to associate a data value with an element.
...And 3 more matches
tabbrowser - Archive of obsolete content
contenttitle type: string this read-only property contains the title of the document object in the browser.
... homepage type: string home page url this property holds the value of the user's home page setting.
... see preprocessing post data for preparing postdata out of a string.
...And 3 more matches
wizard - Archive of obsolete content
ard').canadvance = (document.getelementbyid('secretcode').value == "cabbage"); } </script> <wizardpage onpageshow="checkcode();"> <label value="enter the secret code:"/> <textbox id="secretcode" onkeyup="checkcode();"/> </wizardpage> <wizardpage> <label value="that is the correct secret code."/> </wizardpage> </wizard> attributes activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
... inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background).
... title type: string the text to appear in the title bar of the window.
...And 3 more matches
E4X for templating - Archive of obsolete content
security and escaping function e (str) { if (typeof str === 'xml') {str = str.tostring();} return str; } function quot (s) { // useful for placing user input within inline javascript; may be combined with escape function above as well if (typeof s === 'string') { return s.replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } if (typeof s === 'xml') { return s.tostring().replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } return string(s).replace...
...(/"/g, '&quot;').replace(/'/g, '&apos;'); } localization e4x works nicely with a simple utility for localizing strings of a properties file: // localization function $s(msg, args){ //get localized message var strs = cc['@mozilla.org/intl/stringbundle;1'].getservice(ci.nsistringbundleservice).
... createbundle('chrome://myeext/locale/myext.properties'); if (args){ args = array.prototype.slice.call(arguments, 1); return strs.formatstringfromname(msg,args,args.length); } return strs.getstringfromname(msg); } for example, <toolbarbutton label={$s('mytoolbar.label')}/> conditionals function _if (cond, h, _else) { if (cond && cond != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <description>{elems[0]}</description>, function _else () <label>no data</label> )} note that the simple xmlli...
...And 3 more matches
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 export other new features regular expressions signed scripts...
... number now produces nan rather than an error if x is a string that does not contain a well-formed numeric literal.
... string now converts a specified object to a string.
...And 3 more matches
JSException - Archive of obsolete content
backward compatibility javascript 1.1 through 1.3 jsexception had three public constructors which optionally took a string argument, specifying the detail message or other information for the exception.
...public jsexception(string s) 3.
... public jsexception(string s, string filename, int lineno, string source, int tokenindex) arguments s the detail message.
...And 3 more matches
JavaArray - Archive of obsolete content
for example: var javastring = new java.lang.string("hello world!"); var bytearray = javastring.getbytes(); bytearray[0] // returns 72 bytearray[1] // returns 101 any java data brought into javascript is converted to javascript data types.
...in addition, the tostring method is inherited from the object object and returns the following value: [object javaarray] you must specify a class object, such as one returned by java.lang.object.forname, for the componenttype parameter of newinstance when you use this method to create an array.
... methods tostring: in javascript 1.4, this method is overridden by the inherited method java.lang.object.tostring.
...And 3 more matches
JavaObject - Archive of obsolete content
examples example: instantiating a java object in javascript the following code creates the javaobject thestring, which is an instance of the class java.lang.string: var thestring = new packages.java.lang.string("hello, world"); because the string class is in the java package, you can also use the java synonym and omit the packages keyword when you instantiate the class: var thestring = new java.lang.string("hello, world"); example: accessing methods of a java object because the javaobject thestring ...
...is an instance of java.lang.string, it inherits all the public methods of java.lang.string.
... the following example uses the startswith method to check whether thestring begins with "hello".
...And 3 more matches
Windows Media in Netscape - Archive of obsolete content
this section presents two mechanisms to detect the browsers that support windows media player -- detection using javascript objects which is useful for client-side detection detection using the user agent string which is useful for server side detection.
... else if (window.geckoactivexobject) { player = new geckoactivexobject("wmplayer.ocx.7"); } } catch(e) { // handle error -- no wmp 7 or 9 control // can use wmp 6 also if necessary, but this is legacy software nowadays } if (player) { // windows media player control exists and it is version 7 or 9 // can use wmp 7 or 9 api -- call versioninfo property, only in 7 and 9 var versionstring = player.versioninfo; alert(versionstring); } only geckoactivexobject allows for the use of the windows media player classid as an argument.
...for example if (window.activexobject) { // internet explorer only script } server-side detection using user-agent strings netscape 7.1's user agent string on windows has the general pattern: mozilla/5.0 (windows; u; <em>operating system version</em>; <em>language</em>; rv:1.4) gecko/20030624 netscape/7.1 (ax<em>[;optional comments]</em>) the "vendor comment" (ax) following the "vendor version" netscape/7.1 is an indicator that the browser supports the windows media player activex control.
...And 3 more matches
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
in some programming languages, the symbol data type is referred to as an "atom." symbols don't "auto-convert" to strings most values in javascript support implicit conversion to a string.
... for example: let sym = symbol("sym") alert(sym) // typeerror: cannot convert a symbol value to a string that’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert one into another.
... if you really want to show a symbol, we need to call .tostring() on it.
...And 3 more matches
Client-side form validation - Learn web development
minlength and maxlength: specifies the minimum and maximum length of textual data (strings) min and max: specifies the minimum and maximum values of numerical input types type: specifies whether the data needs to be a number, an email address, or some other specific preset type.
...a regular expression (regex) is a pattern that can be used to match character combinations in text strings, so regexs are ideal for form validation and serve a variety of other uses in javascript.
... required pattern="[bb]anana|[cc]herry"> <button>submit</button> </form> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } this gives us the following update — try it out: note: you can find this example live on github as fruit-pattern.html (see also the source code.) in this example, the <input> element accepts one of four possible values: the strings "banana", "banana", "cherry", or "cherry".
...And 3 more matches
Looping code - Learn web development
se() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else if (i === contacts.length-1) para.textcontent = 'contact not found.'; } }); </script> </body> </html> first of all we have some variable definitions — we have an array of contact information, with each item being a string containing a name and phone number separated by a colon.
...note that we also run the tolowercase() method on the string, so that searches will be case-insensitive.
...if it is, we enter a string into the paragraph to report what the contact's number is, and use break to end the loop.
...And 3 more matches
Test your skills: Conditionals - Learn web development
conditionals 1 in this task you are provided with two variables: season — contains a string that says what the current season is.
... we want you to create a conditional that checks whether season contains the string "summer", and if so assigns a string to response that gives the user an appropriate message about the season.
... if not, it should assign a generic string to response that tells the user we don't know what season it is.
...And 3 more matches
Working with Svelte stores - Learn web development
moreover, because web storage only supports saving string values, we will have to convert from string to object when saving, and vice versa when we are loading the value from local storage.
... give it the following content: import { writable } from 'svelte/store'; export const localstore = (key, initial) => { // receives the key of the local storage and an initial value const tostring = (value) => json.stringify(value, null, 2) // helper function const toobj = json.parse // helper function if (localstorage.getitem(key) === null) { // item not present in local storage localstorage.setitem(key, tostring(initial)) // initialize local storage with initial value } const saved = toobj(localstorage.getitem(key)) // convert to object const { subscribe, set, update } = writable(saved) // crea...
...te the underlying writable store return { subscribe, set: (value) => { localstorage.setitem(key, tostring(value)) // save also to local storage as a string return set(value) }, update } } our localstore will be a function that when executed initially reads its content from web storage, and returns an object with three methods: subscribe(), set(), and update().
...And 3 more matches
Handling common JavaScript problems - Learn web development
you can also see that the jsonobj variable is storing a text string, not a json object.
... if you expand the onload scope, you'll see that the superheroes variable is a text string too, not an object.
... using bad browser sniffing code all browsers have a user-agent string, which identifies what the browser is (version, name, os, etc.) in the bad only days when pretty much everyone used netscape or internet explorer, developers used to use so-called browser sniffing code to detect which browser the user was using, and give them appropriate code to work on that browser.
...And 3 more matches
Creating Sandboxed HTTP Connections
setting up an http connection the first step in setting up an http connection from an url (stored in a string) is to create an nsiuri out of it.
...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.
...below is an example: // global channel var gchannel; // init the channel // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstar...
...And 3 more matches
HTML parser threading
attribute values, public identifiers (in doctype) and system identifiers (in doctype) are heap-allocated nsstring objects (i.e.
... pointed to by nsstring*!).
... attribute values nsstrings are deleted by the attribute holder when it gets deleted.
...And 3 more matches
XPCOMUtils.jsm
when set to true, and only if 'value' // is not specified, the concatenation of the string "service," and the // object's contractid is passed as avalue parameter of addcategoryentry.
...ame, aresource, [optional] asymbol); function definelazyservicegetter(aobject, aname, acontract, ainterfacename); function generatensgetfactory(componentsarray); function generateci(classinfo); function generateqi(interfaces); void importrelative(that, path, scope); generator itersimpleenumerator(enumerator, interface); generator iterstringenumerator(enumerator); attributes attribute type description categorymanager nsicategorymanager returns a reference to nsicategorymanager.
... example const nsifile = components.interfaces.nsifile; for (var file in xpcomutils.itersimpleenumerator(dir.directoryentries, nsifile)) console.log(file.path); iterstringenumerator() wraps an nsistringenumerator or nsiutf8stringenumerator instance into a javascript generator that can be easily iterated over.
...And 3 more matches
Localizing XLIFF files for iOS
this tutorial will walk you through the steps you need to take to translation strings within an xliff file.
... string repository for firefox on ios the firefox-ios.xliff file is located in svn.
... strings are located within <trans-unit> tags.
...And 3 more matches
Localization Use Cases
declensions in gaia's browser app, there's an about-browser string defined as follows in apps/browser/locales/browser: about-browser=about {{browserbrandshortname}} problem definition in many inflected languages (e.g.
... in slovenian, the ideal string would inflect the noun, like so: o firefoxu however, since we want the name of the browser to be stored in the browserbrandshortname entity, we can't modify it.
...slovenian uses the locative case with its about preposition: <aboutbrowser "o {{ browserbrandshortname.locative }}"> for the official branding, we get: o firefoxu and for the unofficial branding, we end up with: o brskalniku genders in the system app's apps/system/locales/system, there's a string called crash-banner-os2.
...And 3 more matches
PR_strtod
converts the prefix of a decimal string to the nearest double-precision floating point number.
... syntax #include <prdtoa.h> prfloat64 pr_strtod(const char *s00, char **se); parameters the function has these parameters: s00 the input string to be scanned.
... se a pointer that, if not null, will be assigned the address of the last character scanned in the input string.
...And 3 more matches
NSS 3.12.4 release notes
cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regexpcasesearch these functions will match a string with a shell expression.
...expected return values: non_sxp if exp is a standard string invalid_sxp if exp is a shell expression, but invalid valid_sxp if exp is a valid shell expression expression matching rules: * matches anything ?
... matches one character \ will escape a special character $ matches the end of the string bracketed expressions: [abc] matches one occurence of a, b, or c.
...And 3 more matches
certutil
bracket the issuer string with quotation marks if it contains spaces.
...this slot can also be explicitly named with the string "internal".
...bracket the nickname string with quotation marks if it contains spaces.
...And 3 more matches
Exact Stack Rooting
js::rooted<t> typedef js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc.
...instead, spidermonkey has a convenient suite of c++ raii classes to do this for you, called js::rootedt: rootedstring str1(cx, js_valuetostring(cx, val)); rootedstring str2(rt, js_valuetostring(cx, val)); note 1: c++ insists that an initializing assignment (e.g., the default constructor followed by operator=) must have a copy constructor available, even if it is not used.
... js::handle<t> typedef js::handle<t> js::handlet; -> handleobject, handlestring, handlescript, etc.
...And 3 more matches
JS::Add*Root
syntax bool js::addvalueroot(jscontext *cx, js::heap<js::value> *vp); bool js::addstringroot(jscontext *cx, js::heap<jsstring *> *rp); bool js::addobjectroot(jscontext *cx, js::heap<jsobject *> *rp); bool js::addnamedvalueroot(jscontext *cx, js::heap<js::value> *vp, const char *name); bool js::addnamedvaluerootrt(jsruntime *rt, js::heap<js::value> *vp, const char *name); bool js::addnamedstringroot(jscontext *cx, js::heap<jsstring *> ...
... rp js::heap<jsstring *> the address of the jsstring * variable to root.
... vp/rp is the address of a c/c++ variable (or field, or array element) of type js::value, jsstring *, jsobject *, or jsscript *.
...And 3 more matches
JS_GetLocaleCallbacks
get and set locale specific string conversion and error message callbacks.
... callback functions struct jslocalecallbacks { jslocaletouppercase localetouppercase; jslocaletolowercase localetolowercase; jslocalecompare localecompare; // not used #if expose_intl_api jslocaletounicode localetounicode; }; typedef bool (* jslocaletouppercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocaletolowercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocalecompare)(jscontext *cx, js::handlestring src1, js::handlestring src2, js::mutablehandlevalue rval); typedef bool (* jslocaletounicode)(jscontext *cx, const char *src, js::mutablehandlevalue rval); type ...
... description jslocaletouppercase implementation of string.prototype.tolocaleuppercase() function.
...And 3 more matches
Detailed XPCOM hashtable guide
any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else.
... key type: integer string/cstring nsid nsisupports* complex data type: none (hash set) nsthashtable<...> simple (pruint32) nsdatahashtable nsthashtable<...> <nsuint32hashkey, pruint32> <ns(c)stringhashkey, pruint32> <nsidhashkey, pruint32> <nsisupportshashkey, pruint32> interface (nsisupports) nsinterfacehashtable <nsuint32hashke...
...y, nsisupports> <ns(c)stringhashkey, nsisupports> <nsidhashkey, nsisupports> <nsisupportshashkey, nsisupports> class (nsstring*) nsclasshashtable <nsuint32hashkey, nsstring> <ns(c)stringhashkey, nsstring> <nsidhashkey, nsstring> <nsisupportshashkey, nsstring> complex (structures, etc.) nsthashtable<...> pldhash the pldhash implementation is a fairly low-level implementation, written in c.
...And 3 more matches
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
... void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
...astring [in] a nsacstring to append to this string.
...And 3 more matches
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
... void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
...astring [in] a nsastring to append to this string.
...And 3 more matches
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsacstring::assign family of functions.
... self_type& operator=( const self_type& astring ); parameters astring [in] a nsembedcstring to append to this string.
... self_type& operator=( const abstract_string_type& astring ); parameters astring [in] a nsacstring to append to this string.
...And 3 more matches
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsastring::assign family of functions.
... self_type& operator=( const self_type& astring ); parameters astring [in] a nsembedstring to append to this string.
... self_type& operator=( const abstract_string_type& astring ); parameters astring [in] a nsastring to append to this string.
...And 3 more matches
mozIAsyncFavicons
siuri apageuri, in nsifavicondatacallback acallback); void setandfetchfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); 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.
...however, if no favicon data is currently associated with the favicon uri, adatalen will be 0, adata will be an empty array, and amimetype will be an empty string.
...void replacefavicondata( in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, [optional] in prtime aexpiration); parameters afaviconuri uri of the favicon whose data is being set.
...And 3 more matches
nsIAccessibleDocument
obsolete since gecko 2.0 astring getnamespaceuriforid(in short namespaceid); attributes attribute type description caretaccessible nsiaccessible read only.
... obsolete since gecko 1.9 doctype astring the doc type of the document, as specified in the document.
...obsolete since gecko 1.9 mimetype astring the mime type of the document.
...And 3 more matches
nsICRLInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description lastfetchurl autf8string the url this crl was last fetched from.
... lastupdatelocale astring lastupdate formatted as a human readable string formatted according to the environment locale.
... nameindb astring the key identifying the crl in the database.
...And 3 more matches
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.
... parameters name type description astr string the message to log.
... parameters name type description aasciistring string ascii string to decode.
...And 3 more matches
nsIDOMFontFace
attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on).
... name domstring full font name as obtained from the font resource.
... attribute type description format domstring the font format.
...And 3 more matches
nsIDOMOfflineResourceList
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.
... void mozadd( in domstring uri ); parameters uri the uri of the resource to add to the list.
... void mozhasitem( in domstring uri ); parameters uri the uri of the resource to check.
...And 3 more matches
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.
... void serializetostream( in nsidomnode root, in nsioutputstream stream, in autf8string charset ); parameters root the root of the subtree to be serialized.
...if this string is empty and root is a document, the document's character set will be used.
...And 3 more matches
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.
...domstring getitem( in domstring key ); parameters key the key for which data should be returned.
...domstring key( in unsigned long index ); parameters index the index for which the corresponding key should be returned.
...And 3 more matches
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.
... boolean haskey( in string key ); parameters key key to check for.
... void getkeys( out pruint32 count, [retval, array, size_is(count)] out string keys ); return value array of all keys, unsorted.
...And 3 more matches
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.
... void set( in astring aname, in astring avalue ); parameters aname the variable name to set.
... astring get( in astring aname ); parameters aname the variable name to retrieve.
...And 3 more matches
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, [optional] in nsiinterfacerequestor awindowcontext); void loa...
...boolean externalprotocolhandlerexists( in string aprotocolscheme ); parameters aprotocolscheme the scheme from a url: http, ftp, mailto, and so on.
...astring getapplicationdescription( in autf8string ascheme ); parameters ascheme the scheme to look up.
...And 3 more matches
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.
... lang astring the language of the text (such as "en-us" for u.s.
... text astring the actual text content.
...And 3 more matches
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 type description dbconnection mozistor...
...void addentry( in astring name, in astring value ); parameters name value entryexists() gets whether a name and value pair exists in the form history.
... boolean entryexists( in astring name, in astring value ); parameters name value return value nameexists() returns true if there is no entry that is paired with a name.
...And 3 more matches
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 channel has been canceled.
... localaddress autf8string the local ip address to which the channel is bound, in the same format produced by pr_netaddrtostring().
... obsolete since gecko 1.9 remoteaddress autf8string the ip address of the remote host to which this channel is bound, in the same format produced by pr_netaddrtostring().
...And 3 more matches
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 getapplicationlocale() gets the user preference for locale from the operating system.
... note: this has nothing to do with the locale used for localization of the application (ui text strings and so on.).
...astring getlocalecomponentforuseragent(); parameters none.
...And 3 more matches
nsINavHistoryQuery
annotation autf8string the annotation name.
... domain autf8string this is the host or domain name (controlled by domainishost).
...setting it to an empty string is a real query and will match any uri that has no host name (local files and such).
...And 3 more matches
nsINavHistoryResultViewer
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 nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long aoldindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); void nodereplaced(in nsinavhistorycontainerresultnode parent, in nsinavhistoryresultnode olditem, in nsinavh...
... void nodeannotationchanged( in nsinavhistoryresultnode anode, in autf8string aannoname ); parameters anode the node whose title has changed.
...And 3 more matches
nsIOutputStream
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!
... note: though this method is scriptable, javascript code must only pass an ascii character string as the abuf parameter.
... unsigned long write( in string abuf, in unsigned long acount ); parameters abuf the buffer containing the data to be written.
...And 3 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 holdweak); void runw(in boolean blocking, [array, size_is(count)] in wstring args, in unsigned long count); void runwasync([array, size_is(count)] in wstring args, in unsigned long count, [optional] in n...
... processname string the name of the process.
... void run( in boolean blocking, [array, size_is(count)] in string args, in unsigned long count ); parameters blocking if true, this method will block until the process terminates; if false, the method returns immediately.
...And 3 more matches
nsIProperties
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.
... void get( in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result ); parameters prop the property name.
...void getkeys( out pruint32 count, [array, size_is(count), retval] out string keys ); parameters count the length of the result array.
...And 3 more matches
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 boolean dynamiccreation); native code only!
... boolean hasdetachededitor(); violates the xpcom interface guidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata); violates the xpcom interface guidelines void setissubframe(in boolean aflag); void setscrollposition(in long x, in long y); void settitle(in astring atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void setviewerbounds(in nsintrect bounds); native code only!
... contenttype acstring indicates the content-type of the document that this is a session history entry for.
...And 3 more matches
nsIStructuredCloneContainer
you can also get a base-64-encoded string containing a copy of the container's serialized data, using getdataasbase64().
... 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.
...getdataasbase64() get this structured clone container's data as a base-64-encoded string.
...And 3 more matches
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.
... hashfunction astring the hash function to use when determining the integrity of the patch file.
... hashvalue astring the value of the hash function named in hashfunction that should be computed if the file is not corrupt.
...And 3 more matches
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 nsiwebsocketchanne...
...void onbinarymessageavailable( in nsisupports acontext, in acstring amsg ); parameters acontext user defined context.
...void onmessageavailable( in nsisupports acontext, in autf8string amsg ); parameters acontext user defined context.
...And 3 more matches
nsIXULBrowserWindow
method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); void setjsdefaultstatus(in astring status); void setjsstatus(in astring status); void setoverlink(in astring link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
...astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the specified target for the link.
... return value a string indicating the revised target for the link.
...And 3 more matches
nsIXULTemplateResult
method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result.
... type astring the type of the object.
... methods getbindingfor() get the string representation of the value of a variable for this result.
...And 3 more matches
Using nsIDirectoryService
first, you must know what the string key (or property) is that refers to this locations.
...second, you must acquire the implementation and call get() passing the known string key.
... in the example below, prop is a string that references your requested file locations.
...And 3 more matches
AudioTrack.kind - Web APIs
WebAPIAudioTrackkind
the kind property contains a string indicating the category of audio contained in the audiotrack.
...see audio track kind strings for a list of the kinds available for audio tracks.
... syntax var trackkind = audiotrack.kind; value a domstring specifying the type of content the media represents.
...And 3 more matches
BlobBuilder - Web APIs
method overview void append(in arraybuffer data); void append(in blob data); void append(in string data, [optional] in string endings); blob getblob([optional] in domstring contenttype); file getfile(in domstring name, [optional] in domstring contenttype); methods append() appends the contents of the specified javascript object to the blob being built.
... if the value you specify isn't a blob, arraybuffer, or string, the value is coerced to a string before being appended to the blob.
... void append( in arraybuffer data ); void append( in blob data ); void append( in string data, [optional] in string endings ); parameters data the data to append to the blob being constructed.
...And 3 more matches
CSSStyleDeclaration.setProperty() - Web APIs
syntax style.setproperty(propertyname, value, priority); parameters propertyname is a domstring representing the css property name (hyphen case) to be modified.
... value optional is a domstring containing the new property value.
... if not specified, treated as the empty string.
...And 3 more matches
ChildNode.after() - Web APIs
WebAPIChildNodeafter
the childnode.after() method inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode.
... domstring objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.after((node or domstring)...
...And 3 more matches
ChildNode - Web APIs
WebAPIChildNode
childnode.before() inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode.
... domstring objects are inserted as equivalent text nodes.
... childnode.after() inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode.
...And 3 more matches
DataTransferItemList.add() - Web APIs
the item may be a file or a string of a given type.
... syntax datatransferitem = datatransferitemlist.add(data, type); datatransferitem = datatransferitemlist.add(file); parameters data a string representing the drag item's data.
... type a string of the drag item's type.
...And 3 more matches
Document.cookie - Web APIs
WebAPIDocumentcookie
syntax read all cookies accessible from this location allcookies = document.cookie; in the code above allcookies is a string containing a semicolon-separated list of all cookies (i.e.
... write a new cookie document.cookie = newcookie; in the code above, newcookie is a string of form key=value.
... note: prior to gecko 6.0, paths with quotes were treated as if the quotes were part of the string, instead of as if they were delimiters surrounding the actual path string.
...And 3 more matches
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.
... in the above example, selobj.tostring() is automatically called when it is passed to window.alert().
...And 3 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.
... if the named attribute does not exist, the value returned will either be null or "" (the empty string); see notes for details.
... return value the string value of the specified attribute.
...And 3 more matches
HTMLBodyElement - Web APIs
htmlbodyelement.alink is a domstring that represents the color of active hyperlinks.
... htmlbodyelement.background is a domstring that represents the description of the location of the background image resource.
... htmlbodyelement.bgcolor is a domstring that represents the background color for the document.
...And 3 more matches
HTMLEmbedElement - Web APIs
htmlembedelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... htmlembedelement.height is a domstring reflecting the height html attribute, containing the displayed height of the resource.
... htmlembedelement.name is a domstring representing the name of the embedded object.
...And 3 more matches
HTMLImageElement.alt - Web APIs
think of it like this: when choosing alt strings for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image on the page.
... syntax htmlimageelement.alt = alttext; let alttext = htmlimageelement.alt; value a domstring which contains the alternate text to display when the image is not loaded or for use by assistive devices.
...if the image doesn't require a fallback (such as for an image which is simply decorative or an advisory icon of minimal importance), you may specify an empty string ("").
...And 3 more matches
NavigatorID.userAgent - Web APIs
the navigatorid.useragent read-only property returns the user agent string for the current browser.
... browser identification based on detecting the user agent string is unreliable and is not recommended, as the user agent string is user configurable.
... opera 6+ allows users to set the browser identification string via a menu.
...And 3 more matches
Notification.Notification() - Web APIs
it defaults to auto, which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as specified using a domstring representing a bcp 47 language tag.
... badge: a usvstring containing the url of the image used to represent the notification when there isn't enough space to display the notification itself.
... body: a domstring representing the body text of the notification, which is displayed below the title.
...And 3 more matches
ParentNode.append() - Web APIs
WebAPIParentNodeappend
the parentnode.append() method inserts a set of node objects or domstring objects after the last child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
... differences from node.appendchild(): parentnode.append() allows you to also append domstring objects, whereas node.appendchild() only accepts node objects.
...And 3 more matches
RTCIceCandidateStats - Web APIs
address optional a string containing the address of the candidate.
... candidatetype optional a string matching one of the values in the rtcicecandidatetype enumerated type, indicating what kind of candidate the object provides statistics for.
... networktype optional a string from the rtcnetworktype enumerated type which indicates the type of interface used for a local candidate.
...And 3 more matches
Screen Capture API - Web APIs
mediatrackconstraints mediatrackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while the mouse is in motion.
... mediatrackconstraints.displaysurface a constraindomstring indicating what type of display surface is to be captured.
... mediatracksettings mediatracksettings.cursor a string which indicates whether or not the display surface currently being captured includes the mouse cursor, and if so, whether it's only visible while the mouse is in motion or if it's always visible.
...And 3 more matches
SubtleCrypto.exportKey() - Web APIs
syntax const result = crypto.subtle.exportkey(format, key); parameters format is a string value describing the data format in which the key should be exported.
... /* convert an arraybuffer into a string from https://developers.google.com/web/updates/2012/06/how-to-convert-arraybuffer-to-and-from-string */ function ab2str(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } /* export the given key and write it into the "exported-key" space.
... */ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "pkcs8", key ); const exportedasstring = ab2str(exported); const exportedasbase64 = window.btoa(exportedasstring); const pemexported = `-----begin private key-----\n${exportedasbase64}\n-----end private key-----`; const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = pemexported; } /* generate a sign/verify key pair, then set up an event listener on the "export" button.
...And 3 more matches
TextEncoder - Web APIs
textencoder.prototype.encode() takes a usvstring as input, and returns a uint8array containing utf-8 encoded text.
... textencoder.prototype.encodeinto() 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.
...in those cases a polyfill might be impractical for large strings.
...And 3 more matches
TrackDefault.TrackDefault() - Web APIs
syntax var trackdefault = new trackdefault(type, language, label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain.
... language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track.
... label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new track.
...And 3 more matches
URLSearchParams - Web APIs
the urlsearchparams interface defines utility methods to work with the query string of a url.
... urlsearchparams.tostring() returns a string containing a query string suitable for use in a url.
... examples var paramsstring = "q=urlutils.searchparams&topic=api"; var searchparams = new urlsearchparams(paramsstring); //iterate the search parameters.
...And 3 more matches
VideoTrack.kind - Web APIs
WebAPIVideoTrackkind
the kind property contains a string indicating the category of video contained in the videotrack.
...see video track kind strings for a list of the kinds available for video tracks.
... syntax var trackkind = videotrack.kind; value a domstring specifying the type of content the media represents.
...And 3 more matches
Using the Web Speech API - Web APIs
speech recognition speech recognition involves receiving speech through a device's microphone, which is then checked by a speech recognition service against a list of grammar (basically, the vocabulary you want to have recognised in a particular app.) when a word or phrase is successfully recognised, it is returned as a result (or list of results) as a text string, and further actions can be initiated as a result.
...public declares that it is a public rule, the string in angle brackets defines the recognised name for this term (color), and the list of items that follow the equals sign are the alternative values that will be recognised and accepted as appropriate values for the term.
... var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); we add our grammar to the list using the speechgrammarlist.addfromstring() method.
...And 3 more matches
Window.prompt() - Web APIs
WebAPIWindowprompt
syntax result = window.prompt(message, default); parameters message optional a string of text to display to the user.
... default optional a string containing the default value displayed in the text input field.
... note that in internet explorer 7 and 8, if you do not provide this parameter, the string "undefined" is the default value.
...And 3 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
this can either be: a usvstring containing the direct url of the resource you want to fetch.
... headers any headers you want to add to your request, contained within a headers object or an object literal with bytestring values.
... body any body that you want to add to your request: this can be a blob, buffersource, formdata, urlsearchparams, usvstring, or readablestream object.
...And 3 more matches
XMLHttpRequest - Web APIs
xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body.
... xmlhttprequest.responsetext read only returns a domstring that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent.
... xmlhttprequest.responseurl read only returns the serialized url of the response or the empty string if the url is null.
...And 3 more matches
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.
... examples serializing xml into a string the first, basic, example just serializes an entire document into a string containing xml.
...And 3 more matches
XSLTProcessor - Web APIs
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 imported.
... (sets the value of an <xsl:param>.) a null value for namespaceuri is treated the same as an empty string.
... [throws] any xsltprocessor.getparameter(string namespaceuri, string localname) gets the value of a parameter from the xslt stylesheet.
...And 3 more matches
Web APIs
WebAPI
stallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthqueuingstrategy bytestring c cdatasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue...
...lue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoi...
...nt dompointinit dompointreadonly domquad domrect domrectreadonly domstring domstringlist domstringmap domtimestamp domtokenlist domuserdata datatransfer datatransferitem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directoryentrysync directoryreadersync displaymediastreamconstraints document documentfragment documentorshadowroot documenttimeline documenttouch documenttype doublerange dragevent dynamicscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_te...
...And 3 more matches
ARIA: listbox role - Accessibility
typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string).
... list a section containing listitem elements states and properties aria-activedescendant holds the id string of the currently active element within the listbox.
... aria-required a boolean attribute which indicates that an option with a non-empty string value must be selected.
...And 3 more matches
Detecting CSS animation support - CSS: Cascading Style Sheets
testing for css animation support this code will check to see if css animation support is available: var animation = false, animationstring = 'animation', keyframeprefix = '', domprefixes = 'webkit moz o ms khtml'.split(' '), pfx = '', elem = document.createelement('div'); if( elem.style.animationname !== undefined ) { animation = true; } if( animation === false ) { for( var i = 0; i < domprefixes.length; i++ ) { if( elem.style[ domprefixes[i] + 'animationname' ] !== undefined ) { pfx = domprefixes[ i ]...
...; animationstring = pfx + 'animation'; keyframeprefix = '-' + pfx.tolowercase() + '-'; animation = true; break; } } } for starters we define a few variables.
...we set the animationstring to animation which is the property we want to set later on.
...And 3 more matches
counters() - CSS: Cascading Style Sheets
WebCSScounters
the counters() css function enables nested counters, returning a concatenated string representing the current values of the named counters, if there are any.
... the counters() function has two forms: 'counters(name, string)' or 'counters(name, string, style)'.
... it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported.
...And 3 more matches
HTML attribute: accept - HTML: Hypertext Markup Language
unique file type specifiers a unique file type specifier is a string that describes a type of file that may be selected by the user in an <input> element of type file.
... a valid mime type string, with no extensions.
... the string audio/* meaning "any audio file".
...And 3 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
value a domstring representing the value of the checkbox.
... events change and input supported common attributes checked idl attributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox.
...in addition to the common attributes shared by all <input> elements, "checkbox" inputs support the following attributes: attribute description checked boolean; if present, the checkbox is toggled on by default indeterminate a boolean which, if present, indicates that the value of the checkbox is indeterminate rather than true or false value the string to use as the value of the checkbox when submitting the form, if the checkbox is currently toggled on checked a boolean attribute indicating whether or not this checkbox is checked by default (when the page loads).
...And 3 more matches
<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.
... if the user hasn't entered anything yet, this value is an empty string ("").
...And 3 more matches
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
value a domstring representing the value contained in the search field.
... value the value attribute contains a domstring representing the value contained in the search field.
... searchterms = mysearch.value; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string ("").
...And 3 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
alignobsolete since html5 a domstring which specifies how the cell's context should be aligned horizontally within the cells in the row; this is shorthand for using align on every cell in the row individually.
... bgcolorobsolete since html5 a domstring specifying a color to apply to the backgrounds of each of the row's cells.
... charobsolete since html5 a domstring which sets the character to align the cells in each of the row's columns on (each row's centering that uses the same character gets aligned with others using the same character .
...And 3 more matches
Equality comparisons and sameness - JavaScript
there are four equality algorithms in es2015: abstract equality comparison (==) strict equality comparison (===): used by array.prototype.indexof, array.prototype.lastindexof, and case-matching samevaluezero: used by %typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript provides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is provides samevalue (new in es2015).
... var num = 0; var obj = new string('0'); var str = '0'; console.log(num === num); // true console.log(obj === obj); // true console.log(str === str); // true console.log(num === obj); // false console.log(num === str); // false console.log(obj === str); // false console.log(null === undefined); // false console.log(obj === null); // false console.log(obj === undefined); // false strict equality is almost always the correct com...
... the equality comparison is performed as follows for operands of the various types: operand b undefined null number string boolean object operand a undefined true true false false false false null true true false false false false number false false a === b a === tonumber(b) a === tonumber(b) a == toprimitive(b) string false false tonumber(a) === b a === b tonumber(a) === tonumber(b) a == toprimitive(b...
...And 3 more matches
Groups and ranges - JavaScript
if you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below).
... string.match() won't return groups if the /.../g flag is set.
... however, you can still use string.matchall() to get all matches.
...And 3 more matches
TypeError: can't assign to property "x" on "y": not an object - JavaScript
the javascript strict mode exception "can't assign to property" occurs when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean.
... in strict_mode, a typeerror is raised when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean.
... the problem might be that an unexpected value is flowing at an unexpected place, or that an object variant of a string or a number is expected.
...And 3 more matches
SyntaxError: JSON.parse: bad parsing - JavaScript
the javascript exceptions thrown by json.parse() occur when string failed to be parsed as json.
... message syntaxerror: json.parse: unterminated string literal syntaxerror: json.parse: bad control character in string literal syntaxerror: json.parse: bad character in string literal syntaxerror: json.parse: bad unicode escape syntaxerror: json.parse: bad escape character syntaxerror: json.parse: unterminated string syntaxerror: json.parse: no number after minus sign syntaxerror: json.parse: unexpected non-digit syntaxerror: json.parse: missing digits after decimal point syntaxerror: json.parse: unterminated fractional number syntaxerror: json.parse: missing digits after exponent indicator syntaxerror: json.parse: missing digits after exponent sign syntaxerror: json.parse: exponent part is missing a number syntaxerror: json.parse: unexpected end of data syntaxerror: json.parse: unexpected key...
... property name when ':' was expected syntaxerror: json.parse: expected ':' after property name in object syntaxerror: json.parse: end of data after property value in object syntaxerror: json.parse: expected ',' or '}' after property value in object syntaxerror: json.parse: expected ',' or '}' after property-value pair in object literal syntaxerror: json.parse: property names must be double-quoted strings syntaxerror: json.parse: expected property name or '}' syntaxerror: json.parse: unexpected character syntaxerror: json.parse: unexpected non-whitespace character after json data syntaxerror: json.parse error: invalid character at position {0} (edge) error type syntaxerror what went wrong?
...And 3 more matches
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.
... message rangeerror: argument out of range (edge) rangeerror: repeat count must be less than infinity and not overflow maximum string size (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
... the string.prototype.repeat() method has been used.
...And 3 more matches
The arguments object - JavaScript
this example function accepts any number of string arguments and returns the longest one: function longeststring() { var longest = ''; for (var i=0; i < arguments.length; i++) { if (arguments[i].length > longest.length) { longest = arguments[i]; } } return longest; } you can use arguments.length to count how many arguments the function was called with.
... examples defining a function that concatenates several strings this example defines a function that concatenates several strings.
... the function's only formal argument is a string containing the characters that separate the items to concatenate.
...And 3 more matches
BigInt64Array - JavaScript
bigint64array.name returns the string value of the constructor name.
... bigint64array.prototype.join() joins all elements of an array into a string.
... bigint64array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
BigUint64Array - JavaScript
biguint64array.name returns the string value of the constructor name.
... biguint64array.prototype.join() joins all elements of an array into a string.
... biguint64array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Boolean - JavaScript
if the value is omitted or is 0, -0, null, false, nan, undefined, or the empty string (""), the object has an initial value of false.
... all other values, including any object, an empty array ([]), or the string "false", create an object with an initial value of true.
... var myfalse = new boolean(false); // initial value of false var g = boolean(myfalse); // initial value of true var mystring = new string('hello'); // string object var s = boolean(mystring); // initial value of true do not use a boolean object in place of a boolean primitive.
...And 3 more matches
Date.prototype[@@toPrimitive] - JavaScript
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.
... if hint is "string" or "default", [@@toprimitive]() tries to call the tostring method.
...And 3 more matches
Float32Array - JavaScript
float32array.name returns the string value of the constructor name.
... float32array.prototype.join() joins all elements of an array into a string.
... float32array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Float64Array - JavaScript
float64array.name returns the string value of the constructor name.
... float64array.prototype.join() joins all elements of an array into a string.
... float64array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Int16Array - JavaScript
int16array.name returns the string value of the constructor name.
... int16array.prototype.join() joins all elements of an array into a string.
... int16array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Int32Array - JavaScript
int32array.name returns the string value of the constructor name.
... int32array.prototype.join() joins all elements of an array into a string.
... int32array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Int8Array - JavaScript
int8array.name returns the string value of the constructor name.
... int8array.prototype.join() joins all elements of an array into a string.
... int8array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Intl.Locale.prototype.caseFirst - JavaScript
description a locale's collation rules are used to determine how strings are ordered in that locale.
... examples setting the casefirst value via the locale string in the unicode locale string spec, the values that casefirst represents correspond to the key kf.
... kf is treated as a locale string "extension subtag".
...And 3 more matches
Intl.Locale - JavaScript
unicode represents locales with a string, called a locale identifier.
... traditionally, the intl api used strings to represent locales, just as unicode does.
... instance properties intl.locale.prototype.basename returns basic, core information about the locale in the form of a substring of the complete data string.
...And 3 more matches
Intl - JavaScript
the intl object is the namespace for the ecmascript internationalization api, which provides language sensitive string comparison, number formatting, and date and time formatting.
... constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison.
... a single locale may be specified by either an intl.locale object or a string that is a unicode bcp 47 locale identifier.
...And 3 more matches
JSON.parse() - JavaScript
the json.parse() method parses a json string, constructing the javascript value or object described by the string.
... syntax json.parse(text[, reviver]) parameters text the string to parse as json.
... return value the object, array, string, number, boolean, or null value corresponding to the given json text.
...And 3 more matches
Object.create() - JavaScript
ifferences quickly become apparent: > "oco is: " + oco // shows "oco is: [object object]" > "ocn is: " + ocn // throws error: cannot convert object to primitive value testing just a few of the many most basic built-in functions shows the magnitude of the problem more clearly: > alert(oco) // shows [object object] > alert(ocn) // throws error: cannot convert object to primitive value > oco.tostring() // shows [object object] > ocn.tostring() // throws error: ocn.tostring is not a function > oco.valueof() // shows {} > ocn.valueof() // throws error: ocn.valueof is not a function > oco.hasownproperty("p") // shows "true" > ocn.hasownproperty("p") // throws error: ocn.hasownproperty is not a function > oco.constructor // shows "object() { [native code] }" > ocn.constructor // shows "undefin...
... 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 = object.create( null ); // create "null" object (same as before) ocn.prototype.tostring = object.tostring; // error: cannot set property 'tostring' of undefined ocn.prototype = {}; // try to create a prototype ocn.prototype.tostring = object.tostring; // since new object lacks method then try assigning it from standard-object > ocn.tostring() // error: ocn.tostring is not a function adding the missing object-method by using the standard-object as new object's prototype does not work either: ocn = object.create( null ); // cr...
...And 3 more matches
Promise.prototype.then() - JavaScript
receive "foo", concatenate "bar" to it, and resolve that to the next then .then(function(string) { return new promise(function(resolve, reject) { settimeout(function() { string += 'bar'; resolve(string); }, 1); }); }) // 2.
... receive "foobar", register a callback function to work on that string // and print it to the console, but not before returning the unworked on // string to the next then .then(function(string) { settimeout(function() { string += 'baz'; console.log(string); // foobarbaz }, 1) return string; }) // 3.
... print helpful messages about how the code in this section will be run // before the string is actually processed by the mocked asynchronous code in the // previous then block.
...And 3 more matches
RegExp.prototype[@@search]() - JavaScript
the [@@search]() method executes a search for a match between a this regular expression and a string.
... syntax regexp[symbol.search](str) parameters str a string that is a target of the search.
... return value integer if successful, [@@search]() returns the index of the first match of the regular expression inside the string.
...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.
... return value an array containing substrings as its elements.
...And 3 more matches
RegExp() constructor - JavaScript
patterns may include special characters to match a wider range of values than would a literal string.
... flags if specified, flags is a string that contains the flags to add.
... alternatively, if an object is supplied for the pattern, the flags string will replace any of that object's flags (and lastindex will be reset to 0) (as of es2015).
...And 3 more matches
RegExpInstance.lastIndex - JavaScript
the following rules apply: if lastindex is greater than the length of the string, test() and exec() fail, then lastindex is set to 0.
... if lastindex is equal to or less than the length of the string and if the regular expression matches the empty string, then the regular expression matches input starting from lastindex.
... if lastindex is equal to the length of the string and if the regular expression does not match the empty string, then the regular expression mismatches input, and lastindex is reset to 0.
...And 3 more matches
RegExp.$1-$9 - JavaScript
the legacy regexp $1, $2, $3, $4, $5, $6, $7, $8, $9 properties are static and read-only properties of regular expressions that contain parenthesized substring matches.
... the number of possible parenthesized substrings is unlimited, but the regexp object can only hold the first nine.
... you can access all parenthesized substrings through the returned array's indexes.
...And 3 more matches
TypedArray - JavaScript
typedarray.name returns the string value of the constructor name (e.g, "int8array").
... typedarray.prototype.join() joins all elements of an array into a string.
... typedarray.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Uint16Array - JavaScript
uint16array.name returns the string value of the constructor name.
... uint16array.prototype.join() joins all elements of an array into a string.
... uint16array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Uint32Array - JavaScript
uint32array.name returns the string value of the constructor name.
... uint32array.prototype.join() joins all elements of an array into a string.
... uint32array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Uint8Array - JavaScript
uint8array.name returns the string value of the constructor name.
... uint8array.prototype.join() joins all elements of an array into a string.
... uint8array.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
Uint8ClampedArray - JavaScript
uint8clampedarray.name returns the string value of the constructor name.
... uint8clampedarray.prototype.join() joins all elements of an array into a string.
... uint8clampedarray.prototype.tolocalestring() returns a localized string representing the array and its elements.
...And 3 more matches
parseFloat() - JavaScript
the parsefloat() function parses an argument (converting it to a string first if needed) and returns a floating point number.
... syntax parsefloat(string) parameters string the value to parse.
... if this argument is not a string, then it is converted to one using the tostring abstract operation.
...And 3 more matches
Equality (==) - JavaScript
if the operands are of different types, try to convert them to the same type before comparing: when comparing a number to a string, try to convert the string to a numeric value.
... 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.
... if the operands have the same type, they are compared as follows: string: return true only if both operands have the same characters in the same order.
...And 3 more matches
Property accessors - JavaScript
=== 77.0, no ambiguity bracket notation in the object[property_name] syntax, the property_name is just a string or symbol.
... so, it can be any string, including '1foo', '!bar!', or even ' ' (a space).
... document ['createelement']('pre') property names property names are string or symbol.
...And 3 more matches
d - SVG: Scalable Vector Graphics
WebSVGAttributed
three elements have this attribute: <path>, <glyph>, and <missing-glyph> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </svg> path for <path>, d is a string containing a series of path commands that define the path to be drawn.
... value <string> default value none animatable yes glyph warning: as of svg2 <glyph> is deprecated and shouldn't be used.
... for <glyph>, d is a string containing a series of path commands that define the outline shape of the glyph.
...And 3 more matches
text-anchor - SVG: Scalable Vector Graphics
the text-anchor attribute is used to align (start-, middle- or end-alignment) a string of pre-formatted text or auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point.
...rcle cx="60" cy="75" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text { font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> usage notes default value start value start | middle | end animatable yes start the rendered characters are aligned such that the start of the text string is at the initial current text position.
... middle the rendered characters are aligned such that the middle of the text string is at the current text position.
...And 3 more matches
Introduction to using XPath in JavaScript - XPath
var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, resulttype, result ); parameters the evaluate function takes a total of five parameters: xpathexpression: a string containing the xpath expression to be evaluated.
... namespaceresolver: a function that will be passed any namespace prefixes contained within xpathexpression which returns a string representing the namespace uri associated with that prefix.
... simple types when the desired result type in resulttype is specified as either: number_type - a double string_type - a string boolean_type - a boolean we obtain the returned value of the expression by accessing the following properties respectively of the xpathresult object.
...And 3 more matches
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function.
... syntax <xsl:decimal-format name=name decimal-separator=character grouping-separator=character infinity=string minus-sign=character nan=string percent=character per-mille=charater zero-digit=character digit=character pattern-separator=character /> required attributes none.
... infinity specifies the string used to represent infinity.
...And 3 more matches
base64 - Archive of obsolete content
var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data.
... parameters data : string the data to encode charset : string the charset of the string to encode (optional).
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding.
...And 2 more matches
notifications - Archive of obsolete content
when the message is clicked, a string is logged to the console.
... parameters options : object optional options: name type title string a string to display as the message's title.
... text string a string to display as the body of the message.
...And 2 more matches
dev/panel - Archive of obsolete content
name type description label string the string to display in the toolbox toolbar.
... mandatory icon string the icon to display in the toolbox toolbar, specified as a resource:// url pointing to an icon file, typically in your add-on's "data" directory.
... mandatory url string a resource:// url pointing to an html file, typically in your add-on's "data" directory.
...And 2 more matches
io/byte-streams - Archive of obsolete content
read(numbytes) reads a string from the stream.
... returns string : a string containing the bytes read.
... if the stream is at the end, returns the empty string.
...And 2 more matches
places/bookmarks - Archive of obsolete content
parameters options : object required options: name type title string the title for the bookmark.
... url string the url for the bookmark.
... parameters options : object required options: name type title string the title for the group.
...And 2 more matches
platform/xpcom - Archive of obsolete content
optional options: name type contract string a contract id.
... id string a class id.
... parameters path : string path to a component file to be registered or a directory containing component files to be registered.
...And 2 more matches
ui/toolbar - Archive of obsolete content
me = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame], hidden: true, onshow: showing, onhide: hiding }); function showing(e) { console.log("showing"); console.log(e); } function hiding(e) { console.log("hiding"); console.log(e); } parameters options : object required options: name type title string the toolbar's title.
...lbar } = 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(e) { console.log("hiding: " + e.title); } parameters event : string the name of the event to listen to.
... } = 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.once("show", showing); toolbar.once("hide", hiding); function showing(e) { console.log("showing: " + e.title); } function hiding(e) { console.log("hiding: " + e.title); } parameters event : string the name of the event to listen to.
...And 2 more matches
Add a Context Menu Item - Archive of obsolete content
when it's clicked, the selection is sent to the main add-on code, which just logs it: var contextmenu = require("sdk/context-menu"); var menuitem = contextmenu.item({ label: "log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', onmessage: function (selectiontext) { console.log(selectiontext); } }); try it: run the add-on, load a web page, select some text and right-click.
... label the label is just the string that's displayed.
...ically you'd store the image in your add-on's "data" directory, and construct the url using self.data.url(): var self = require("sdk/self"); var contextmenu = require("sdk/context-menu"); var menuitem = contextmenu.item({ label: "log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', image: self.data.url("icon-16.png"), onmessage: function (selectiontext) { console.log(selectiontext); } }); adding an access key new in firefox 35.
...And 2 more matches
HTML to DOM - Archive of obsolete content
safely parsing simple html to dom when using xmlhttprequest to get the html of a remote webpage, it is often advantageous to turn that html string into dom for easier manipulation.
... function htmlparser(ahtmlstring){ var html = document.implementation.createdocument("http://www.w3.org/1999/xhtml", "html", null), body = document.createelementns("http://www.w3.org/1999/xhtml", "body"); html.documentelement.appendchild(body); body.appendchild(components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(ahtmlstring, false, ...
...the returned <body> object is of type element here is a sample that counts the number of paragraphs in a string: var dompars = htmlparser('<p>foo</p><p>bar</p>'); alert(dompars.getelementsbytagname('p').length); if htmlparser() returns the element name html (instead of body), you have all document object with its complete functions list, therefore you can retrieve info within div tag like this: var dompars = htmlparser("<div id='userinfo'>john was a mediocre programmer, but people liked him <strong>anyway</strong...
...And 2 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
chromium-like messaging: json request with json callback web page: <html> <head> <script> var something = { send_request: function(data, callback) { // analogue of chrome.extension.sendrequest var request = document.createtextnode(json.stringify(data)); request.addeventlistener("something-response", function(event) { request.parentnode.removechild(request); if (callback) { var response = json.parse(request.nodevalue); callback(response); } }, false); document.head.appendchild(request); var event = document.createevent("htmlevent...
... = { listen_request: function(callback) { // analogue of chrome.extension.onrequest.addlistener document.addeventlistener("something-query", function(event) { var node = event.target; if (!node || node.nodetype != node.text_node) return; var doc = node.ownerdocument; callback(json.parse(node.nodevalue), doc, function(response) { node.nodevalue = json.stringify(response); var event = doc.createevent("htmlevents"); event.initevent("something-response", true, false); return node.dispatchevent(event); }); }, false, true); }, callback: function(request, sender, callback) { if (request.foo) { return settimeout(function() { callback({bar: 2}); }, 1000); } if (request.baz) { return...
... settimeout(function() { callback({quux: 4}); }, 3000); } if (request.mozilla) { return alert("alert in chrome"); } return callback(null); } } something.listen_request(something.callback); message passing in chromium sending structured data the above mechanisms use element attributes and are thus only strings.
...And 2 more matches
The Box Model - Archive of obsolete content
you always have to keep in mind that localized strings may be significantly longer in other languages, specially much longer than english strings.
... never cut text lines into separate locale strings in order to bypass wrapping difficulties.
...one possibility is to use special markup in a locale property so that the link can be easily recognized: xulschoolhello.linkedtext.label = go to <a>our site</a> for more information the syntax is similar to html because it's easier to read this way, but string bundles won't do anything special with it.
...And 2 more matches
Promises - Archive of obsolete content
let info = yield os.file.stat(configpath); if (info.lastmodificationdate <= timestamp) return; timestamp = info.lastmodificationdate; // read the file as a utf-8 string, parse as json.
... config.indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api.
... * * @param {string} the basename of the file.
...And 2 more matches
MMgc - Archive of obsolete content
for instance, the avmplus::string class in avm+ is a rcobject.
... strings are created very frequently, and are often temporary objects with very short lifetimes.
...class myunmanagedclass { // myunmanagedclass is not a gcobject, and // avmplus::stringp is a rcobject, so use drc drc(stringp) mystring; }; drcwb drcwb stands for deferred reference counted, with write barrier.
...And 2 more matches
Clipboard - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
...if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...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.
...And 2 more matches
Clipboard - Archive of obsolete content
jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
...if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type.
...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.
...And 2 more matches
File object - Archive of obsolete content
description filenames are specified as strings that have an implementation defined format.
... examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url.
... file.type a string specifying the type of data or encoding contained in the file.
...And 2 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
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.
... a string representing the four digit version of the software.
... caveat: certain versions of mozilla-based browsers (such as netscape 6.x) treat the use of the equals character ("=") as an illegal token and thus do not allow invocation of initinstall with strings containing "=".
...And 2 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...
... version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517".
... xpisourcepath a string specifying the location of the directory within the xpi file.an empty string ("") causes the creation of a subdirectory node in the registry without actually unpacking any files, which may be useful when you are updating a package that contains subcomponents that could also be updated separately.
...And 2 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.
... version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517".
...And 2 more matches
findbar - Archive of obsolete content
tributes 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.
... findnextaccesskey type: string the access key for the "find next" toolbar button in the findbar.
... findpreviousaccesskey type: string the access key for the "find previous" toolbar button in the findbar.
...And 2 more matches
Tree Box Objects - Archive of obsolete content
example 2 : source view <script> function updatefields(event){ var row = {}, column = {}, part = {}; var tree = document.getelementbyid("thetree"); var boxobject = tree.boxobject; boxobject.queryinterface(components.interfaces.nsitreeboxobject); boxobject.getcellat(event.clientx, event.clienty, row, column, part); if (column.value && typeof column.value != "string") column.value = column.value.id; document.getelementbyid("row").value = row.value; document.getelementbyid("column").value = column.value; document.getelementbyid("part").value = part.value; } </script> <tree id="thetree" flex="1" onmousemove="updatefields(event);"> <treecols> <treecol id="utensil" label="utensil" primary="true" flex="1"/> <treecol id="count" label="count" ...
...in earlier versions, columns are identified with a string, the id of the column.
... if (column.value && typeof column.value != "string") { column.value = column.value.id; } if the column is a string, we are running on mozilla 1.7 or earlier, but for later versions we get the column id from the column object.
...And 2 more matches
Using the Editor from XUL - Archive of obsolete content
in response to the handletext event, the editor sets the inline input composition string.
... nshtmleditor::editorkeypress() gets the character code from the key event, puts that into a string, and calls nshtmleditor::typedtext(), which simply calls nshtmleditor::inserttext().
... now, we initialize a nstextrulesinfo with the information about the string being inserted, and call willdoaction() on the current editing rules.
...And 2 more matches
browser - Archive of obsolete content
droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface homepage type: url this attribute allows you to set a homepage for the browser element.
... contenttitle type: string this read-only property contains the title of the document object in the browser.
... homepage type: string home page url this property holds the value of the user's home page setting.
...And 2 more matches
colorpicker - Archive of obsolete content
color type: color string the currently selected color.
...you can assign a string of the form #rrggbb to this property to change the selected color.
... type type: string if this attribute is not present, the colorpicker is displayed inside the window.
...And 2 more matches
richlistitem - Archive of obsolete content
searchlabel type: string text used for 'find-as-you-type' (fayt) searching.
... value type: string the string attribute allows you to associate a data value with an element.
... label type: string gets the concatentation of text from any child label elements.
...And 2 more matches
timepicker - Archive of obsolete content
the former specifies the time as a string of the form hh:mm:ss whereas the latter specifies the time as a date object.
... value type: string the initial value of the timepicker in either the form hh:mm:ss or hh:mm.
... properties amindicator type: string the string value displayed for hours between midnight and noon, defaulting to am.
...And 2 more matches
wizardpage - Archive of obsolete content
attributes description, label, next, pageid properties next, pageid attributes description type: string descriptive text to appear in addition to the dialog title.
... label type: string the label that will appear on the element.
... pageid type: id this attribute should be set to a string that identifies the page's identifer in the wizard.
...And 2 more matches
Error.description - Archive of obsolete content
the error.description property returns or sets the descriptive string associated with a specific error.
... syntax object .description [= stringexpression] parameters object required.
... stringexpression optional.
...And 2 more matches
Old Proxy API - Archive of obsolete content
object.getownpropertynames(proxy) getownpropertynames: function() -> strings array return an array of all own (non-inherited) property names of the emulated object.
... object.getpropertynames(proxy) getpropertynames: function() -> strings array this function doesn't exist in ecmascript 5.
... for(prop in proxy){...} enumerate: function() -> string array function() { return this.getpropertynames().filter( function (name) { return this.getpropertydescriptor(name).enumerable } ); } from the proxy user point of view, properties appear in the for..in loop in the same order as they are in the returned array.
...And 2 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
the appropriate database driver for mysql is loaded and the connection string to a database named rhino on my local machine is configured using the user account urhino with the password of prhino.
...after the asset is retrieved and stored in a string, the proper namespaces are defined for this particular resource.
...e: " + message + "<br/><br/>"; } else { ext.msg.alert( "error", "please enter the required fields" ); } } </script> <!-- processes the form contents --> <script runat="server"> function formprocessor( name, email, message ) { // perform the same validation of the data server-side if( !validatecomments( name, email, message ) ) { throw "incomplete data was submitted."; } // assemble the string var s = "name: " + name + "<br/>" + "email: " + email + "<br/>" + "message: " + message + "<br/><br/>"; // append the entry to the log file jaxer.file.append( "dump.txt", s ); } formprocessor.proxy = true; </script> the first function, formhandler, performs some first-level validation using the validatecomments function.
...And 2 more matches
Writing JavaScript for XHTML - Archive of obsolete content
there are reasons why this decision was made, one being that a string of invalid markup will instantly break the whole document.
... of course, you can still use strings like in document.write(), but it takes a little more effort.
... for example: var string = '<div xmlns="http://www.w3.org/999/xhtml"><h1>hello world!</h1></div>'; var parser = new domparser(); var documentfragment = parser.parsefromstring(string, "text/xml"); body.appendchild(documentfragment); // assuming 'body' is the body element but be aware that if your string is not well-formed xml (e.g., you have an & where it should not be), then this method will crash, leaving you with a parser error.
...And 2 more matches
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
along with each request they make to the server, browsers include a self-identifying user-agent http header called a user agent (ua) string.
... this string often identifies the browser, its version number, and its host operating system.
... spam bots, download managers, and some browsers often send a fake ua string to announce themselves as a different client.
...And 2 more matches
Attribute selectors - Learn web development
[attr=value] a[href="https://example.com"] matches elements with an attr attribute whose value is exactly value — the string inside the quotes.
... substring matching selectors these selectors allow for more advanced matching of substrings inside the value of your attribute.
... for example, if you had classes of box-warning and box-error and wanted to match everything that started with the string "box-", you could use [class^="box-"] to select them both (or [class|="box"] as described in section above).
...And 2 more matches
CSS values and units - Learn web development
strings and identifiers throughout the examples above, we've seen places where keywords are used as a value (for example <color> keywords like red, black, rebeccapurple, and goldenrod).
...as such they are not quoted — they are not treated as strings.
... there are places where you use strings in css, for example when specifying generated content.
...And 2 more matches
HTML text fundamentals - Learn web development
key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
...key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
...key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
...And 2 more matches
Basic math in JavaScript — numbers and operators - Learn web development
type the following lines into your browser's console: let lotsofdecimal = 1.766584958675746364; lotsofdecimal; let twodecimalplaces = lotsofdecimal.tofixed(2); twodecimalplaces; converting to number data types sometimes you might end up with a number that is stored as a string type, which makes it difficult to perform calculations with it.
...there is a way to solve this problem — passing the string value into the number() constructor to return a number version of the same value.
... for example, try typing these lines into your console: let mynumber = '74'; mynumber + 3; you end up with the result 743, not 77, because mynumber is actually defined as a string.
...And 2 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
have a look at line 78, and you'll see the following code: loworhi.textcontent = 'last guess was too high!'; this line is trying to set the textcontent property of the loworhi constant to a text string, but it's not working because loworhi does not contain what it's supposed to.
... syntaxerror: expected expression, got 'string' or syntaxerror: unterminated string literal these errors generally mean that you've left off a string value's opening or closing quote mark.
... in the first error above, string would be replaced with the unexpected character(s) that the browser found instead of a quote mark at the start of a string.
...And 2 more matches
React interactivity: Events and state - Learn web development
<input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" value={name} /> change "use hooks!" to an empty string once you're done; this is what we want for our initial state.
...as a matter of good practice, you should clear the input after your form submits, so we'll call setname() again with an empty string to do so: function handlesubmit(e) { e.preventdefault(); props.addtask(name); setname(""); } at last, you can type something into the input field in your browser and click add — whatever you typed will appear in an alert dialog.
...there’s one problem however: we can’t just pass the name argument of addtask() into settasks, because tasks is an array of objects and name is a string.
...And 2 more matches
Introduction to automated testing - Learn web development
ontents: const request = require("request"); let bsuser = "browserstack_username"; let bskey = "browserstack_access_key"; let baseurl = "https://" + bsuser + ":" + bskey + "@www.browserstack.com/automate/"; function getplandetails(){ request({uri: baseurl + "plan.json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: { automate_plan: <string>, parallel_sessions_running: <int>, team_parallel_sessions_max_allowed: <int>, parallel_sessions_max_allowed: <int>, queued_sessions: <int>, queued_sessions_max_allowed: <int> } */ } getplandetails(); you'll need to fill in your browserstack username and api key in the indicated places.
... function getbuilds(){ request({uri: baseurl + "builds.json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: [ { automation_build: { name: <string>, duration: <int>, status: <string>, hashed_id: <string> } }, { automation_build: { name: <string>, duration: <int>, status: <string>, hashed_id: <string> } }, ...
... ] */ }; function getsessionsinbuild(build){ let buildid = build.automation_build.hashed_id; request({uri: baseurl + "builds/" + buildid + "/sessions.json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: [ { automation_session: { name: <string>, duration: <int>, os: <string>, os_version: <string>, browser_version: <string>, browser: <string>, device: <string>, status: <string>, hashed_id: <string>, reason: <string>, build_name: <string>, project_name: <string>, logs: <string>, browser_url: <string>, public_url: <string>, video_url: <string>, browser_console_logs_url: <string>, har_logs_url: <string> } }, { automation_session: { name: <string>, duration: <int>, ...
...And 2 more matches
Creating JavaScript callbacks in components
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.
... here is an example of how to use the callback system: var wordhandler = { onword : function(word) { alert(word); } }; var stringparser = /* get a reference to the parser somehow */ stringparser.addobserver(wordhandler); stringparser.parse("pay no attention to the man behind the curtain"); you can find examples of this pattern all over the mozilla codebase.
...remember (or discover) that addeventlistener is a method of the nsidomeventtarget interface and is defined as such: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is extremely common to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible...
...And 2 more matches
Commenting IDL for better documentation
*/ readonly attribute astring name; /** * the cookie monster's favorite kind of cookie.
... */ void eatcookie(in nsicookie cookietoeat); /** * sings the song "c is for cookie." */ void sing(); /** * returns a string containing a funny quote the cookie monster might say.
... * * @returns an astring containing the requested funny quote.
...And 2 more matches
Error codes returned by Mozilla APIs
ns_base_stream_illegal_args (0x80470004) ns_base_stream_no_converter (0x80470005) ns_base_stream_bad_conversion (0x80470006) this error occurs when the component nsistringbundleservice has been set with a badly encoded property file.
...see nsistringbundle.
... ns_error_dom_domstring_size_err (0x80530002) an attempt was made to create a string larger than is supported.
...And 2 more matches
mozbrowsermetachange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: name a domstring representing the <meta> name attribute value.
... content a domstring representing the <meta> content attribute value, i.e.
...And 2 more matches
AddonInstall
method overview void install() void cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed.
... version string the version of the add-on being installed.
... iconurl string the icon of the add-on being installed.
...And 2 more matches
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 string the url of t...
... string getrecommendedurl(); parameters none.
... string getsearchurl( in string searchterms ); parameters searchterms search terms used to search the repository.
...And 2 more matches
Index
this page is to help explain how to localize these strings so that the correct plural form is shown to the user.
... 10 localization notes guide, internationalization, localization, mozilla localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too.
...this tutorial will walk you through the steps you need to take to translation strings within an xliff file.
...And 2 more matches
Writing localizable code
if you change the semantics of a localized string, change the key.
... try not to assume grammar in composite strings splitting sentences into several keys often inadvertently presumes a grammar, a sentence structure, and such composite strings are often very difficult to translate.
... when a composite string is needed, try to give the translators "room to move".
...And 2 more matches
Anonymous Shared Memory
in the second protocol, the parent process is responsible for creating the child process; the parent and child are mutually responsible for passing a filemap string.
...pr_memunmap(addr); pr_closefilemap(fm); second protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); fmstring = pr_exportfilemapasstring( fm ); addr = pr_memmap(fm); ...
... application specific technique to pass fmstring to child ...
...And 2 more matches
PR_GetUniqueIdentity
syntax #include <prio.h> prdescidentity pr_getuniqueidentity(const char *layer_name); parameter the function has the following parameter: layer_name the string associated with the creation of a layer's identity.
... returns the function returns one of the following values: if successful, the prdescidentity for the layer associated with the string specified in the layer named layer_name.
... description a string may be associated with a layer when the layer is created.
...And 2 more matches
NSS API Guidelines
cvs id each file should include a cvs id string for identification.
... the preferred format is: "@(#) $rcsfile: nss-guidelines.html, v $ $revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$" you can put the string in a comment or in a static char array.
...the advantage of using an array is that you can use strings(1) to pull the id tags out of a (debug) compiled library.
...And 2 more matches
Enc Dec MAC Output Public Key as CSR
ns_certreq_header "-----begin new certificate request-----" #define ns_certreq_trailer "-----end new certificate request-----" typedef enum { gen_csr, encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6 } headertype; /* this is conditionalized because port_errortostring was introduced with nss 3.13.
... * though pr_errortostring was available, support for it in nss wasn't.
... */ #ifndef port_errortostring #ifndef sec_error_base #define sec_error_base (-0x2000) #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif #endif /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -s -r -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'g' for generating rsa keypair for wrapping\n\n", "g"); fprintf(stderr, "%-20s specify 'e' for encrypt operation\n\n", "e"); fprintf(stderr, "%-20s specify 'd' for decrypt operation\n\n", "d"); ...
...And 2 more matches
NSS functions
er cert_decodedercrlwithflags mxr 3.6 and later cert_decodegeneralname mxr 3.4 and later cert_decodenameconstraintsextension mxr 3.10 and later cert_decodeocspresponse mxr 3.6 and later cert_decodeoidsequence mxr 3.2 and later cert_decodeprivkeyusageperiodextension mxr 3.10 and later cert_decodetruststring mxr 3.4 and later cert_decodeusernotice mxr 3.2 and later cert_dernametoascii mxr 3.4 and later cert_destroycertarray mxr 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destro...
...ess mxr 3.7 and later cert_getlocalityname mxr 3.2 and later cert_getnextemailaddress mxr 3.7 and later cert_getnextgeneralname mxr 3.10 and later cert_getnextnameconstraint mxr 3.10 and later cert_getocspresponsestatus mxr 3.6 and later cert_getocspstatusforcertid mxr 3.6 and later cert_getoidstring mxr 3.9 and later cert_getorgname mxr 3.2 and later cert_getorgunitname mxr 3.2 and later cert_getocspauthorityinfoaccesslocation mxr 3.4 and later cert_getpkixverifynistrevocationpolicy mxr 3.12 and later cert_getprevgeneralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later ...
... and later cert_isusercert mxr 3.6 and later cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsl...
...And 2 more matches
NSS tools : certutil
bracket the issuer string with quotation marks if it contains spaces.
...bracket the nickname string with quotation marks if it contains spaces.
...bracket the output-file string with quotation marks if it contains spaces.
...And 2 more matches
NSS tools : crlutil
to see a usage string, issue the command without options, or with the -h option.
...bracket the nickname string with quotation marks if it contains spaces.
...bracket the output-file string with quotation marks if it contains spaces.
...And 2 more matches
NSS_3.12.3_release_notes.html
nss_hash_alg_support string specifies algorithms allowed to be used in certain applications, such as in signatures on certificates and crls.
... nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process before it has been initialized in that process, even if the module was initialized in the parent process.
...the new key point format is a der encoded asn.1 octet string.
...And 2 more matches
NSS Tools crlutil
to see a usage string, issue the command without options, or with the -h option.
...bracket the nickname string with quotation marks if it contains spaces.
...bracket the output-file string with quotation marks if it contains spaces.
...And 2 more matches
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
to see a usage string, issue the command without options, or with the -h option.
...bracket the nickname string with quotation marks if it contains spaces.
...bracket the output-file string with quotation marks if it contains spaces.
...And 2 more matches
GC Rooting Guide
the main types of gc thing pointer are: js::value jsobject* jsstring* jsscript* jsid note that js::value and jsid can contain pointers internally even though they are not a normal pointer type, hence their inclusion in this list.
...within spidermonkey, it is suggested that these are used in preference to the template class (gecko uses the template versions): template class typedef js::rooted<js::value> js::rootedvalue js::rooted<jsobject*> js::rootedobject js::rooted<jsstring*> 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 ap...
... similarly to js::rooted<t>, there are typedefs available for the main types: template class typedef js::handle<js::value> js::handlevalue js::handle<jsobject*> js::handleobject js::handle<jsstring*> js::handlestring js::handle<jsscript*> js::handlescript js::handle<jsid> js::handleid you should use js::handle<t> for all function parameters taking gc thing pointers (except out-parameters, which are described below).
...And 2 more matches
How to embed the JavaScript engine
r jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; bool ok = js_evaluatescript(cx, global, script, strlen(script), filename, lineno, rval.address()); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return 0; } spidermonkey 31 // following code might be needed in some case // #define __stdc_limit_macros // #include <stdint.h> #include "jsapi.h" /* the class of the global object.
... scope for jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; bool ok = js_evaluatescript(cx, global, script, strlen(script), filename, lineno, &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return 0; } spidermonkey 38 // following code might be needed in some case // #define __stdc_limit_macros // #include <stdint.h> #include "jsapi.h" /* the class of the global object.
...l); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; js::compileoptions opts(cx); opts.setfileandline(filename, lineno); bool ok = js::evaluate(cx, global, opts, script, strlen(script), &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return 0; } spidermonkey 45 // following code might be needed in some case // #define __stdc_limit_macros // #include <stdint.h> #include "jsapi.h" #include "js/initialization.h" /* the class of the global object.
...And 2 more matches
JS::CompileFunction
this article covers features introduced in spidermonkey 17 create a javascript function from a text string.
... chars const char16_t * string containing the body of the function to compile.
... bytes const char * string containing the body of the function to compile.
...And 2 more matches
JS::CreateError
syntax // added in spidermonkey 45 bool js::createerror(jscontext *cx, jsexntype type, handleobject stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); // obsolete since jsapi 39 bool js::createerror(jscontext *cx, jsexntype type, handlestring stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... stack js::handlestring or js::handleobject the value of error.prototype.stack.
... filename js::handlestring the value of error.prototype.filename.
...And 2 more matches
JS::Value
a c++ variable of type js::value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined.
...eanvalue(bool), js::truevalue(), js::falsevalue() val.toboolean() val.setboolean(bool) number val.isint32(), val.isdouble(), val.isnumber() js::numbervalue(any number type), js::int32value(int32_t), js::doublevalue(double), js::float32value(float) val.toint32(), val.todouble(), val.tonumber() val.setint32(int32_t), val.setnumber(uint32_t), val.setnumber(double) string val.isstring() js::stringvalue(jsstring*) val.tostring() val.setstring(jsstring *) object val.isobject() js::objectvalue(jsobject&amp;), js::objectornullvalue(jsobject*) val.toobject() val.setobject(jsobject &) symbol val.issymbol() js::symbolvalue(js::symbol*) val.tosymbol() val.setsymbol(js::symbol &) numbers are stored in a js::value...
... 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 2 more matches
JS_CompileFunctionForPrincipals
create a security-enabled js function from a text string.
... body const char * or const jschar * string containing the source code of the function to compile.
... description js_compilefunctionforprincipals compiles a security-enabled function from a text string, bytes, and associates it with a js object, obj.
...And 2 more matches
JS_GetFunctionId
get a function's name as a jsstring.
... syntax jsstring * js_getfunctionid(jsfunction *fun); jsstring * js_getfunctiondisplayid(jsfunction *fun); // added in spidermonkey 17 name type description fun jsfunction * a javascript function.
... description js_getfunctionid returns the name of a function, fun, as a jsstring, or null if fun is unnamed.
...And 2 more matches
JS_GetRegExpSource
this article covers features introduced in spidermonkey 17 get the source string of the given regexp object.
... syntax jsstring * js_getregexpsource(jscontext *cx, js::handleobject obj); name type description cx jscontext * a context.
... obj js::handleobject the object to get the source string.
...And 2 more matches
JS_IsIdentifier
this article covers features introduced in spidermonkey 17 test whether the given string is a valid ecmascript identifier.
... syntax bool js_isidentifier(jscontext *cx, js::handlestring str, bool *isidentifier); bool js_isidentifier(const char16_t *chars, size_t length); // added in spidermonkey 38 name type description cx jscontext * pointer to a js context from which to derive runtime information.
... str js::handlestring the string to test.
...And 2 more matches
Gecko object attributes
this is in contrast to text attributes, which apply only to substrings in a text object.
... applied to: any role xml-roles if a dynamic content accessibility role string is used, it is exposed here.
...the role string may be a space-delimited list of roles.
...And 2 more matches
Places Developer Guide
accessing bookmarks and related items accessing item properties for all items: string getitemtitle(aitemid) - returns an item's title int64 getitemindex(aitemid) - returns an item's position in it's parent folder prtime getitemtype(aitemid) - returns the type of an item (bookmark, folder, separator) prtime getitemdateadded(aitemid) - returns the time in microseconds that an item was added prtime getitemlastmodified(aitemid) - returns the time in microseconds that an item w...
... string getitemguid(aitemid) obsolete since gecko 14.0 - returns a globally unique identifier for the item.
... for bookmarks: nsiuri getbookmarkuri(aitemid) - returns the uri of a bookmark item string getkeywordforbookmark(aitemid) - returns a bookmark's keyword, or null for folders: int64 getchildfolder(afolderid, asubfoldertitle) - returns the id of the first subfolder matching the given title.
...And 2 more matches
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.
... boolean has(in astring aname) parameters aname the name of preference return value true if the preference exists, false if not get() gets an object representing a preference extipreference get(in astring aname) parameters aname the name of preference return value a preference object, or null if the preference does not exist getvalue() gets the value of a preference.
... nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) parameters aname the name of a preference adefaultvalue the default value of a preference.
...And 2 more matches
Building the WebLock UI
the url that the addsite method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid url.
... in this tutorial, focusing as it is on the weblock functionality (rather than the ui), we'll assume the strings we get from the ui itself are urls we actually want to write to the white list: function addthissite() { var tf = document.getelementbyid("dialog.input"); // weblock is global and declared above weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the input string is retrieved as the value property of the textbox element.
...in this part of the tutorial, however, we only provide the means of adding an url provided as a string (which is not checked for validity) and passing it through to the addsite api we defined in the earlier part of the tutorial.
...And 2 more matches
Making cross-thread calls using runnables
for example, let's say we have a function, calculatepi(int digits), which will calculate π to an arbitrary number of digits: void calculatepi(int digits, nscstring& result); // this is synchronous this can take a while, so we don't want to run this on the main thread.
...so we declare an asynchronous version of the same function: typedef void (*picallback)(const nscstring& result); // callback function void calculatepiasynchronously(int digits, picallback callback); creating a runnable nsrunnable is a helper class: it already implements threadsafe refcounting, so all you need to do is override the run() function.
...#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!
...And 2 more matches
Components.utils.Sandbox
specify the system principal, you can create it using code like: cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); content principal you can specify a content principal for a particular origin in one of three ways: as an nsiprincipal, for example by using the nodeprincipal property of a dom node as an nsidomwindow, such as that returned by the dom window property as a string uri like "http://www.example.com/" (discouraged) when possible, specify a window or an nsiprincipal object instead of using a string uri.
... sandboxname a string value which identifies the sandbox in about:memory (and possibly other places in the future).
... wantglobalproperties an array of strings.
...And 2 more matches
Components.utils.importGlobalProperties
this function is passed an array of strings.
... each string is the name of an object to import, and will be defined on the importing scope's global.
... the following strings are supported: string/object xpcom component atob blob btoa crypto css fetch file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams xmlhttprequest nsixmlhttprequest obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly known since when it was available, however it is guranteed available from firefox 28 and up.
...And 2 more matches
Append
« xpcom api reference summary the append family of functions appends a value to the end of a string's internal buffer.
... void append( const self_type& astring ); parameters astring [in] a nsacstring to append to this string.
... void append( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
...And 2 more matches
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
... void assign( const self_type& astring ); parameters astring [in] a nsacstring to copy into this string.
... void assign( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string.
...And 2 more matches
Append
« xpcom api reference summary the append family of functions appends a value to the end of a string's internal buffer.
... void append( const self_type& astring ); parameters astring [in] a nsastring to append to this string.
... void append( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
...And 2 more matches
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
... void assign( const self_type& astring ); parameters astring [in] a nsastring to copy into this string.
... void assign( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string.
...And 2 more matches
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.
... jsval loadsubscript( in string url, in object targetobj optional, in string charset optional, ); example let context = {}; services.scriptloader.loadsubscript("chrome://my-package/content/foo-script.js", context, "utf-8" /* the script's encoding */); parameters url the url pointing to the script to load.
... charset an optional string to specify the character encoding of the file.
...And 2 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.
...nsifile backupdatabasefile( in nsifile adbfile, in astring abackupfilename, in nsifile abackupparentdirectory optional ); parameters adbfile the database file to back up.
...the sqlite code uses a simple string comparison to see if there is already a connection.
...And 2 more matches
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 acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a node that is unattached from the accessible tree will res...
...obsolete since gecko 2.0 innerhtml domstring the innerhtml for the dom node this is a text string of all the markup inside the dom node, not including the start and end tag for the node.
... language domstring the language for the current dom node, for example en, de, and so on.
...And 2 more matches
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.
...void onitemannotationremoved( in long long aitemid, in autf8string aname ); parameters aitemid the item whose annotation is to be deleted.
...void onitemannotationset( in long long aitemid, in autf8string aname ); parameters aitemid the item on which the annotation is to be set.
...And 2 more matches
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, in wstring passwordrealm, in pruint32 savep...
...assword, inout wstring user, inout wstring pwd); constants constant value description save_password_never 0 never saves the password.
... boolean prompt( in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword, in wstring defaulttext, out wstring result ); parameters dialogtitle the title of the dialog.
...And 2 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(); void removepage(in nsiuri auri); void removepages([array, s...
...ize_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long long abegintime, in long long aendtime); void removepagesfromhost(in autf8string ahost, in boolean aentiredomain); void removevisitsbytimeframe(in long long abegintime, in long long aendtime); void unregisteropenpage(in nsiuri auri); obsolete since gecko 9.0 note: the markpageasfollowedlink and markpageastyped methods were moved to nsinavhistoryservice in gecko 22.0 so that all markpageas* methods can be found in one interface.
... lastpagevisited obsolete since gecko 10.0 autf8string the last page that was visited in a top-level window.
...And 2 more matches
nsIClipboard
sisupports 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 supportsselectionclipboard(); boolean supportsfindclipboard(); constants most clipboard operations in firefox use kglobalclipboard, which is the one also used by the typical control-c/cont...
... kfindclipboard 2 clipboard for find strings.
... boolean hasdatamatchingflavors( [array, size_is(alength)] in string aflavorlist, in unsigned long alength, in long awhichclipboard ); parameters aflavorlist an array of ascii strings.
...And 2 more matches
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.
... void docommand( in string command ); parameters command the name of the command to execute.
...boolean iscommandenabled( in string command ); parameters command the name of the command whose availability is to be checked.
...And 2 more matches
nsIDOMEvent
nseventptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interfac...
... type domstring the name of the event (case-insensitive).
... void initevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg ); parameters eventtypearg specifies the event type.
...And 2 more matches
nsIDOMWindowInternal
void alert(in domstring text) boolean confirm(in domstring text) domstring prompt([optional] in domstring amessage, [optional] in domstring ainitial, [optional] in domstring atitle, [optional] in unsigned long asavepassword) void focus() void blur() void back() void forward() void home() void stop() void print() void moveto(in long...
...if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">open(in domstring url, in domstring name, in domstring options) nsidomwindow nsisupports aextraargument) void close() void updatecommands(in domstring action) boolean find([optional] in domstring str,[optional] in boolean casesensitive, [optional] in boolean backwards, [optional] in boolean wraparound, [optional] in boolean wholeword, [optional] in boolean searchinframes, [opti...
...onal] in boolean showdialog) domstring atob(in domstring aasciistring) domstring btoa(in domstring abase64data) nsivariant showmodaldialog(in nsivariant aargs, [optional] in domstring aoptions) void postmessage(in domstring message, in domstring targetorigin) attributes attribute type description window nsidomwindowinternal readonly: the window object itself.
...And 2 more matches
nsIDOMXULLabeledControlElement
inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key.
... command domstring this property reflects the element's command attribute.
... crop domstring this property reflects the element's crop attribute.
...And 2 more matches
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.
... void abort( in string afile, in long aline ); parameters afile file containing abort request.
...void assertion( in string astr, in string aexpr, in string afile, in long aline ); parameters astr assertion message.
...And 2 more matches
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.
... type astring the type of the event for which the listener was added.
...tosource() tries to serialize the event listener to a string.
...And 2 more matches
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 can be unloaded by xpcom.
...void registerself( in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype ); parameters acompmgr the global component manager.
... aloaderstr opaque loader specific string.
...And 2 more matches
nsIMsgFilterCustomAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfiltercustomaction.idl interface nsimsgfiltercustomaction : nsisupports { /* globally unique string to identify this filter action.
... * recommended form: extensionname@example.com#actionname */ readonly attribute acstring id; /* action name to display in action list.
...*/ readonly attribute astring name; /** * is this custom action valid for a particular filter type?
...And 2 more matches
nsIMsgSearchSession
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); void getnthsearchterm(in long whichterm, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); long counts...
...g which,out nsmsgsearchscopevalue scopeid, out nsimsgfolder folder); void addscopeterm(in nsmsgsearchscopevalue scope, in nsimsgfolder folder); void adddirectoryscopeterm(in nsmsgsearchscopevalue scope); void clearscopes(); [noscript] boolean scopeusescustomheaders(in nsmsgsearchscopevalue scope, in voidptr selection, in boolean forfilters); boolean isstringattribute(in nsmsgsearchattribvalue attrib); void addallscopes(in nsmsgsearchscopevalue attrib); void search(in nsimsgwindow awindow); void interruptsearch(); void pausesearch(); void resumesearch(); [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); [noscript] void addresultelement(in nsmsgresultelem...
... 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.
...And 2 more matches
nsIMsgSearchTerm
defined in mozilla/ mailnews/ base/ search/ public/ nsimsgsearchterm.idl attributes attrib attribute nsmsgsearchattribvalue attrib; op attribute nsmsgsearchopvalue op; value attribute nsimsgsearchvalue value; booleanand attribute boolean booleanand; arbitraryheader attribute acstring arbitraryheader; hdrproperty /** * not to be confused with arbitraryheader, which is a header in the * rfc822 message.
... */ attribute acstring hdrproperty; customid /// identifier for a custom id used for this term, if any.
... 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 nsmsgpriorityvalue priority); matchage boolean matchage(in prtime days); matchsize boolean matchsize(in unsigned long size); matchlabel boolean matchlabel(in nsmsglabelvalue alabelvalue); matchjunkstatus boolean matchjunkstatus(in string ajunkscore); matchjunkpercent /*...
...And 2 more matches
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_error_not_available exception of containeropen is false.
... dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container.
... remotecontainertype obsolete since gecko 1.9 autf8string a string representing the remote container service api that is responsible for this container.
...And 2 more matches
nsINavHistoryResultNode
icon autf8string this uri can be used as an image source uri and will give you the favicon for the page.
...obsolete since gecko 2.0 tags astring for uri nodes, this is a sorted list of the tags, delimited with commans, for the uri represented by this node.
... otherwise this is an empty string.
...And 2 more matches
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 sanitizerallowcommen...
... astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wrapcol ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return value.) flags conversion option flags defined in nsidocumentencoder.
... nsidomdocumentfragment parsefragment( in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment the input markup.
...And 2 more matches
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 nsisimpleenumerator readonly: an enumeration of the st...
... astring adduser(in autf8string ahost, in astring auser, in astring apassword); parameters ahost the hostname of the password to store.
... void removeuser(in autf8string ahost, in astring auser); parameters ahost the hostname of the password to remove.
...And 2 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.
... nsiprefbranch getbranch( in string aprefroot ); parameters aprefroot the preference root tree on which to base this branch.
...nsnull or "" (empty string) may be used to access to the entire preference tree.
...And 2 more matches
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.
... printernamelist nsistringenumerator the list of printer names.
... 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.
...And 2 more matches
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 push subscription.
... void subscribe( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the serviceworkerregistration.scope for a service worker subscription, or a unique url (for example, chrome://my-module/push) for a system subscription.
... void getsubscription( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the unique scope url, as passed to nsipushservice.subscribe().
...And 2 more matches
nsIScriptableUnescapeHTML
implemented by: @mozilla.org/feed-unescapehtml;1 as a service: var scriptableunescapehtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml); method overview nsidomdocumentfragment parsefragment(in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element); astring unescape(in astring src); methods parsefragment() parses a string of html or xml source into a sanitized documentfragment.
... nsidomdocumentfragment parsefragment( in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment a string of html or xml source to parse as a fragment.
... isxml set this to true if the fragment is an xml string; otherwise set it to false.
...And 2 more matches
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 processid); void createmessagelist(in nsidommozs...
...ong 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.
... abody a domstring containing the body text of the message.
...And 2 more matches
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.
...void init( in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aurltype one of the constants listed above.
... adefaultport if the port parsed from the url string matches this port, then the port will be removed from the canonical form of the url.
...And 2 more matches
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...
...void final( in acstring ab, in acstring agvb, in acstring arb, in acstring ahkdfinfo, out acstring aaes256key, out acstring ahmac256key ); parameters ab schnorr signature value b, in hex representation.
...void round1( in acstring asignerid, out acstring agx1, out acstring agv1, out acstring ar1, out acstring agx2, out acstring agv2, out acstring ar2 ); parameters asignerid string identifying the signer.
...And 2 more matches
XPCOM Interface Reference
nsicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2...
...esulttreeviewernsinavhistoryresultviewobservernsinavhistoryresultviewernsinavhistoryservicensinavhistoryvisitresultnodensinetworklinkservicensiobservernsiobserverservicensioutputstreamnsioutputstreamcallbacknsiparentalcontrolsservicensiparserutilsnsipasswordnsipasswordmanagernsipermissionnsipermissionmanagernsipipensiplacesimportexportservicensiplacesviewnsipluginhostnsiprefbranch2nsipreflocalizedstringnsiprefservicensiprincipalnsiprinterenumeratornsiprintingpromptnsiprivatebrowsingservicensiprocessnsiprocess2nsiprocessscriptloadernsiprofilensiprofilelocknsiprofileunlockernsiprogramminglanguagensiprogresseventsinknsipromptnsipromptservicensipropertiesnsipropertynsipropertybagnsipropertybag2nsipropertyelementnsiprotocolhandlernsiprotocolproxycallbacknsiprotocolproxyfilternsiprotocolproxyservicens...
...selectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketlistenernsiservicemanagernsisessionstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandardurlnsistreamconverternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspruint8nsisupportspruint16nsisup...
...And 2 more matches
XPCOM primitive
(however, if you are designing that kind of api today, you should probably use nsivariant instead.) idl data type interface component idl nsidptr nsisupportsid @mozilla.org/supports-id;1 [scriptable, uuid(d18290a0-4a1c-11d3-9890-006008962422)] interface nsisupportsid : nsisupportsprimitive { attribute nsidptr data; string tostring(); }; astring nsisupportsstring @mozilla.org/supports-string;1 [scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)] interface nsisupportsstring : nsisupportsprimitive { attribute astring data; wstring tostring(); }; prbool nsisupportsprbool @mozilla.org/supports-prbool;1 [scriptable, uuid(ddc3b490-4a1c-11d3-9890-006008962422)] interface nsisupportsprbool : nsisupportsprim...
...itive { attribute prbool data; string tostring(); }; pruint8 nsisupportspruint8 @mozilla.org/supports-pruint8;1 [scriptable, uuid(dec2e4e0-4a1c-11d3-9890-006008962422)] interface nsisupportspruint8 : nsisupportsprimitive { attribute pruint8 data; string tostring(); }; pruint16 nsisupportspruint16 @mozilla.org/supports-pruint16;1 [scriptable, uuid(dfacb090-4a1c-11d3-9890-006008962422)] interface nsisupportspruint16 : nsisupportsprimitive { attribute pruint16 data; string tostring(); }; pruint32 nsisupportspruint32 @mozilla.org/supports-pruint32;1 [scriptable, uuid(e01dc470-4a1c-11d3-9890-006008962422)] interface nsisupportspruint32 : nsisupportsprimitive { attribute pruint32 data; string tostring(); }; pruint64 nsisupportspruint64 @mozilla.org/supports-prui...
...nt64;1 [scriptable, uuid(e13567c0-4a1c-11d3-9890-006008962422)] interface nsisupportspruint64 : nsisupportsprimitive { attribute pruint64 data; string tostring(); }; prtime nsisupportsprtime @mozilla.org/supports-prtime;1 [scriptable, uuid(e2563630-4a1c-11d3-9890-006008962422)] interface nsisupportsprtime : nsisupportsprimitive { attribute prtime data; string tostring(); }; char nsisupportschar @mozilla.org/supports-char;1 [scriptable, uuid(e2b05e40-4a1c-11d3-9890-006008962422)] interface nsisupportschar : nsisupportsprimitive { attribute char data; string tostring(); }; print16 nsisupportsprint16 @mozilla.org/supports-print16;1 [scriptable, uuid(e30d94b0-4a1c-11d3-9890-006008962422)] interface nsisupportsprint16 : nsisupportsprimitive { attribute print16 data; ...
...And 2 more matches
Storage
file = fileutils.getfile("profd", ["my_db_file_name.sqlite"]); let dbconn = services.storage.opendatabase(file); // will also create the file if it does not exist likewise, the c++ would look like this: nscomptr<nsifile> dbfile; rv = ns_getspecialdirectory(ns_app_user_profile_50_dir, getter_addrefs(dbfile)); ns_ensure_success(rv, rv); rv = dbfile->append(ns_literal_string("my_db_file_name.sqlite")); ns_ensure_success(rv, rv); nscomptr<mozistorageservice> dbservice = do_getservice(moz_storage_service_contractid, &rv); ns_ensure_success(rv, rv); nscomptr<mozistorageconnection> dbconn; rv = dbservice->opendatabase(dbfile, getter_addrefs(dbconn)); ns_ensure_success(rv, rv); note: moz_storage_service_contractid is defined in storage/build/mozstoragecid.h.
... no results to be returned if you do not need to get any results back, you can use mozistorageconnection.executesimplesql() api like this in javascript: dbconn.executesimplesql("create temp table table_name (column_name integer)"); similarly, the c++ looks like this: rv = mdbconn->executesimplesql(ns_literal_cstring("create temp table table_name (column_name integer)")); ns_ensure_success(rv, rv); results to be returned however, if you need to get results back, you should create the statement with the mozistorageconnection.createstatement() api like this in javascript: var statement = dbconn.createstatement("select * from table_name where column_name = :parameter"); this example uses a named placeholder...
...similarly, the c++ looks like this: nscomptr<mozistoragestatement> statement; rv = dbconn->createstatement(ns_literal_cstring("select * from table_name where column_name = ?1"), getter_addrefs(statement)); ns_ensure_success(rv, rv); this example uses the numbered placeholder indexed by zero for a parameter to be bound later (described in binding parameters).
...And 2 more matches
Address book sync client design
* * atransactionid - the id for this particular request * astatus - status code for the sync request * amsg - a text string describing the error (if any).
... */ void onstopauthoperation(in nsresult astatus, in wstring amsg, in string acookie); /** * notify the observer that the ab sync operation has begun.
...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 a status message for sync operation */ void onstatus(in print32 atransactionid, in wstring amsg); /** * notify the observer that the ab sync operation has been completed.
...And 2 more matches
Using the Multiple Accounts API
keys are simply internal strings that uniquely identify each account, identity and server.
...you will need to pass it the server type as a string, from the list above.
... relevant api calls: nsimsgaccount nsimsgaccountmanager.createaccount() nsimsgaccount nsimsgaccountmanager.getaccount(in string key) nsimsgincomingserver nsimsgaccountmanager.createincomingserver(in string type) nsimsgincomingserver nsimsgaccountmanager.getincomingserver(in string key) smtp servers smtp servers are kept separately from all the other account management stuff.
...And 2 more matches
ABI
method overview string tosource() string tostring() methods tosource() returns the string "ctypes.***_abi".
... string tosource() parameters none.
... tostring() returns a string identifying the abi.
...And 2 more matches
Search - Firefox Developer Tools
you can use the up and down arrows to move through the list, and return to open the file you want: searching within a file to search for a particular substring in the file currently loaded into the source pane, press control + f (or command + f on a mac) while the source pane is focused.
... searching in all files you can also search for a string in all of the files included in the currently opened project.
... press shift + ctrl + f (windows and linux) or shift + cmd + f (macos) and then enter the string you are trying to find.
...And 2 more matches
AudioTrack - Web APIs
id read only a domstring which uniquely identifies the track within the media.
... kind read only a domstring specifying the category into which the track falls.
... label read only a domstring providing a human-readable label for the track.
...And 2 more matches
Blob - Web APIs
WebAPIBlob
blob.prototype.type read only a string indicating the mime type of the data contained in the blob.
... if the type is unknown, this string is empty.
... blob.prototype.text() returns a promise that resolves with a usvstring containing the entire contents of the blob interpreted as utf-8 text.
...And 2 more matches
CSSPrimitiveValue.primitiveType - Web APIs
the value can be obtained by using the getstringvalue() method.
...the value can be obtained by using the getstringvalue() method.
... css_string the value is a <string>.
...And 2 more matches
CSSStyleSheet.addRule() - Web APIs
syntax var result = cssstylesheet.addrule(selector, styleblock, index); parameters selector a domstring specifying the selector portion of the css rule.
... the default is the string undefined.
... styleblock a domstring indicating the style block to apply to elements matching the selector.
...And 2 more matches
ChildNode.before() - Web APIs
WebAPIChildNodebefore
the childnode.before() method inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode.
... domstring objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.before((node or domstring)...
...And 2 more matches
console.assert() - Web APIs
WebAPIConsoleassert
the string representations of each of these objects are appended together in the order listed and output.
... msg a javascript string containing zero or more substitution strings.
...substn javascript objects with which to replace substitution strings within msg.
...And 2 more matches
console.log() - Web APIs
WebAPIConsolelog
the message may be a single string (with optional substitution values), or it may be any one or more javascript objects.
...the string representations of each of these objects are appended together in the order listed and output.
... msg a javascript string containing zero or more substitution strings.
...And 2 more matches
DOMException - Web APIs
each exception has a name, which is a short "camelcase" style string identifying the error or abnormal condition.
... domexception.message read only returns a domstring representing a message or description associated with the given error name.
... domexception.name read only returns a domstring that contains one of the strings associated with an error name.
...And 2 more matches
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.
... syntax datatransfer.getdata(format); arguments format a domstring representing the type of data to retrieve.
...And 2 more matches
Document.querySelector() - Web APIs
syntax element = document.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match.
... this string must be a valid css selector string; if it isn't, a syntax_err exception is thrown.
...since javascript also uses backslash escaping, be especially careful when writing string literals using these characters.
...And 2 more matches
Element.getAttribute() - Web APIs
if the given attribute does not exist, the value returned will either be null or "" (the empty string); see non-existing attributes for details.
... syntax let attribute = element.getattribute(attributename); where attribute is a string containing the value of attributename.
...the old dom 3 core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some dom implementations implement this behavior.
...And 2 more matches
Element.outerHTML - Web APIs
WebAPIElementouterHTML
it can also be set to replace the element with nodes parsed from the given string.
... syntax var content = element.outerhtml; element.outerhtml = htmlstring; value reading the value of outerhtml returns a domstring containing an html serialization of the element and its descendants.
... setting the value of outerhtml replaces the element and all of its descendants with a new dom tree constructed by parsing the specified htmlstring.
...And 2 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.
... filereadersync.readastext() this method converts a specified blob or a file into a domstring representing the input data as a text string.
...And 2 more matches
HTMLFieldSetElement - Web APIs
htmlfieldsetelement.name a domstring reflecting the name html attribute, containing the name of the field set.
... htmlfieldsetelement.typeread only the domstring "fieldset".
... htmlfieldsetelement.validationmessage a domstring representing a localized message that describes the validation constraints that the element does not satisfy (if any).
...And 2 more matches
HTMLOrForeignElement.dataset - Web APIs
it is a map of domstrings (domstringmap) with one entry for each custom data attribute.
... name conversion dash-style to camelcase conversion a custom data attribute name is transformed to a key for the domstringmap entry with the following rules the prefix data- is removed (including the dash); for any dash (u+002d) followed by an ascii lowercase letter a to z, the dash is removed, and the letter is transformed into its uppercase counterpart; other characters (including other dashes) are left unchanged.
... setting values when an attribute is set, its value is always converted into a string.
...And 2 more matches
HTMLTableColElement - Web APIs
htmltablecolelement.align is a domstring that indicates the horizontal alignment of the cell data in the column.
... htmltablecolelement.ch is a domstring representing the alignment character for cell data.
... htmltablecolelement.choff is a domstring representing the offset for the alignment character.
...And 2 more matches
HTMLTableRowElement - Web APIs
htmltablerowelement.align is a domstring containing an enumerated value reflecting the align attribute.
... htmltablerowelement.bgcolor is a domstring containing the background color of the cells.
... htmltablerowelement.ch is a domstring containing one single character.
...And 2 more matches
Dragging and Dropping Multiple Items - Web APIs
as with the types property, it returns a list of strings of the types for an item.
... var types = event.datatransfer.moztypesat(1); dragging non-string data the additional methods described above are also not restricted to string data; you can specify any type of data.
...as the setdata() method only supports strings, it cannot be used to specify files for dragging in this manner.
...And 2 more matches
Basic concepts - Web APIs
the name can be any string value (including an empty string).
... a key can be one of the following types: string, date, float, a binary blob, and array.
...a valid key path can include one of the following: an empty string, a javascript identifier, or multiple javascript identifiers separated by periods or an array containing any of those.
...And 2 more matches
Intersection Observer API - Web APIs
increasingcolor a string defining a color we'll apply to the target element when the visibility ratio is increasing.
... the word "ratio" in this string will be replaced with the target's current visibility ratio, so that the element not only changes color but also becomes increasingly opaque as it becomes less obscured.
... decreasingcolor similarly, this is a string defining a color we'll apply when the visibility ratio is decreasing.
...And 2 more matches
Keyboard API - Web APIs
keyboard mapping provides an interface for retrieving the string generated by particular physical key on a keyboard to correctly identify that key to a user.
... keyboard api concepts and usage keyboard mapping on physical keyboards, the code attribute contains the physical location of the key that was pressed, and the key attribute contains the string generated by pressing the key at that physical location on the keyboard.
... the keyboard map api provides a way to retrieve the string generated by a particular key press, through the keyboard interface and the keyboardlayoutmap interface.
...And 2 more matches
MediaRecorder.mimeType - Web APIs
note: the term "mime type" is officially considered to be historical; these strings are now officially known as media types.
... syntax var mimetype = mediarecorder.mimetype value the mime media type which describes the format of the recorded media, as a domstring.
... this string may include the codecs parameter, giving details about the codecs and the codec configurations used by the media recorder.
...And 2 more matches
MediaStreamTrack - Web APIs
mediastreamtrack.contenthint a string that may be used by the web application to provide a hint as to what type of content the track contains to guide how it should be treated by api consumers.
... mediastreamtrack.id read only returns a domstring containing a unique identifier (guid) for the track; it is generated by the browser.
... mediastreamtrack.kind read only returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track.
...And 2 more matches
MerchantValidationEvent() - Web APIs
syntax merchantvalidationevent = new merchantvalidationevent(type, options); parameters type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface.
... options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used.
... this is an empty string by default.
...And 2 more matches
PasswordCredential - Web APIs
passwordcredential.iconurl read only secure context a usvstring containing a url pointing to an image for an icon.
... passwordcredential.idname secure context a usvstring containing the name that will be used for the id field when submitting the current object to a remote endpoint via fetch.
... passwordcredential.name read only secure context a usvstring containing a human-readable public name for display in a credential chooser.
...And 2 more matches
PerformanceEntry.entryType - Web APIs
the entrytype property returns a domstring representing the type of performance metric such as, for example, "mark".
... mark performancemark domstring the name used when the mark was created by calling performance.mark().
... measure performancemeasure domstring name used when the measure was created by calling performance.measure().
...And 2 more matches
RTCIceCandidate.RTCIceCandidate() - Web APIs
the candidate string (which is sdp text) is parsed; each property found is stored in the corresponding field in the rtcicecandidate.
... if any of the fields is invalid, parsing of the string silently aborts without throwing an exception.
... the default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message.
...And 2 more matches
RTCIceCandidate.priority - Web APIs
as is the case with most of rtcicecandidate's properties, the value of priority is extracted from the candidate a-line string specified when creating the rtcicecandidate.
... the a-line string is obtained either from the rtcicecandidateinit property candidate or from an a-line string passed into rtcpeerconnection.addicecandidate() instead of an rtcicecandidate.
... priority is initialized to null if it is not specified in the candidate, or if the candidate string can't be parsed propertly.
...And 2 more matches
RTCIceCandidate.usernameFragment - Web APIs
the read-only usernamefragment property on the rtcicecandidate interface is a string indicating the username fragment ("ufrag") that uniquely identifies a single ice interaction session.
... if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of usernamefragment is extracted from the m-line.
... syntax var ufrag = rtcicecandidate.usernamefragment; value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server.
...And 2 more matches
RTCIceCandidateInit - Web APIs
if the candidate is an indicator that there are no further candidates (rather than representing a new candidate), this is the empty string ("").
... the default is the empty string.
... usernamefragment optional a domstring containing a string which uniquely identifies the remote peer.
...And 2 more matches
RTCPeerConnection.createDataChannel() - Web APIs
this string may not be longer than 65,535 bytes.
... protocol optional the name of the sub-protocol being used on the rtcdatachannel, if any; otherwise, the empty string ("").
... default: empty string, "".
...And 2 more matches
Request - Web APIs
WebAPIRequest
request.destination read only returns a string from the requestdestination enum describing the request's destination.
... this is a string indicating the type of content being requested.
... body.text() returns a promise that resolves with an usvstring (text) representation of the request body.
...And 2 more matches
SVGAngle - Web APIs
WebAPISVGAngle
setting this attribute will cause valueinspecifiedunits and valueasstring to be updated automatically to reflect this setting.
...setting this attribute will cause value and valueasstring to be updated automatically to reflect this setting.
... valueasstring the value as a domstring value, in the units expressed by unittype.
...And 2 more matches
SVGDocument - Web APIs
interface overview also implement none methods none properties domstring domain domstring referrer svgsvgelement rootelement domstring title domstring url normative document svg 1.1 (2nd edition) properties name type description ...
... domain domstring the domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.
... referrer domstring returns the uri of the page that linked to this page.
...And 2 more matches
SharedWorker() - Web APIs
syntax var myworker = new sharedworker(aurl, name); var myworker = new sharedworker(aurl, options); parameters aurl a domstring representing the url of the script the worker will execute.
... name optional a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes.
...available properties are as follows: type: a domstring specifying the type of worker to create.
...And 2 more matches
Using readable streams - Web APIs
as an example, have a look at our simple random stream demo (see it live also), which creates a custom stream, enqueues some random strings into it, and then reads the data out of the stream again once the stop string generation button is pressed.
... the custom stream constructor has a start() method that uses a windowtimers.setinterval() call to generate a random string every second.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); readstream(); controller.close(); }) }, p...
...And 2 more matches
URLSearchParams() - Web APIs
syntax var urlsearchparams = new urlsearchparams(init); parameters init optional one of: a usvstring, which will be parsed from application/x-www-form-urlencoded format.
... a sequence of usvstring pairs, representing names/values.
... a record of usvstring keys and usvstring values.
...And 2 more matches
VideoTrack - Web APIs
id read only a domstring which uniquely identifies the track within the media.
... kind read only a domstring specifying the category into which the track falls.
... label read only a domstring providing a human-readable label for the track.
...And 2 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.
... handedness handedness, indicated by the xrinputsource property handedness, is a string which indicates which of the viewer's hands the controller is in: left or right.
... targeting ray mode the targeting ray mode is a string found in the targetraymode property.
...And 2 more matches
Using Web Workers - Web APIs
to illustrate this, let's create for didactical purpose a function named emulatemessage(), which will simulate the behavior of a value that is cloned and not shared during the passage from a worker to the main page or vice versa: function emulatemessage(vval) { return eval('(' + json.stringify(vval) + ')'); } // tests // test #1 var example1 = new number(3); console.log(typeof example1); // object console.log(typeof emulatemessage(example1)); // number // test #2 var example2 = true; console.log(typeof example2); // boolean console.log(typeof emulatemessage(example2)); // boolean // test #3 var example3 = new string('hello world'); console.log(typeof example3); // object console...
....log(typeof emulatemessage(example3)); // string // test #4 var example4 = { 'name': 'john smith', "age": 43 }; console.log(typeof example4); // object console.log(typeof emulatemessage(example4)); // object // test #5 function animal(stype, nage) { this.type = stype; this.age = nage; } var example5 = new animal('cat', 3); alert(example5.constructor); // animal alert(emulatemessage(example5).constructor); // object a value that is cloned and not shared is called message.
...etc): calls a worker's queryable function * postmessage(string or json data): see worker.prototype.postmessage() * terminate(): terminates the worker * addlistener(name, function): adds a listener * removelistener(name): removes a listener queryableworker instances properties: * defaultlistener: the default listener executed only when the worker calls the postmessage() function directly */ function queryablework...
...And 2 more matches
Window.find() - Web APIs
WebAPIWindowfind
the window.find() method finds a string in a window.
... syntax window.find(astring, acasesensitive, abackwards, awraparound, awholeword, asearchinframes, ashowdialog); astring the text string for which to search.
... returns true if the string is found; otherwise, false.
...And 2 more matches
WindowOrWorkerGlobalScope.atob() - Web APIs
the windoworworkerglobalscope.atob() function decodes a string of data which has been encoded using base64 encoding.
... for use with unicode or utf-8 strings, see the note on "unicode strings" in the page for btoa().
... syntax var decodeddata = scope.atob(encodeddata); parameters encodeddata a binary string contains an base64 encoded data.
...And 2 more matches
WorkerNavigator - Web APIs
navigatorid.appversion read only returns the version of the browser as a string.
... navigatorlanguage.languageread only returns a domstring representing the language version of the browser.
... navigatorlanguage.languagesread only returns an array of domstrings representing the languages known to the user, in order of preference.
...And 2 more matches
XMLHttpRequest.getResponseHeader() - Web APIs
the xmlhttprequest method getresponseheader() returns the string containing the text of a particular header's value.
... if there are multiple response headers with the same name, then their values are returned as a single concatenated string, where each value is separated from the previous one by a pair of comma and space.
... if you need to get the raw string of all of the headers, use the getallresponseheaders() method, which returns the entire raw header string.
...And 2 more matches
XMLHttpRequest.responseType - Web APIs
the xmlhttprequest property responsetype is an enumerated string value specifying the type of data contained in the response.
...if an empty string is set as the value of responsetype, the default value of text is used.
... syntax var type = xmlhttprequest.responsetype; xmlhttprequest.responsetype = type; value a string taken from the xmlhttprequestresponsetype enum which specifies what type of data the response contains.
...And 2 more matches
XMLHttpRequest.sendAsBinary() - Web APIs
this method makes it possible to read and upload any type of file and to stringify the raw data.
... syntax xmlhttprequest.sendasbinary(binarystring); parameters binarystring a domstring which encodes the binary content to be sent.
... you can create the binary string using the filereader method readasbinarystring().
...And 2 more matches
Visual formatting model - CSS: Cascading Style Sheets
in the next example i have a string inside a <div>; in the middle of my string is a <p> element containing part of the text.
... the string is split into three boxes in the box tree.
... the part of the string before the paragraph element is wrapped in an anonymous box, then we have the <p>, which generates a box, and then another anonymous box.
...And 2 more matches
font-language-override - CSS: Cascading Style Sheets
/* keyword value */ font-language-override: normal; /* <string> values */ font-language-override: "eng"; /* use english glyphs */ font-language-override: "trk"; /* use turkish glyphs */ /* global values */ font-language-override: initial; font-language-override: inherit; font-language-override: unset; by default, html's lang attribute tells browsers to display glyphs designed specifically for that language.
... syntax the font-language-override property is specified as the keyword normal or a <string>.
... <string> tells the browser to use font glyphs that are appropriate for the language specified by the string.
...And 2 more matches
text-emphasis-style - CSS: Cascading Style Sheets
/* initial value */ text-emphasis-style: none; /* no emphasis marks */ /* <string> values */ text-emphasis-style: 'x'; text-emphasis-style: '点'; text-emphasis-style: '\25b2'; text-emphasis-style: '*'; text-emphasis-style: 'foo'; /* should not be used.
... <string> display the given string as marks.
... authors should not specify more than one character in <string>.
...And 2 more matches
regexp:test() - EXSLT
WebEXSLTregexptest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:test() tests to see whether a string matches a specified regular expression.
... syntax regexp:test(teststring, regexpstring[, flagsstring]) parameters teststring the string to test..
... regexpstring the javascript style regular expression to evaluate.
...And 2 more matches
HTML attribute reference - HTML: Hypertext Markup Language
challenge <keygen> a challenge string that is submitted along with the public key.
...the content attribute is always a string even when the expected value should be an integer.
...however, the type idl attribute will return the string "text".
...And 2 more matches
<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 val...
...ue attribute contains a domstring that either represents a telephone number or is an empty string ("").
... placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field.
...And 2 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
srcset a list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use.
... each string is composed of: one url specifying an image.
... a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w.
...And 2 more matches
Control flow and error handling - JavaScript
// prone to being misread as "x == y" if (x = y) { /* statements here */ } if you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment, like this: if ((x = y)) { /* statements here */ } falsy values the following values evaluate to false (also known as falsy values): false undefined null 0 nan the empty string ("") all other values—including all objects—evaluate to true when passed to a conditional statement.
...while it is common to throw numbers or strings as errors, it is frequently more effective to use one of the exception types specifically created for this purpose: ecmascript exceptions domexception and domerror throw statement use the throw statement to throw an exception.
...the following code throws several exceptions of varying types: throw 'error2'; // string type throw 42; // number type throw true; // boolean type throw {tostring: function() { return "i'm an object!"; } }; note: you can specify an object when you throw an exception.
...And 2 more matches
Indexed collections - JavaScript
let myarray = new array('1', '2', '3') myarray = myarray.concat('a', 'b', 'c') // myarray is now ["1", "2", "3", "a", "b", "c"] join(delimiter = ',') joins all elements of an array into a string.
... the function below compares two values and returns one of three values: for instance, the following will sort by the last letter of a string: let sortfn = function(a, b) { if (a[a.length - 1] < b[b.length - 1]) return -1; if (a[a.length - 1] > b[b.length - 1]) return 1; if (a[a.length - 1] == b[b.length - 1]) return 0; } myarray.sort(sortfn) // sorts the array so that myarray = ["wind","fire","rain"] if a is less than b by the sorting system, return -1 (or any negative number) if a is greater than b by the sorting system, r...
... const arr = [1, 2, 3]; arr.property = "value"; console.log(arr.property); // logs "value" arrays and regular expressions when an array is the result of a match between a regular expression and a string, the array returns properties and elements that provide information about the match.
...And 2 more matches
SyntaxError: missing ) after argument list - JavaScript
this might be a typo, a missing operator, or an unescaped string.
...this might be a typo, a missing operator, or an unescaped string, for example.
... examples because there is no "+" operator to concatenate the string, javascript expects the argument for the log function to be just "pi: ".
...And 2 more matches
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
the javascript exception "right-hand side of 'in' should be an object" occurs when the in operator was used to search in strings, or in numbers, or other primitive types.
...you can't search in strings, or in numbers, or other primitive types.
... examples searching in strings unlike in other programming languages (e.g.
...And 2 more matches
Error.prototype.toSource() - JavaScript
syntax e.tosource() return value a string containing the source code of the 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.
... this string can be evaluated to create an (approximately) equal object.
...And 2 more matches
Intl.Locale.prototype.calendar - JavaScript
the following table shows all the valid unicode calendar key strings, along with a description of the calendar era they represent.
... islamicc civil (algorithmic) arabic calendar examples adding a calendar in the locale string calendar eras fall under the category of locale key "extension keys".
...thus, the calendar era type can be added to the inital locale identifier string that is passed into the intl.locale constructor.
...And 2 more matches
Intl.Locale.prototype.hourCycle - JavaScript
like other additional locale data, hour cycle type is an extension subtag, which extends the data contained in a locale string.
... adding an hour cycle via the locale string in the unicode locale string spec, the hour cycle is a locale string "extension subtag".
...thus, the hour cycle type can be added to the inital locale identifier string that is passed into the locale constructor.
...And 2 more matches
Map - JavaScript
the keys of an object must be either a string or a symbol.
... note: since ecmascript 2015, objects do preserve creation order for string and symbol keys.
... in javascript engines that comply with the ecmascript 2015 spec, iterating over an object with only string keys will yield the keys in order of insertion.
...And 2 more matches
Number.parseInt() - JavaScript
the number.parseint() method parses a string argument and returns an integer of the specified radix or base.
... syntax number.parseint(string,[ radix]) parameters string the value to parse.
... if this argument is not a string, then it is converted to one using the tostring abstract operation.
...And 2 more matches
Object.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax object.tosource(); obj.tosource(); return value 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.
...And 2 more matches
Object - JavaScript
object.entries() returns an array containing all of the [key, value] pairs of a given object's own enumerable string properties.
... object.keys() returns an array containing the names of all of the given object's own enumerable string properties.
... object.values() returns an array containing the values that correspond to all of a given object's own enumerable string properties.
...And 2 more matches
RegExp.prototype[@@match]() - JavaScript
the [@@match]() method retrieves the matches when matching a string against a regular expression.
... syntax regexp[symbol.match](str) parameters str a string that is a target of the match.
... description this method is called internally in string.prototype.match().
...And 2 more matches
encodeURIComponent() - JavaScript
syntax encodeuricomponent(str); parameters str string.
... return value a new string representing the provided string encoded as a uri component.
... to be more stringent in adhering to rfc 3986 (which reserves !, ', (, ), and *), even though these characters have no formalized uri delimiting uses, the following can be safely used: function fixedencodeuricomponent(str) { return encodeuricomponent(str).replace(/[!'()*]/g, function(c) { return '%' + c.charcodeat(0).tostring(16); }); } examples encoding for content-disposition and link headers the fol...
...And 2 more matches
escape() - JavaScript
… the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
... note: this function was used mostly for url queries (the part of a url following ?)—not for escaping ordinary string literals, which use the format "\xhh".
... (hh are two hexadecimal digits, and the form \xhh\xhh is used for higher-plane unicode characters.) escaped characters in string literals can be expanded by replacing the \x with %, then using the decodeuricomponent() function.
...And 2 more matches
Media container formats (file types) - Web media technologies
base 3gp media mime types audio video audio/3gpp video/3gpp audio/3gpp2 video/3gpp2 audio/3gp2 video/3gp2 these mime types are the fundamental types for the 3gp media container; other types may be used depending on the specific codec or codecs in use; in addition, you can add the codecs parameter to the mime type string to indicate which codecs are used for the audio and/or video tracks, and to optionally provide details about the profile, level, and/or other codec configuration specifics.
... when specifying the mpeg-4 media type (audio/mp4 or video/mp4), you can add the codecs parameter to the mime type string to indicate which codecs are used for the audio and/or video tracks, and to optionally provide details about the profile, level, and/or other codec configuration specifics.
...in addition, you can add the codecs parameter to the mime type string to indicate which codecs are used for the audio and/or video tracks, and to optionally provide details about the profile, level, and/or other codec configuration specifics.
...And 2 more matches
Loading Content Scripts - Archive of obsolete content
the constructors for content-script-using objects such as panel and page-mod define a group of options for loading content scripts: contentscript string, array contentscriptfile string, array contentscriptwhen string contentscriptoptions object we have already seen the contentscript option, which enables you to pass in the text of the script itself as a string literal.
...contentscriptfile: data.url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ...
... unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
... any kind of jsonable value (object, array, string, etc.) can be used here.
Communicating using "port" - Archive of obsolete content
var pagemodscript = "window.addeventlistener('click', function(event) {" + " self.port.emit('click', event.target.tostring());" + " event.stoppropagation();" + " event.preventdefault();" + "}, false);" + "self.port.on('warning', function(message) {" + "window.alert(message);" + "});" var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: func...
...tion(worker) { worker.port.on('click', function(html) { worker.port.emit('warning', 'do not click this again'); }); } }); in the add-on above there are two user-defined messages: click is sent from the page-mod to the add-on, when the user clicks an element in the page warning sends a silly string back to the page-mod port.emit() the port.emit() function sends a message from the "main.js", or another add-on module, to a content script, or vice versa.
...this means that it needs to be a string, number, boolean, null, array of json-serializable values, or an object whose property values are themselves json-serializable.
... for example, to include an array of strings in the payload: var pagemodscript = "self.port.emit('loaded'," + " [" + " document.location.tostring()," + " document.title" + " ]" + ");" var pagemod = require('page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.port.on('loaded', function(pageinfo) { console.log(pageinfo[0]); console.log(pageinfo[1]); }); } }); ...
tabs - Archive of obsolete content
} }); parameters options : object required options: name type url string string url to be opened in the new tab.
... example var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { var worker = tab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); }); parameters options : object optional options: name type contentscriptfile string,array the local file urls of content scripts to load.
... contentscript string,array a string or an array of strings of code to be evaluated in the context.
... a string telling you the load state of the document hosted by this tab.
content/worker - Archive of obsolete content
optional options: name type contentscriptfile string,array the local file urls of content scripts to load.
... contentscript string,array the texts of content scripts to load.
... parameters data : number,string,json the data to send.
... must be stringifiable to json.
places/favicon - Archive of obsolete content
the object can be a url string or a tab.
... let { getfavicon } = require("sdk/places/favicon"); // string example getfavicon("http://mozilla.org").then(function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); // tab example require("sdk/tabs").open({ url: "http://mozilla.org", onready: function (tab) { getfavicon(tab).then(function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); } }); // an optional callback can be provided to handle // the promise's resolve and reject states getfavicon("http://mozilla.org", function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/m...
...edia/img/favicon.ico }); parameters object : string|tab a value that represents the url of the page to get the favicon url from.
... can be a url string or a tab.
system/runtime - Archive of obsolete content
os a string identifying the current operating system.
... widgettoolkit a string identifying the target widget toolkit in use.
... xpcomabi a string identifying the abi of the current processor and compiler vtable.
... this string takes the form <processor>-<compilerabi>, for example: "x86-msvc" or "ppc-gcc3".
system/xul-app - Archive of obsolete content
parameters name : string a host application name.
... parameters version : string the version to compare.
... lowinclusive : string the lower bound of the version range to compare.
... highexclusive : string the upper bound of the version range to compare.
util/match-pattern - Archive of obsolete content
test strings containing urls against simple patterns.
... usage specifying patterns there are three ways you can specify patterns: as an exact match string using a wildcard in a string using a regular expression exact matches a url matches only that url.
... parameters pattern : string the pattern to use.
... parameters url : string the url to test.
Listening for Load and Unload - Archive of obsolete content
if your add-on exports a function called main(), then that function will be called whenever the add-on is loaded, and it will be passed an object containing a string describing the reason it was loaded as well as any arguments passed to it.
... if your add-on exports a function called onunload(), then that function will be called when the add-on is unloaded, and it will be passed a string describing the reason it was unloaded.
... options.loadreason options.loadreason is one of the following strings describing the reason your add-on was loaded: install enable startup upgrade downgrade exports.onunload() if your add-on exports a function called onunload(), that function will be called when the add-on is unloaded.
... exports.onunload = function (reason) {}; reason reason is one of the following strings describing the reason your add-on was unloaded: uninstall disable shutdown upgrade downgrade if your add-on is disabled, then uninstalled, your onunload listener will only be called once, with the disable reason.
Bootstrapped extensions - Archive of obsolete content
the data is a simple javascript object with the following properties: property type description id string the id of the add-on being bootstrapped.
... version string the version of the add-on being bootstrapped.
... 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.
Canvas code snippets - Archive of obsolete content
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...
... saving a canvas image to a file the following function accepts a canvas object and a destination file path string.
... ctx.save(); ctx.scale(remotecanvas.canvas_width / windowwidth, remotecanvas.canvas_height / windowheight); ctx.drawwindow(remotewindow, 0, 0, windowwidth, windowheight, 'rgb(255, 255, 255)'); ctx.restore(); }; usage: var remotecanvas = new remotecanvas(); remotecanvas.load(); convert image files to base64 strings the following code gets a remote image and converts its content to data uri scheme.
... { var image = new image(); image.src = url; return new promise((accept, reject) => { image.onload = accept; image.onerror = reject; }).then(accept => { canvas.width = this.width; canvas.height = this.height; ctxt.clearrect(0, 0, this.width, this.height); ctxt.drawimage(this, 0, 0); accept(canvas.todataurl()); }); } usage: loadimagefile('myimage.jpg').then(string64 => { alert(string64); }); if you want to get instead the base64 content of a local file using the file <input> element, you must use the filereader object.
HTML in XUL for rich tooltips - Archive of obsolete content
var htmltip = { onload: function() { //at any point you can save an html string to a xul attribute for later injection into the tooltip document.getelementbyid("htmltip1").setattribute("tooltiphtml", "<font color='red'>red foo</font>") document.getelementbyid("htmltip2").setattribute("tooltiphtml", "<font color='green'>green foo</font>") }, onmousetooltip: function(event) { //get the html tooltip string assigned to the element that the mouse is over (which will soon l...
...aunch the tooltip) var txt = event.target.getattribute("tooltiphtml"); // get the html div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.removechild(div.firstchild); //safely convert html string to a simple dom object, stripping it of javascript and more complex tags var injecthtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(txt, false, null, div); //attach the dom object to the html div element div.appendchild(injecthtml); } } window.addeventlistener('load', htmltip.onload, false); in the xul overlay, xmlns:html is used to enable html tags to be used inside the x...
...the tooltiphtml attribute is an html string which is set sometime beforehand for each element.
... for security reasons, the conversion will strip out some of the more dangerous elements in the html string, like javascript and iframes.
Post data to window - Archive of obsolete content
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"].
... createinstance(ci.nsistringinputstream); if ("data" in stringstream) // gecko 1.9 or newer stringstream.data = datastring; else // 1.8 or older stringstream.setdata(datastring, datastring.length); var postdata = cc["@mozilla.org/network/mime-input-stream;1"].
... createinstance(ci.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ...
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 = do_getservice("@mozilla.org/network/io-service;1"); ns_ensure_success(rv, rv); nscomptr<nsiuri> uriobj; rv = ioserv->newuri(uristring, uricharset, baseuri, getter_addrefs(uriobj)); if (ns_failed(rv)) { // may want to...
... handle ns_error_malformed_uri for // some applications return rv; } or, if the code can include nsnetutil.h: nscomptr<nsiuri> uriobj; nsresult rv = ns_newuri(getter_addrefs(uriobj), uristring, uricharset, baseuri); in all cases the baseuri can be null if the uristring should be treated as an absolute uri and uricharset can be null if there is no clear origin charset for the string (e.g.
... how to do security checks for uri loads before loading a uri, one of two security checks needs to be performed: if the uri is a string that will be loaded via passing the string to nsiwebnavigation::loaduri, the one must call checkloaduristrwithprincipal and pass the principal that the uri originates from as the first argument and the uri string as the second argument.
...if there is no nsiuri object on hand, it is secure to call checkloaduristrwithprincipal, but this will perform a more stringent security check than is strictly necessary.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
mozunit uses the same kind of notation, but you can also make the string the method name, making the test self-documenting.
... multiplication and division are implemented the same way, but what will you do if an invalid string is passed?
...use that as your search string.
... 4 - gonzui does not handle search strings with spaces very well; instead, go to the advanced search page, search on a few terms, and then use your browser’s find function to search for the “:” character.
JavaScript Object Management - Archive of obsolete content
*/ init : function() { this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); } }; 〈namespace〉.init(); }; js objects can also be treated as string-indexed arrays: // equivalent.
... */ init : function(aevent) { this._stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); // you can make changes to the window dom here.
...if you really need to do something like this anyway, one way to do it is to have a timeout execute the code after a delay: init : function(aevent) { let that = this; this._stringbundle = document.getelementbyid("xs-hw-string-bundle"); window.settimeout( function() { window.alert(that._stringbundle.getstring("xulschoolhello.greeting.label")); }, 0); } the settimeout function executes the function in the first parameter, after a delay in miliseconds specified by the second parameter.
...for example: _stringbundle, _createusernode().
Creating a dynamic status bar extension - Archive of obsolete content
function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher'); var output = httprequest.responsetext; if (output.length) { // remove whitespace from the end of the string; // this gets rid of the end-of-line characters output = output.replace(/\w*$/, ''); // build the tooltip string var fieldarray = output.split(','); // assert that fieldarray[0] == 'goog' samplepanel.label = 'goog: ' + fieldarray[1]; samplepanel.tooltiptext = 'chg: ' + fieldarray[4] + ' | ' + 'open: ' + fieldarray[5] + ' | ' + 'low: ' + fieldarray[6] +...
...we use the split() string function to split the comma-separated value string into its individual parts, with each field in a separate element in the array fieldarray.
...we then set the tooltip for the status bar panel by assigning an appropriate string to the samplepanel.tooltiptext property.
... the string is built from a combination of static strings and various elements from the fieldarray array.
No Proxy For configuration - Archive of obsolete content
limitations a domain, including sub-domains domain suffix "mozilla.org" does not block domains that end in the same string (amozilla.org) sub-domains domain suffix, starting with a dot ".mozilla.org" does not block the main domain (mozilla.org) a hostname (without domain) hostname-only (see problems below) "localhost" also blocks any possible domains that start with the entry ("www.otherdomain.localhost") a hostname (with domain) domain name "www.mozilla.org" does...
... not block hostnames or domains that end in the same string (other-www.mozilla.org) an ip address ip address "1.2.3.4" does not block hostnames that resolve to the ip address ("127.0.0.1" does not block "localhost") a network network w/ cidr block "10.0.0.0/8" does not block hostnames that resolve to the ip address range (10.0.0.0/8 is not "no proxy for intranet hostnames") optional - port-specific (optional) ":" + port number "<filter>:81" only black-lists port.
... all non-fqdn hosts, such as intranet hosts the string "<local>" (without quotes) "<local>" bypasses the proxy for all hostnames which have no periods in them.
... for example: "https://mycompanyintranet/" formats that are not accepted example domain filters with interior wildcards www.*.com ip address string prefixes 127.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
once called, it starts a drag for the string data "cabbage".
...the first is a string of html text and the second is a string of plain text.
...if you store it as a string, any object that accepts strings dragged onto it can grab the dragged data.
...we'll allow only one flavour here, that for a string.
Repackaging Firefox - Archive of obsolete content
of course, this strategy only works when your strings either do not need localization, or are programmatically localizable (for example, simply adding the locale to a url, like http://<locale>.example.com/).
...if you find a preference you think is generally useful to most partner repacks, please add it below, using the same style: localizable preferences browser.startup.homepage=<string> browser.startup.homepage_reset=<string> url for the default homepage, and what the homepage gets reset to when the user hits "restore to default" in the preferences.
... startup.homepage_welcome_url=<string> url to the first-run page.
... browser.search.defaultenginename=<string> name of the default search engine.
Using microformats - Archive of obsolete content
debug() returns a string that describes a microformat object.
... var dumpstring = debug(microformatobject) parameters microformatobject the microformat object to dump.
... return value a string that describes the contents of the specified microformat object.
... return value if the specified node is a microformat, the result is a space-delineated string listing all the microformat names that correspond to the node.
JavaScript crypto - Archive of obsolete content
cript 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 containing naming or enrollment info) are signed by the user signed blob is returned to the script script submits signed blob and any other necessary info to the ca/ra ca/ra verifies signature on signed blob ca/ra validates identity of user ca/ra sends wrapped encryption private key to kra kra sends escrow verification back to ca ca creates and signs certificates ...
...oad" value="submit"></p> </form> <script> /* the following values could be filled in by the server cgi */ var nickname= "mycertnickname"; var cert = "mkjflakdjfiwjflaksufklasf ..."; var forcebackup = false; function loadcertificate() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script> signing text domstring signtext(domstring stringtosign, domstring caoption /* ...
... */); loading pkcs #11 modules long deletemodule(domstring modulename); long addmodule(domstring modulename, domstring libraryfullpath, long cryptomechanismflags, long cipherflags); loads or removes a new pkcs #11 module.
... // arguments js_err_add_module = -5 // error adding a module js_err_bad_module_name = -6 // the module name is invalid js_err_add_module_duplicate = -10 // the module being installed has the // same name as one of the modules that // has already been installed miscellaneous domstring random(in long numbytes); unimplementedyou can use window.crypto.getrandomvalues instead.
Enabling Experimental Jetpack Features - Archive of obsolete content
methods import(stringmountpath string)imports the requested experimental feature into the script.
... stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted.
...string here is an example of how to import a feature (the clipboard) from the future.
...list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import().
Enabling - Archive of obsolete content
methods import(stringmountpath string)imports the requested experimental feature into the script.
... stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted.
...string here is an example of how to import a feature (the clipboard) from the future.
...list()returns an array of the set of potential stringmountpath as used in jetpack.future.import().
Enabling Experimental Jetpack Features - Archive of obsolete content
ArchiveMozillaJetpackdocsMetaFuture
methods import(stringmountpath string)imports the requested experimental feature into the script.
... stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted.
...string here is an example of how to import a feature (the clipboard) from the future.
...list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import().
New Security Model for Web Services - Archive of obsolete content
if the sandbox is unable to distinguish the common uri substring of the domain to be trusted from similar uris of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources.
... boolean canaccess(in nsiuri atransporturi, in astring atype); atransporturi - the service uri atype - type requested by the script ( ex.
...) return pr_true if access granted else pr_false void invalidatecache(in string atransporturi); invalidate cached entry for the given transport uri.
... empty the cache by passing in a empty string nswebscriptsaccess(implements nsiwebscriptsaccessservice) maintains access information, for servers, in an access-info-cache ( hashtable ).
Reading textual data - Archive of obsolete content
getservice(components.interfaces.nsiutf8converterservice); var data = utf8converter.converturispectoutf8 (str, "utf-8"); gecko 1.8 and newer reading strings starting with gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverterinputstream to read strings from a stream (nsiinputstream).
...using utf-8 for this example: */ "utf-8"; const replacementchar = components.interfaces.nsiconverterinputstream.default_replacement_character; var is = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); is.init(fis, charset, 1024, replacementchar); now you can read string from is: var str = {}; var numchars = is.readstring(4096, str); if (numchars != 0 /* eof */) var read_string = str.value; to read the entire stream and do something with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done with it (is.close()).
... if you do not want any replacement, you can specify 0x0000 as replacement character; that way, readstring will throw an exception when reaching unsupported bytes.
... earlier versions reading strings earlier versions of gecko do not provide easy ways to read unicode data from a stream.
Abc Assembler Tests - Archive of obsolete content
when run, the assembler tests include the abcasm/abs_helper.as file which defines the following functions: start(summary:string):void - start a new test section described by summary end():void - test section finished compare_stricteq(name:string, expected:*, actual:*):void - compare the results of a testcase where name is the testcase name compare_typeerror(name:string, expected:*, actual:*):void - special function for comparing typeerrors (runtimeerrors) - will only compare the first 22 chars of expected and actual s...
...compare_numbereq(name:string, expected:*, actual:*, fractiondigits:int=-1):void - compare 2 numbers up to fractiondigits this is to be used for high precision numbers that may vary slightly due to platform differences.
... * * ***** end license block ***** */ function main() { getlocal0 pushscope findproperty start pushstring "instructions that start with the letter l" callpropvoid start 1 newfunction .function_id(runtest) getlocal0 call 0 findproperty end callpropvoid end 0 returnvoid } function runtest() { // test null <= null == true findproperty compare_stricteq pushstring "null lessequals null" // testname pushtrue // 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 compare_typeerror 3 } finished_convert_o_null: } ...
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.
... version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517".
... xpisourcepath a string specifying the location of the differences file within the xpi file.
...you create this object by passing a string representing the directory to the getfolder method.
Properties - Archive of obsolete content
and then the rg string to the xpi url: (e.g.
... startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.arguments being argument_string #).
... note that spaces in the arg string are legal.
... everything after the question mark is treated as one string which becomes the install.arguments property.
setValue - Archive of obsolete content
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".
... value a winregvalue object representing the new non-string value.
...use this method if the value you want to set is not a string.
... if the value is a string, the setvaluestring method is more convenient.
Moving, Copying and Deleting Files - Archive of obsolete content
if you do not want to rename the file, and use the same name as the source file, use a null string for the second argument.
... in this last example, the destination filename is set to an empty string.
...if you do not want to rename the file and keep its existing name, use a null string for the second argument.
... var file = io.newfile("home", "myfile.txt"); var destination = io.newfile("temporary", ""); file.moveto(destination, ""); the second argument to nsifile.moveto() is an empty string to indicate that the same filename should be used.
How to implement a custom XUL query processor component - Archive of obsolete content
an empty string would be ok too.
... here is our sample javascript xpcom query processor: components.utils.import("resource://gre/modules/xpcomutils.jsm"); // basic wrapper for nsixultemplateresult function templateresult(adata) { this._data = adata; // just make a random number for the id this._id = math.random(100000).tostring(); } templateresult.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplateresult]), // private storage _data: null, // right now our results are flat lists, so no containing/recursion take place iscontainer: false, isempty: true, mayprocesschildren: false, resource: null, type: "simple-item", get id() { return this._id; }, // ret...
...from the beginning of the name var name = avar.tostring().slice(1); return this._data[name]; }, // return an object instead of a string for convenient comparison purposes // or null to say just use string value getbindingobjectfor: function(avar) { return null; }, // called when a rule matches this item.
... to create filters return this._data; }, generateresults: function(adatasource, aref, aquery) { // preform any query and pass the data to the result set return new templateresultset(this._data); }, addbinding: function(arulenode, avar, aref, aexpr) { // add a variable binding for a particular rule, which we aren't using yet }, translateref: function(adatasource, arefstring) { // if we return null, everything stops return new templateresult(null); }, compareresults: function(aleft, aright, avar) { // -1 less, 0 ==, +1 greater var leftvalue = aleft.getbindingfor(avar); var rightvalue = aright.getbindingfor(avar); if (leftvalue < rightvalue) { return -1; } else if (leftvalue > rightvalue) { return 1; } else { ...
Styling a Tree - Archive of obsolete content
getrowproperties : function(row,prop){} getcolumnproperties : function(column,columnelement,prop){} getcellproperties : function(row,column,prop){} from gecko 22 you can return a string of space-separated property names from these functions.
...we can use the interface nsiatomservice to construct string atoms for the properties.
... getservice(components.interfaces.nsiatomservice); props.appendelement(aserv.getatom("makeitblue")); } } the properties list requires an array of atom objects, which can be thought of as constant strings.
... from gecko 22 your function should return a string containing the property.
XPCOM Interfaces - Archive of obsolete content
components, however, are referred to using a uri like string.
...this component can be referred to using the string '@mozilla.org/file/local;1'.
... this string is called a contract id.
...note that they do not take a string parameter for the directory to copy or move to, but instead take an nsilocalfile.
XUL Questions and Answers - Archive of obsolete content
xul attributes such as left="100" or top="200", as well as corresponding properties, look as if they're integers but they are actually handled as strings.
... while the attributes are always strings per the dom specification, the properties will eventually be fixed to return the value with the correct type.
...json string) from the server, parsing it on client, and building the menupopup using dom methods (such as document.createelementns).
...pass a python string/int/etc to the method requiring an nsivariant.
key - Archive of obsolete content
ArchiveMozillaXULkey
keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute.
... keytext type: string a label for the keyboard shortcut.
... phase type: string the event phase where the handler is invoked.
...however, if one of the attributes is set to an empty string, the element doesn't handle any key events.
label - Archive of obsolete content
ArchiveMozillaXULlabel
href type: string defines a url to open when this element is clicked.
... value type: string the text to be used for the label.
... crop type: string gets and sets the value of the crop attribute.
... value type: string gets and sets the value of the value attribute.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
le-popup"> <menuitem label="new"/> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
... label type: string the label that will appear on the element.
... value type: string the string attribute allows you to associate a data value with an element.
... value type: string gets and sets the value of the value attribute.
preference - Archive of obsolete content
name type: string the name of the preference to change.
... int an integer string a string unichar a unicode string wstring a localized string.
... name type: string the name of the preference to change.
... type type: string gets and sets the value of the type attribute.
tab - Archive of obsolete content
ArchiveMozillaXULtab
label type: string the label that will appear on the element.
... crop type: string gets and sets the value of the crop attribute.
... label type: string gets and sets the value of the label attribute.
... value type: string gets and sets the value of the value attribute.
Using LDAP XPCOM with XULRunner - Archive of obsolete content
srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = mozldapstub library_name = mozldap_stub is_component = 1 force_shared_lib = 1 requires = \ xpcom \ string \ $(null) cppsrcs = ldapstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" ldapstubloader.cpp: // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "...
...prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h" static char const *const kdependentlibraries[] = { #ifdef ns_win32 moz_dll_prefix "nsldap32v50" moz_dll_suffix, moz_dll_prefix "nsldappr32v50" moz_dll_suffix, #endif //ns_win32 #ifdef ns_unix moz_dll_prefix "ldap50" moz_dll_suffix, moz_dll_prefix "prldap50" moz_dll_suffix, #endif //ns_unix nsnull }; // component.dll on windows, libcomponent.dll on linux static char krealcomponent[] = moz_dll_prefix "mozldap" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile...
...> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); prlibrary *lib; library->load(&lib); // 1) we don't care if this failed!
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); prlibrary *lib; rv = library->load(&lib); if (ns_failed(rv)) return rv; nsgetmoduleproc getmoduleproc = (nsgetmoduleproc) pr_findfunctionsymbol(lib, ns_get_module_symbol); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } then change your .mozconfig to add this line: ac_add_options --enable-extensions=ldapstub rebuild xulrunner.
NPN_UTF8FromIdentifier - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary returns the utf-8 string corresponding to the given string identifier.
... syntax #include <npruntime.h> nputf8 *npn_utf8fromidentifier(npidentifier identifier); parameters the function has the following parameter: <tt>identifier</tt> the string identifier whose corresponding string should be returned.
... returns a utf-8 string as a sequence of nputf8 bytes, or null if the specified <tt>identifier</tt> isn't a string identifier.
... description once the caller is done with the returned string, the caller is responsible for deallocating the memory used by the string by calling npn_memfree().
Using the W3C DOM - Archive of obsolete content
w3c dom2 reflection of an element's css positioning properties the values returned by the w3c dom2 style.left and style.top properties are strings that include the css unit suffix (such as "px"), whereas ie5+ elemref.style.pixelleft (and the corresponding properties for top) return an integer.
... so, if you want to get the element's inline style settings for left and top as integers, parse the integer from the string by using parseint().
... conversely, if you want to set the element's inline style settings for left and top, make sure to construct a string that includes the unit (such as "140px") by appending the unit string to the integer value.
... <body> <p>papa's got <span id="dynatext">a lot of nerve</span>!</p> <script type="text/javascript"> // get a reference to the span element var spanel = document.getelementbyid("dynatext"); // detect whether the browser supports textcontent or innertext if (typeof spanel.textcontent == 'string') { spanel.textcontent = 'some gall'; } else if (typeof spanel.innertext == 'string') { spanel.innertext = 'some gall'; // if neither are supported, use other dom methods } else { while (spanel.firstchild) { spanel.removechild(spanel.firstchild); } spanel.appendchild(document.createtextnode('some gall')); } </script> </body> the first part of the code gets a reference to the e...
The global XML object - Archive of obsolete content
to add a method to xml.prototype, define xml.prototype.function::methodname or xml.prototype.function::[methodnamestring].
...observe: var element = <foo> <!-- my comment --> <bar/> </foo>; element.comments().length(); // returns 0 element.toxmlstring(); // returns <foo><bar/></foo> xml.ignorecomments = false; element = <foo> <!-- my comment --> <bar/> </foo>; element.comments().length(); // returns 1 element.toxmlstring(); // returns <foo><!-- my comment --><bar/></foo> ignoreprocessinginstructions true by default.
...for example var element = <foo> <?process x="true"?> <bar/> <?process x="false"?> </foo>; element.toxmlstring(); // returns <foo><bar/></foo> xml.ignoreprocessinginstructions = false; var element = <foo> <?process x="true"?> <bar/> <?process x="false"?> </foo>; element.toxmlstring(); // returns <foo><?process x="true"?><bar/><?process x="false"?></foo> ignorewhitespace true by default.
...when true, toxmlstring() includes newlines and indenting for the serialization of e4x objects.
Debug.write - Archive of obsolete content
the debug.write function sends strings to the script debugger.
..., strn optional strings to send to the script debugger.
... remarks the debug.write function sends strings to the immediate window of a script debugger at run time.
...the only difference is that the debug.writeln function sends a newline character after the strings are sent.
Debug.writeln - Archive of obsolete content
the debug.writeln function sends strings to the script debugger, followed by a newline character.
..., strn optional strings to send to the script debugger.
... remarks the debug.writeln function sends strings, followed by a newline character, to the immediate window of the microsoft script debugger at run time.
...the only difference is that the debug.write function does not send a newline character after sending the strings.
GetObject - Archive of obsolete content
if pathname is a zero-length string (""), getobject returns a new object instance of the specified type.
...to do so, add an exclamation point (!) to the end of the file name and follow it with a string that identifies the part of the file you want to activate.
... for information on how to create this string, see the documentation for the application that created the object.
...with a single-instance object, getobject always returns the same instance when called with the zero-length string ("") syntax, and it causes an error if the pathname argument is omitted.
New in JavaScript 1.3 - Archive of obsolete content
ototype.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() date.prototype.getutcmilliseconds() date.prototype.toutcstring() date.prototype.setutcfullyear() date.prototype.setutcmonth() date.prototype.setutcdate() date.prototype.setutchours() date.prototype.setutcminutes() date.prototype.setutcseconds() date.prototype.setutcmilliseconds() other new features strict equality operators unicode support a javascript console was introduced.
... changes to string.prototype.replace().
... changes to tostring().
...ements label switch do...while export import built-in objects regexp methods of built-in objects tosource() object.prototype.watch() object.prototype.unwatch() function.arity function.prototype.apply() function.prototype.call() array.prototype.concat() array.prototype.pop() array.prototype.push() array.prototype.shift() array.prototype.slice() array.prototype.splice() string.prototype.concat() string.prototype.concat() string.prototype.match() string.prototype.search() string.prototype.slice() string.prototype.substr() ...
New in JavaScript 1.8.5 - Archive of obsolete content
bug 510537 date.prototype.tojson() returns a json format string for a date object.
...bug 429507 new ecmascript5 features get and set operators now allows the identifier to be numeric or a string.
... 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.
Archived JavaScript Reference - Archive of obsolete content
this operation leaves oldbuffer in a detached state.date.prototype.tolocaleformat()the non-standard tolocaleformat() method converts a date to a string using the specified formatting.
...see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties.
... it has been removed.object.prototype.__nosuchmethod__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.object.prototype.__parent__the __parent__ property used to point to an object's context, but it has been removed.object.prototype.eval()the object.eval() method used to evaluate a string of javascript code in the context of an object, however, this method has been removed.object.prototype.unwatch()the unwatch() method removes a watchpoint set with the watch() method.object.prototype.watch()the watch() method watches for a property to be assigned a value and runs a function when that occurs.object.unobserve()the object.unobserve() method was used to remove observers set by object.
...you can use the more general proxy object instead.reflect.enumerate()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.string.prototype.quote()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 (").
XForms Custom Controls - Archive of obsolete content
*/ string getcurrentvalue(); } notes: getcurrentvalue() should return the current value of the control as seen by a user.
... */ domstring getvalue(); /** * set value of instance node.
... */ void setvalue(in domstring value); /** * return true if the instance node is readonly as determined by the mdg.
...iv> </content> <implementation implements="nsixformsuiwidget"> <method name="refresh"> <body> <!-- set the src attribute on the html:img to be the simplecontent of the instance node bound to this control --> var img = document.getanonymouselementbyattribute(this, "anonid", "content"); img.setattribute("src", this.stringvalue); return true; </body> </method> </implementation> </binding> </bindings> <xf:model> <xf:instance xmlns=""> <data> <curimg></curimg> <img label="firefox">http://www.mozilla.com/images/firefox-logo-64x64.png</img> <img label="thunderbird">http://www.mozilla.com/images/thunderbird-logo-64x64.png</img> <img label="bugzilla">http://www.mozilla.or...
Implementation Status - Archive of obsolete content
4.8.1 getinstancedocument() 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:listitems supported 5.2.4 xforms:daytimeduration supported 5.2.5 xforms:yearmonthduration supported 5.2.6 xforms:email unsupported 5.2.7 xforms:card-number unsupported supported types: string, normalized string, token, language, boolean, gday, gmonth, gyear, gyearmonth, gmonthday, date, time, datetime, duration, integer, nonpositiveinteger, negativeinteger, positiveinteger, long, int, short, unsignedlong, unsignedint, unsignedshort, byte, unsignedbyte, float, decimal, anyuri, base64binary, hexbinary, qname 6.
...epeat won't be bound correctly 333638; 7.4.5 ui binding in other xml vocabularies unsupported not a compliance requirement for an xforms processor 7.4.6 binding examples supported 7.5 xforms core function library supported 7.6.1 boolean-from-string() supported 7.6.2 is-card-number() unsupported 7.7.1 avg() supported 7.7.2 min() supported 7.7.3 max() supported 7.7.4 count-non-empty() supported ...
... seconds-to-datetime() unsupported 7.9.8 adjust-datetime-to-timezone() unsupported 7.9.9 seconds() supported 7.9.10 months() supported 7.10.1 instance() partial instance() won't work with no parameter or empty string as a parameter 419190; 7.10.2 current() supported 7.10.3 id() unsupported 7.10.4 context() unsupported 7.11.1 choose() unsupported 7.11.2 event() supported 7...
Visual typescript game engine - Game development
* @property drawreference * @type string */ private drawreference: string = "frame"; /** * aspectratio default value, can be changed in run time.
... */ private domain: string = "maximumroulette.com"; /** * networkdeeplogs control of dev logs for webrtc context only.
... */ private masterserverkey: string = "multi-platformer-sever1.maximum"; /** * rtcserverport port used to connect multimedia server.
... */ private appusebroadcaster: boolean = false; /** * possible variant by default : * "register", "login" */ private startuphtmlform: string = "register"; private gamelist: any[]; /** * implement default gameplay variable's */ private defaultgameplaylevelname: string = "level1"; private autostartgameplay: boolean = true; start the dependency system from app.ts the first game template is platformer.
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
strings and numbers are immutable.
... lets understand this with an example: var immutablestring = "hello"; // in the above code, a new object with string value is created.
... immutablestring = immutablestring + "world"; // we are now appending "world" to the existing value.
... on appending the "immutablestring" with a string value, following events occur: existing value of "immutablestring" is retrieved "world" is appended to the existing value of "immutablestring" the resultant value is then allocated to a new block of memory "immutablestring" object now points to the newly created memory space previously created memory space is now available for garbage collection.
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
hackers use a simple string called a magical string, for example: username: admin password: anything 'or'1'='1 after clicking on the login button, the sql query will work as follows: "select count(*) from users where username=' admin ' and password=' anything 'or'1'='1 ' "; just take a closer look at the above query's password section.
...just due to a simple string (magical string) the entire database is compromised.
... how to prevent before executing the queries for the user credentials, make some changes like the following: $id = $_get['id'] (1) $id = stripslashes($id) (2) $id = mysql_real_escape_string($id) so due to (1) each single quote (') in the input string is replaced with double quotes ("), and due to (2) before every (') it adds (/).
... the revised magical string fails to bypass the authentication, and your database stays secure.
Pseudo-classes and pseudo-elements - Learn web development
you could use these to insert a string of text, such as in the live example below.
... inserting strings of text from css isn't really something we do very often on the web however, as that text is inaccessible to some screen readers and might be hard for someone to find and edit in the future.
... a more valid use of these pseudo-elements is to insert an icon, for example the little arrow added in the example below, which is a visual indicator that we wouldn't want read out by a screenreader: these pseudo-elements are also frequently used to insert an empty string, which can then be styled just like any element on the page.
... in this next example, we have added an empty string using the ::before pseudo-element.
Getting started with HTML - Learn web development
key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
...key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
...<!doctype html> is the shortest string of characters that counts as a valid doctype.
...key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
Functions — reusable blocks of code - Learn web development
every time we manipulated a text string, for example: let mytext = 'i am a string'; let newstring = mytext.replace('string', 'sausage'); console.log(newstring); // the replace() string function takes a source string, // and a target string and replaces the source string, // with the target string, and returns the newly formed string or every time we manipulated an array: let myarray = ['i', 'love', 'chocolate', 'frogs']; let madeast...
...ring = myarray.join(' '); console.log(madeastring); // the join() function takes an array, joins // all the array items together into a single // string, and returns this new string or every time we generated a random number: let mynumber = math.random(); // the random() function generates a random number between // 0 and up to but not including 1, and returns that number ...we were using a function!
...when called, it always returns a random number between 0 and 1: let mynumber = math.random(); the browser's built-in string replace() function however needs two parameters — the substring to find in the main string, and the substring to replace that string with: let mytext = 'i am a string'; let newstring = mytext.replace('string', 'sausage'); note: when you need to specify multiple parameters, they are separated by commas.
...as an example, the array join() function's parameter is optional: let myarray = ['i', 'love', 'chocolate', 'frogs']; let madeastring = myarray.join(' '); // returns 'i love chocolate frogs' let madeastring = myarray.join(); // returns 'i,love,chocolate,frogs' if no parameter is included to specify a joining/delimiting character, a comma is used by default.
Function return values - Learn web development
let's return to a familiar example (from a previous article in this series): let mytext = 'the weather is cold'; let newstring = mytext.replace('cold', 'warm'); console.log(newstring); // should print "the weather is warm" // the replace() string function takes a string, // replaces one substring with another, and returns // a new string with the replacement made the replace() function is invoked on the mytext string, and is passed two parameters: the substring to find ('cold').
... the string to replace it with ('warm').
... when the function completes (finishes running), it returns a value, which is a new string with the replacement made.
... in the code above, the result of this return value is saved in the variable newstring.
Making decisions in your code — conditionals - Learn web development
any value that is not false, undefined, null, 0, nan, or an empty string ('') actually returns true when tested as a conditional statement, therefore you can simply use a variable name on its own to test whether it is true, or even that it exists (that is, it is not undefined.) so for example: let cheese = 'cheddar'; if (cheese) { console.log('yay!
...abbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.o...
...remember that color values are strings, so need to be wrapped in quotes.
...abbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.o...
Client-side storage - Learn web development
storing simple data — web storage the web storage api is very easy to use — you store simple name/value pairs of data (limited to strings, numbers, etc.) and retrieve these values when needed.
... storing complex data — indexeddb the indexeddb api (sometimes abbreviated idb) is a complete database system available in the browser in which you can store complex related data, the types of which aren't limited to simple values like strings or numbers.
...we do however need to pass the attribute through the global built-in number() object as it is of datatype string, and therefore wouldn't be recognized by the database, which expects a number.
... storing complex data via indexeddb as we mentioned above, indexeddb can be used to store more than just simple text strings.
Fetching data from the server - Learn web development
this can be done with replace(), tolowercase(), and simple string concatenation.
...it also returns a promise (which resolves to the resulting text string), so here we use another .then(), inside of which we define another function that dictates what we want to do with that text string.
... we are just setting the textcontent property of our poem's <pre> element to equal the text string, so this works out pretty simple.
... there is quite a lot of complex code that deals with filtering the products by category and search terms, manipulating strings so the data displays correctly in the ui, etc.
What is JavaScript? - Learn web development
operations on pieces of text (known as "strings" in programming).
... in the above example we take the string "player 1: " and join it to the name variable to create the complete text label, e.g.
... // i am a comment a multi-line comment is written between the strings /* and */, e.g.
...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
after that, we discuss some key building blocks in detail, such as variables, strings, numbers and arrays.
... handling text — strings in javascript next we'll turn our attention to strings — this is what pieces of text are called in programming.
... in this article we'll look at all the common things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in string, and joining them together.
... 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.
JavaScript object basics - Learn web development
the syntax always follows this pattern: const objectname = { member1name: member1value, member2name: member2value, member3name: member3value }; the value of an object member can be pretty much anything — in our person object we've got a string, a number, two arrays, and two functions.
...it is no wonder that objects are sometimes called associative arrays — they map strings to values in the same way that arrays map numbers to values.
... so when you used string methods like: mystring.split(','); you were using a method available on an instance of the string class.
... every time you create a string in your code, that string is automatically created as an instance of string, and therefore has several common methods and properties available on it.
Object prototypes - Learn web development
you will however also see some other members — tostring, valueof, etc — these are defined on person1's prototype object's prototype object, which is object.prototype.
... so object.prototype.tostring(), object.prototype.valueof(), etc., are available to any object types that inherit from object.prototype, including new object instances created from the person() constructor.
... you'll see other examples of prototype chain inheritance all over javascript — try looking for the methods and properties defined on the prototype of the string, date, number, and array global objects, for example.
... these all have a number of members defined on their prototype, which is why for example when you create a string, like this: let mystring = 'this is my string.'; mystring immediately has a number of useful methods available on it, like split(), indexof(), replace(), etc.
Test your skills: Object basics - Learn web development
the required members are: name: a string representing the band name.
... nationality: a string representing the country the band comes from.
...each array item should be an object containing the following members: name: a string representing the name of the album.
... once you've done this, you should then write a string to the variable bandinfo, which will contain a small biography detailing their name, nationality, years active, and style, and the title and release date of their first album.
Adding a new todo form: Vue events, methods, and models - Learn web development
we can set the initial value of the label to an empty string.
...so in our case, our event object will just be a string.
...since name is already being trimmed by the .trim directive, we only need to test for the empty string.
...but this is easy to fix — because we're using v-model to bind the data to the <input> in todoform, if we set the name parameter to equal an empty string, the input will update as well.
Chrome registration
contract contract @foobar/mycontract;1 {00000000-0000-0000-0000-000000000000} [flags] maps a contract id (a readable string) to the classid for a specific implementation.
...the skinname is an opaque string identifying an installed skin.
...the version string must conform to the toolkit version format.
... note: versions of gecko before gecko 1.8.0.13 and gecko 1.8.1.5 contained a bug where if you use the comparisons <, > or =, the version string had be two or more characters long.
Reviewer Checklist
make sure the patch doesn't create any unused code (e.g., remove strings when removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable information, but also considering the expense of computing and recording log output.
...which one you choose depends on how the feature is implemented: a pure java service can't easily check gecko prefs, for example.] strings there should be no string changes in patches that will be uplifted (including string removals).
... rev entity names for string changes.
... when making ui changes, be aware of the fact that strings will be different lengths in different locales.
Displaying Places information using views
getservice(ci.nsinavhistoryservice); var query = histserv.getnewquery(); query.searchterms = "mozilla"; query.onlybookmarked = true; var opts = histserv.getnewqueryoptions(); opts.querytype = opts.query_type_bookmarks; var uri = histserv.queriestoquerystring([query], 1, opts); var tree = document.getelementbyid("mytree"); tree.place = uri; these two examples use the built-in tree view, but the point is to demonstrate the use of the place attribute and property.
... void applyfilter( string filterstring, array folderrestrict ); parameters filterstring the new query's searchterms property will be set to this string.
... void selectplaceuri( string placeuri ); parameters placeuri the uri (as a string) of the nsinavhistoryresultnode to select.
... onopenflatcontainer string the body of function that will be called when a container is toggled.
Security best practices for Firefox front-end engineers
existing security controls sanitizing all strings that enter the dom through apis such as innerhtml when running system-privileged chrome code, we sanitize all html fragments that are created for chrome-privileged documents.
... this policy includes all dom apis that take a string and parse it into a dom tree.
...the linter makes an exception for code that uses string literals that are hard coded in the source code, assuming benevolent developers.
... developers are able to avoid tripping the rule by using escaping functions in combination with template strings, for example: bar.innerhtml = escapehtml`<a href='${url}'>about</a>`; in system-privileged chrome code, any kind of remaining scripts will still be removed by our sanitizer.
HTMLIFrameElement.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.
... syntax instanceofhtmliframeelement.findall(searchstring, casesensitivity); returns void.
... parameters searchstring the string you want to search for in the browser <iframe>'s text.
... casesensitivity a string to declare whether you want the search to be case sensitive (case-sensitive) or insensitive (case-insensitive.) example the following function is taken from our browser api demo, and executes a search when a search form is submitted.
mozbrowsericonchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: href a domstring representing the path to the new icon.
... sizes a domstring listing the sizes the new icon is available in, e.g.
...the any keyword can also be used, to represent "any size." rel a domstring representing the rel attribute value from the <link> element used to link to the icon.
mozbrowseropenwindow
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: url a domstring representing the url of the document loaded within the frameelement property.
... name a domstring representing the name of the new browser window.
... features a domstring containing features represented by a list of names and values separated by commas.
mozbrowsersecuritychange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of ssl security.
... trackingstate a domstring representing the current loading state of tracking content.
... mixedstate a domstring representing the current loading state of mixed active content.
Overview of Mozilla embedding APIs
nsstring there are a collection of string classes which support both unicode and ascii strings.
... these classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data.
... see the string guide for more details.
... ns_convertasciitoucs2 this is a helper class which converts an ascii string into a ucs2 string.
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 constant description err...
... updateinfo getcompatibilityupdate( in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion ) parameters updates an array of update objects version the version of the add-on to get new compatibility information for ignorecompatibility an optional parameter to get the first compatibility update that is compatible with any version of the application or toolkit appversion the version o...
... updateinfo getnewestcompatibleupdate( in updateinfo updates[], in string appversion, in string platformversion ) parameters updates an array of update objects appversion the version of the application or null to use the current version platformversion the version of the platform or null to use the current version checkforupdates() starts an update check.
... void checkforupdates( in string id, in string type, in string updatekey, string url, in updatechecklistener listener ) parameters id the id of the add-on being checked for updates type the type of add-on being checked for updates updatekey an optional update key for the add-on url the url of the add-on's update manifest listener an observer to notify of results ...
UpdateInfo
attributes attribute type description version string the version of the update.
... updateurl string the updateurl that the update can be downloaded from.
... updatehash string a hash for the update's file.
... updateinfourl string a url containing simple release notes for the update.
Http.jsm
httprequest supports the following parameters: name meaning headers an array of headers postdata this can be: a string: send it as is an array of parameters: encode as form values null/undefined: no post data.
...postdata can be of 2 different types: a string or an array of parameters.
...if a string is given the data will be appended to the request as is.
...if the provided postdata is a string, the content type isn't touched.
Following the Android Toasts Tutorial from a JNI Perspective
the sig's will be represented 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 o...
...because we don't want to keep typing string signatures everywhere, we can end up with typos and hard to trace back errors, we use the sig object.
...for example, let's declare this with strings: { name: 'maketext', sig: '(landroid/content/context;ii)landroid/widget/toast;' } we see there are no separating characters between the arguments.
...this is special: because a charsequence is an array of byte characters, we can pass simple javascript strings to jni.jsm wherever a charsequence is needed.
L10n Checks
you pass both paths to the files, e.g.: check-l10n-completeness -i file en-us.dtd my.dtd the output the output of l10n checks shows the missing and obsolete strings in a pseudo-diff format.
...oltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name.
...the output closes with a summary, giving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and command keys.
...0 - quiet; 5 - show all messages merge in the source mode you can tell l10n checks to merge missing strings and files into the locale files by setting a merge directory, e.g.: check-l10n-completeness -m output_dir suite/locales/l10n.ini ../l10n/ de note: only files which were merged will be saved in that directory.
L10n testing with xcode
xcode will import your translated strings into the project by adding them to the project folder and replacing the existing strings.
... navigate to the newly opened ios simulator window many strings are accessibility strings and are only revieled when a user hovers their finger over the button.
... to view these strings, you'll need to start the accessibility inspector within the ios simulator by doing the following.
... now, you can navigate through the firefox app in the ios simulator, viewing both ui elements and accessibility strings as you go.
Localization technical reviews
compare-locale we run the compare-locales tool on the new locale to get the statistics on translation of strings and report basic errors.
... string lengths in pipnss.properties there are some character limits in the security/manager/chrome/pipnss/pipnss.properties file that you should be aware of.
... it is best to look into each of these files to see if the localizer's strings might be too long.
...to put it simply, when we receive your request, we expect that you have spent time testing your work and making sure all strings have been localized and that your language pack is relatively functional.
Uplifting a localization from Central to Aurora
that indicates that the same string has different translations on l10n-central and aurora, and you really want to make sure that your aurora clone doesn't have quality issues.
...say, en-us removed a string for the release+2, and you fixed a typo in the string that still exists in release+1.
... so you fixed the string on aurora, and you removed the broken string on central.
... that's gonna conflict, and you need to resolve that with your merge tool so that the resulting localized file doesn't have the string any more.
L20n HTML Bindings
<link rel="localization" href="../locales/manifest.json"> an example of the manifest file (all keys are required): { "locales": [ "en-us", "pl"], "default_locale": "en-us", "resources": [ "../locales/{{locale}}/strings.l20n", "/shared/{{locale}}/date.l20n"¨ ] } make html elements localizable use the data-l10n-id attribute on an html element to mark it as localizable.
... <script type="application/l10n-data+json"> { "newnotifications": 3, "user": { "name": "jane", "gender": "feminine" } } </script> this data will be available context-wide to all localized strings.
... for instance, a string could use the information about the user's gender to provide two variants of the translation, like in the example below.
... <script type="application/l20n" src="../locales/strings.l20n"></script> note that you currently cannot use the manifest file and manually add resources via script tags at the same time (bug 923670).
Midas
the given string is such as would be used in the "face" attribute of the font tag, i.e., a comma-separated list of font names.
... inserthorizontalrule null/string (when string is the line's id) this command will insert a horizontal rule (line) at the insertion point.
... inserthtml a string.
... the given string is the html to insert.
PL_strcpy
copies a string, up to and including the trailing '\0', into a destination buffer.
...on output, the buffer contains a copy of the string passed in src.
... src pointer to the string to be copied.
...description if the string specified by src is longer than the buffer specified by dest, the buffer will not be null-terminated.
PL_strdup
returns a pointer to a new memory node in the nspr heap containing a copy of a specified string.
... syntax #include <plstr.h> char *pl_strdup(const char *s); parameter the function has a single parameter: s the string to copy, may be null.
... returns the function returns one of these values: if successful, a pointer to a copy of the specified string.
... description to accommodate the terminator, the size of the allocated memory is one greater than the length of the string being copied.
PR_GetNameForIdentity
gets the string associated with a layer's unique identity.
... returns the function returns one of the following values: if successful, the function returns a pointer to the string associated with the specified layer.
... description a string may be associated with a layer when the layer is created.
... the string is copied by the runtime, and pr_getnameforidentity returns a pointer to that copy.
FC_Initialize
libraryparameters should point to a string that contains the library parameters.
... the library parameters string has this format: "configdir='dir' certprefix='prefix1' keyprefix='prefix2' secmod='file' flags= " here are some examples.
... nss_nodb_init(""), which initializes nss with no databases: "configdir='' certprefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,forceopen,optimizespace " mozilla firefox initializes nss with this string (on windows): "configdir='c:\\documents and settings\\wtc\\application data\\mozilla\\firefox\\profiles\\default.7tt' certprefix='' keyprefix='' secmod='secmod.db' flags=optimizespace manufacturerid='mozilla.org' librarydescription='psm internal crypto services' cryptotokendescription='generic crypto services' dbtokendescription='software security device' cryptoslotdescription='psm internal cryptographic services' dbslotdescription='psm private keys' fipsslotdescription='psm internal fips-140-1 cryptographic services' fipstokendescription='psm fips-140-1 user private key serv...
...ices' minps=0" see pkcs #11 module specs for complete documentation of the library parameters string.
Rhino overview
array.prototype.tostring and object.prototype.tostring version 1.2 only returns array or object literal notation ("[1]" or "{a:1, b:2}" for example).
... string.prototype.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one.
... string.prototype.split for version 1.2 only, split performs the perl4 special case when given a single space character as an argument (skips leading whitespace, and splits on whitespace).
...in a typical client embedding, this object might be a string with the url of the server that supplied the script, or an object that contains a representation of the signers of a piece of code for certificate-based security policies.
Invariants
there may be other reasons that cover more cases, but nobody can remember one.) all jsobjects and heap-allocated jsstrings must be 8-byte-aligned.
... lifetime invariants in some places, pointers to jsobjects and jsstrings must refer to live heap objects, but this is not a hard fast rule, especially for strings.
... some jsstrings are allocated on the stack for quick operations.
... some commonly used strings are allocated statically; see jsstring::isstatic().
JS::Remove*Root
syntax void removevalueroot(jscontext *cx, js::heap<js::value> *vp); void removestringroot(jscontext *cx, js::heap<jsstring *> *rp); void removeobjectroot(jscontext *cx, js::heap<jsobject *> *rp); void removescriptroot(jscontext *cx, js::heap<jsscript *> *rp); void removevaluerootrt(jsruntime *rt, js::heap<js::value> *vp); void removestringrootrt(jsruntime *rt, js::heap<jsstring *> *rp); void removeobjectrootrt(jsruntime *rt, js::heap<jsobject *> *rp); void removescriptrootrt...
... rp js::heap<jsstring *> address of the jsstring * variable to remove from the root set.
... this must have been passed to either js::addstringroot or js::addnamedstringroot.
... see also mxr id search for js::removevalueroot mxr id search for js::removestringroot mxr id search for js::removeobjectroot mxr id search for js::removescriptroot mxr id search for js::removevaluerootrt mxr id search for js::removestringrootrt mxr id search for js::removeobjectrootrt mxr id search for js::removescriptrootrt bug 912581 bug 1107639 ...
JS_CompileFunction
creates a javascript function from a text string.
... body const char * or const jschar * string containing the body of the function to compile.
... description js_compilefunction compiles a function from a text string, bytes, and optionally associates it with a js object, obj.
... body is a string containing the source code of the function.
JS_DefineProperty
unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, uint3...
...ptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char1...
...ed attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_definepropertybyid(jscontext *cx, js::handleobject obj, ...
... value js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double initial stored value for the new property.
JS_GetTypeName
returns a pointer to the string literal description of a specified js data type.
... type jstype one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean.
... description js_gettypename returns a pointer to a string literal description of a specified js data type, type.
... the following table lists jstypes and the string literals reported by js_gettypename: type literal jstype_void "undefined" jstype_object "object" jstype_function "function" jstype_string "string" jstype_number "number" jstype_boolean "boolean" any other value null see also js_convertvalue js_typeofvalue js_valuetoboolean js_valuetofunction js_valuetoint32 js_valuetonumber js_valuetoobject js_valuetostring bug 1037718 ...
JS_Remove*Root
syntax jsbool js_removevalueroot(jscontext *cx, jsval *vp); jsbool js_removestringroot(jscontext *cx, jsstring **spp); jsbool js_removeobjectroot(jscontext *cx, jsobject **opp); jsbool js_removegcthingroot(jscontext *cx, void **rp); name type description cx jscontext * a context.
... spp jsstring * address of the jsstring* variable to remove from the root set.
... this must have been passed to either js_addstringroot or js_addnamedstringroot.
...see also mxr id search for js_removevalueroot mxr id search for js_removestringroot mxr id search for js_removeobjectroot mxr id search for js_removegcthingroot bug 912581 ...
jschar
jschar is the type of javascript "characters", the 16-bit elements that make up strings.
...(see bug 1063962.) as required by the ecmascript standard, ecma 262-3 §4.3.16", javascript strings are arbitrary sequences of 16-bit values.
... a string may contain unmatched surrogates, which are not valid utf-16.
... to get the characters of a javascript string, use js_getstringchars.
SpiderMonkey 1.8
now this statement stores the string "7" in x.
... it was possible to configure spidermonkey 1.7 to treat c/c++ char strings as utf-8 by compiling with a non-default compiler option.
...applications can turn on utf-8 at run time by calling js_setcstringsareutf8.
... js_encodestring is a new variation on js_getstringbytes that returns a newly allocated, writable buffer which the application must js_free.
SpiderMonkey 31
this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location.
... these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.).
... obsolete apis js_convertarguments "j" type deleted apis js_newgrowablestring (can be replaced with js_newucstring) js_isconstructing (can be replaced with callargs::isconstructing or callreceiver::isconstructing) js_valuetoboolean (replaced by js::toboolean) js_valuetonumber (can be replaced with js::tonumber) js_valuetoint64 (replaced by js::toint64) js_valuetouint64 (replaced by js::touint64) js_valuetoecmauint32 (replaced by js::touint32) js_valuetoecmaint32 (re...
...placed by js::toint32) js_valuetoint32 (can be replaced with js::toint32, which has a different behavior!) js_valuetouint16 (replaced by js::touint16) js_valuetostring (replaced by js::tostring) js_definepropertywithtinyid js_defineucpropertywithtinyid js_getobjectid api changes spidermonkey must now be initialized before it can be used.
Running Automated JavaScript Tests
another common use case is to run just one test, or all the tests in just one directory: jstests.py path_to_js_shell test_path_substring [ test_path_substring_2 ...
... ] this runs all the tests whose paths contain test_path_substring.
... thus, you can run one test by giving its filename, or any substring that is a substring of that test filename only.
... running jstest in a browser jstests also runs on browser, with the following command: ./mach jstestbrowser to run specific test, you can use --filter=pattern command-line argument, where pattern is a regexp pattern that is tested against file:///{path_to_obj_dir}/dist/test-stage/jsreftest/tests/jsreftest.html?test={relative_path_to_test_from_js/src/tests} string: ./mach jstestbrowser --filter=pattern running jstests on treeherder when viewing treeherder after a push to the mozilla repositories, jstests run in the browser are shown as r(j) meaning "javascript reftests".
SavedFrame
to see the stack as the content compartment sees it, waive the xray wrapper with components.utils.waivexrays: const contentviewofstack = components.utils.waivexrays(somestack); accessor properties of the savedframe.prototype object source the source url for this stack frame, as a string.
... asynccause if this stack frame is the asyncparent of other stack frames, then this is a string representing the type of asynchronous call by which this frame invoked its children.
...if the asynchronous call was started in a descendant frame to which the requester of the property does not have access, this will be the generic string "async".
... function properties of the savedframe.prototype object tostring return this frame and its parents formatted as a human readable stack trace string.
compare-locales
to get a single result across the projects, specify the --unified flag: $ compare-locales --unified browser/locales/l10n.toml mobile/android/locales/l10n.toml ./l10n/ de cross-channel and compare-locales if you're working against the gecko-strings cross-channel repository, the toml configuration files are in the _configs subdirectory, browser.toml, mobile_android.toml, mail.toml and calendar.toml, and suite.toml.
... options to get a brief list of available options, use the --help flag: $ compare-locales --help the output the output of compare-locales shows the missing and obsolete strings in a pseudo-diff format.
...ltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name.
... the output closes with a summary, giving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys.
Feed content access API
nsiscriptableunescapehtml a utility class that unescapes html strings.
...use an xmlhttprequest to load the feed, then pass its string to an nsifeedprocessor to parse the feed.
...es.nsiioservice); var uri = ioservice.newuri(feedurl, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); var listener = new feedtestresultlistener(); try { parser.listener = listener; parser.parsefromstring(data, uri); } catch(e) { alert("error parsing feed."); } } } httprequest = new xmlhttprequest(); httprequest.open("get", feedurl, true); try { httprequest.onload = inforeceived; httprequest.send(null); } catch(e) { alert(e); } } the nsifeedprocessor interface lets you parse the feed data from several possib...
...le sources; in this case, we're loading a document into a string, then parsing that string using its parsefromstring() method.
extISessionStorage
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.
... boolean has(in astring aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise.
... void set(in astring aname, in nsivariant avalue) parameters aname the name of an item return value get() gets the value of a storage item with the given name.
... nsivariant get(in astring aname, in nsivariant adefaultvalue) parameters aname the name of an item return value value of the item or the given default value if no item exists with the given name.
XML Extras
feature status feature status xmlserializer available xmlhttprequest available domparser (string and stream input source) available web services with soap and wsdl no longer available from gecko 1.9/firefox 3.
... begins with lower case letter xmlhttprequest creation new activexobject("msxml2.xmlhttp") new xmlhttprequest() xmlhttprequest.send("some string") ok ok starting with milestone 0.9.7 (actually nightly 2001-11-28).
... with older builds, passing strings to send() works only in chrome, see post.html sample.
... the "workaround" is to use domparser object's parsefromstring() method to create a document from string, and pass the temporary document into send().
An Overview of XPCOM
the application code used an interface from a library, stdio, to print the "hello world" string out to the screen.
...of the three methods on the nsiid class, equals, parse, and tostring, equals is by far the most important, because it is used to compare two nsiids in this interface querying process.
... contract id a contract id is a human readable string used to access a component.
...you can not have two methods with the same name that take different parameters, and the workaround - having multiple function names - isn't pretty: void foowithint(in int x); void foowithstring(in string x); void foowithuri(in nsiuri x); however, these shortcomings pale in comparison to the functionality gained by using xpidl.
XPCOM hashtable guide
any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else.
... data type hashtable class none (for a hash set) nsthashtable simple types (numbers, booleans, etc) nsdatahashtable structs or classes (nsstring, custom defined structs or classes that are not reference-counted) nsclasshashtable reference-counted concrete classes nsrefptrhashtable interface pointers nsinterfacehashtable each of these classes is a template with two parameters.
... key type hashkey class strings nsstringhashkey/nscstringhashkey integers nsuint32hashkey/nsuint64hashkey pointers nsptrhashkey<t> owned interface pointers nsisupportshashkey reference-counted concrete classes nsrefptrhashkey there are a number of more esoteric hashkey classes in nshashkeys.h, and you can always roll your own if none of these fit your needs (make sure you're not duplicating an existing hashkey class though!) once you've determined what hashtable and hashkey classes you need, you can put it all together.
... a few examples: a hashtable that maps utf-8 origin names to a dom window - nsinterfacehashtable<nscstringhashkey, nsidomwindow> a hashtable that maps 32 bit integers to floats - nsdatahashtable<nsuint32hashkey, float> a hashtable that maps nsisupports pointers to reference counted cacheentrys - nsrefptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<nsptrhashkey<jscontext>, contextinfo> a hashset of strings - nsthashtable<nsstringhashkey> hashtable api the hashtable classes all expose the same basic api.
Observer Notifications
the data value is a string form of the domain.
... data is a string form of the origin (for use in security checks), eg "http://developer.mozilla.org".
... remote-listening string sent after when the remote agent is listening for incoming connections after remoteagent.listen() is called.
... the data is a string containing a fully qualified url to the main target’s websocket endpoint.
EndReading
« xpcom api reference summary the endreading function returns a const char_type pointer to the element just beyond the last element of the string's internal buffer.
... const char_type* endreading() const; remarks it is generally illegal to dereference the returned pointer, unless it is known that the string's internal buffer is null-terminated.
... the ns_cstringgetdata function can be used to determine if a nsacstring instance has null-terminated storage.
... see also beginreading, ns_cstringgetdata, nsacstring ...
EndReading
« xpcom api reference summary the endreading function returns a const char_type pointer to the element just beyond the last element of the string's internal buffer.
... const char_type* endreading() const; remarks it is generally illegal to dereference the returned pointer, unless it is known that the string's internal buffer is null-terminated.
... the ns_cstringgetdata function can be used to determine if a nsastring instance has null-terminated storage.
... see also beginreading, ns_cstringgetdata, nsastring ...
operator+=
self_type& operator+=( const self_type& astring ); parameters astring [in] a nsastring to append to this string.
... self_type& operator+=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator+=( char_type achar ); parameters achar [in] a character to append to this string.
...see also append parameters astring [in] a nsastring to append to this string.
IAccessibleEditableText
the substrings used with this interface are specified as follows: if startoffset is less than endoffset, the substring starts with the character at startoffset and ends with the character just before endoffset.
...if both indices have the same value, an empty string is defined.
...the specified string is inserted at the given index into the text represented by this object.
...the text between the two given indices is replaced by the specified replacement string.
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.
...the value of the property should either be a string url, or an object with the following properties: url for the add-on's url iconurl for an icon for the add-on hash for a hash of the add-on.
... boolean installchrome( in pruint32 atype, in astring aurl, in astring askin ); parameters atype unused, retained for backwards compatibility.
... boolean startsoftwareupdate( in astring aurl, in print32 aflags optional ); parameters aurl the url of the add-on.
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 getrowdescription(in long rowindex); long getrowextentat(in long ...
... note: renamed from selectedrowscount in gecko 1.9.2 summary astring the summary description for the table.
... astring getcolumndescription( in long columnindex ); parameters columnindex the column index.
... astring getrowdescription( in long rowindex ); parameters rowindex the row index.
nsIApplicationCacheNamespace
if a load from the cache fails to match on an exact cache entry, the namespace entries are searched for a substring match.
... 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.
... namespacespec acstring the prefix of this namespace.
... void init( in unsigned long itemtype, in acstring namespacespec, in acstring data ); parameters itemtype the namespace type.
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...
... searchparam astring an additional parameter used for configuring searches.
... textvalue astring the value of the text in the autocomplete text field.
...acstring getsearchat( in unsigned long index ); parameters index the index number of the search session object whose name is to be returned.
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 ...
...unsigned long getaddonblockliststate( in jsval addon, in astring appversion, optional in astring toolkitversion optional ); parameters addon the addon object whose blocklist state is to be determined.
...unsigned long getpluginblockliststate( in nsiplugintag plugin, in astring appversion, optional in astring toolkitversion optional ); parameters plugin the plugin to get the state for.
...boolean isaddonblocklisted( in jsval addon, in astring appversion, optional from gecko 1.9.1 in astring toolkitversion optional from gecko 1.9.1 ); parameters addon the addon object to be checked.
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 doomentri...
...void asyncopencacheentry( in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait ); parameters key the key for cache entry.
...void doomentry( in acstring key, in nsicachelistener listener ); parameters key the key for cache entry.
...nsicacheentrydescriptor opencacheentry( in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode ); parameters key the key for cache entry.
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.
... the value of the contentcharset attribute is a mixed case string.
... contenttype acstring the mime type of the channel's content if available.
... the value of the contenttype attribute is a lowercase string.
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.
... void notifyresolvedcharset( in acstring charset, in nsisupports closure ); parameters charset the detected charset.
...acstring requestcharset( in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure ); parameters awebnavigation the nsiwebnavigation the document is being loaded in.
... return value the resolved charset, or an empty string if no charset could be determined.
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.
... void copystring( in astring astring ); parameters astring the string to copy to the clipboard.
... copystringtoclipboard() this method copies string to given clipboard.
... void copystringtoclipboard( in astring astring, in long aclipboardid ); parameters astring the string to copy to the clipboard.
nsICookie
host autf8string the host (possibly fully qualified) of the cookie.
... name acstring the name of the cookie.
... path autf8string the path pertaining to the cookie.
... value acstring the cookie value.
nsIDNSRecord
acstring getnextaddrasstring(); boolean hasmore(); void rewind(); attributes attribute type description canonicalname acstring for example, www.mozilla.org --> rheet.mozilla.org.
...getnextaddrasstring() this function returns the value of the next ip address as a string and increments the internal address iterator.
... acstring getnextaddrasstring(); parameters none.
... return value the value of the next ip address as a string.
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 myhostname autf8string read only.
...nsicancelable asyncresolve( in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget ); parameters ahostname the host name or ip-address-literal to resolve.
...nsidnsrecord resolve( in autf8string ahostname, in unsigned long aflags ); parameters ahostname the host name or ip-address-literal to resolve.
...es.nsidnsservice); let thread = components.classes["@mozilla.org/thread-manager;1"] .getservice(components.interfaces.nsithreadmanager).currentthread; let host = "www.mozilla.org"; let listener = { onlookupcomplete: function(request, record, status) { if (!components.issuccesscode(status)) { // handle error here return; } let address = record.getnextaddrasstring(); console.log(host + " = " + address); } }; dnsservice.asyncresolve(host, 0, listener, thread); ...
nsIEventListenerService
nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray); boolean haslistenersfor(in nsidomeventtarget aeventtarget, in domstring atype); void addsystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); void removesystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); attributes attribute type description ...
...boolean haslistenersfor( in nsidomeventtarget aeventtarget, in domstring atype ); parameters aeventtarget the nsidomeventtarget for which to check if this has any listener for atype.
...void addsystemeventlistener( in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target to listen an event.
...void removesystemeventlistener( in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target listening the event.
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 sendcrossprocessmouseevent(in astring atype, in float ax, in float ay, ...
... void activateframeevent( in astring atype, in boolean capture ); parameters atype the event type for which to enable forwarding.
... void sendcrossprocesskeyevent( in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault ); parameters atype the event type.
... void sendcrossprocessmouseevent( in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe ); parameters atype the type of mouse event to send.
nsIFrameMessageManager
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.
... void addmessagelistener( in astring amessage, in nsiframemessagelistener alistener [optional in boolean listenwhenclosed ); parameters amessage the name of the message for which to add a listener.
... void removemessagelistener( in astring amessage, in nsiframemessagelistener alistener ); parameters amessage the name of the message for which to remove a listener.
... void sendasyncmessage( in astring amessage, in astring json ); parameters amessage the name of the message to send to the listeners.
nsIINIParserWriter
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.
... method overview void setstring(in autf8string asection, in autf8string akey, in autf8string avalue); void writefile([optional] in nsifile ainifile, [optional] in unsigned long aflags); constants file writing constants these constants are specified when calling writefile(), in order to change its behavior.
... methods setstring() set the value of a property string for a particular section and key.
... void setstring( in autf8string asection, in autf8string akey, in autf8string avalue ); parameters asection the name of the section into which to place the property.
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 lo...
... long long createlivemark( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index ); parameters folder the id of the parent folder.
... long long createlivemarkfolderonly( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index ); parameters folder the id of the parent folder.
... return value a nsiuri representing the uri of the feed; if the livemark container doesn't have a valid feed uri, null will be returned or the nsiuri object returned will be the empty string.
nsILocalFileMac
obsolete since gecko 1.9.2 boolean ispackage(); void launchwithdoc(in nsilocalfile adoctoload, in boolean alaunchinbackground); void opendocwithapp(in nsilocalfile aapptoopenwith, in boolean alaunchinbackground); void setfiletypeandcreatorfromextension(in string aextension); obsolete since gecko 1.9.2 void setfiletypeandcreatorfrommimetype(in string amimetype); obsolete since gecko 1.9.2 attributes attribute type description bundledisplayname astring returns the display name of the application bundle (usually the human readable name of the application) read only.
... bundleidentifier autf8string returns the identifier of the bundle.
...void setfiletypeandcreatorfromextension( in string aextension ); parameters aextension setfiletypeandcreatorfrommimetype() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) sets the file type and creator code from a mime type.
...void setfiletypeandcreatorfrommimetype( in string amimetype ); parameters amimetype ...
nsIMemoryReporter
description autf8string a human-readable description of this memory usage report.
... path autf8string the path that this memory usage should be reported under.
... process acstring the name of the process containing this reporter.
... each reporter starts with an empty string for this value, indicating that it applies to the current process; this is true even for reporters in a child process.
nsIMsgCompFields
properties attribute type description attachments char * obsolete attachments obsolete, do not use anymore attachmentsarray nsisupportsarray readonly attachvcard prbool bcc astring body astring bodyisasciionly prbool cc astring characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc astring fcc2 astring followupto char * forcemsgencoding prbool forceplaintext ...
... prbool from astring hasrecipients prbool readonly new in thunderbird 23 indicates whether something is filled in in the to, cc, or bcc attribute.
...(bug 249530) newsgroups astring newshost char * newsposturl char * organization astring otherrandomheaders astring no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject ...
... astring templatename astring 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); ...
nsIMsgFilterList
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilterlist.idl attributes folder attribute nsimsgfolder nsimsgfilterlist::folder version readonly attribute short nsimsgfilterlist::version arbitraryheaders readonly attribute acstring nsimsgfilterlist::arbitraryheaders shoulddownloadallheaders readonly 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 l...
...ong 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) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filterindex) movefilterat() void nsimsgfilterlist::movefilterat ( in unsigned long filterindex, in nsmsgfiltermotionvalue motion ) insertfilterat() void nsimsgfilterlist::insertfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) movefilter() void nsimsgfilterlist::movefilter ( in nsimsgfilter filter, in nsmsgfilt...
...ermotionvalue motion ) createfilter() nsimsgfilter nsimsgfilterlist::createfilter ( in astring name ) savetofile() void nsimsgfilterlist::savetofile ( in nsioutputstream stream ) parsecondition() void nsimsgfilterlist::parsecondition ( in nsimsgfilter afilter, in string condition ) savetodefaultfile() void nsimsgfilterlist::savetodefaultfile ( ) applyfilterstohdr() void nsimsgfilterlist::applyfilterstohdr ( in nsmsgfiltertypetype filtertype, in nsimsgdbhdr msghdr, in nsimsgfolder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, in nsimsgfilterhitnotify listener, in nsimsgwindow msgwindow, in nsilocalfile amessagefile ) ...
... writeinattr() void nsimsgfilterlist::writeintattr ( in nsmsgfilterfileattribvalue attrib, in long value, in nsioutputstream stream ) writestrattr() void nsimsgfilterlist::writestrattr ( in nsmsgfilterfileattribvalue attrib, in string value, in nsioutputstream stream ) writewstrattr() void nsimsgfilterlist::writewstrattr ( in nsmsgfilterfileattribvalue attrib, in string value, in nsioutputstream stream ) matchorchangefiltertarget() boolean nsimsgfilterlist::matchorchangefiltertarget ( in acstring olduri, in acstring newuri, in boolean caseinsensitive ) clearlog() void nsimsgfilterlist::clearlog () ...
nsIMsgSearchCustomTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchcustomterm.idl attributes id /** * globally unique string to identify this search term.
... */ readonly attribute acstring id; name /// name to display in term list.
...*/ readonly attribute astring name; needsbody /// does this term need the message body?
...ch term to a message * * @param msghdr header database reference representing the message * @param searchvalue user-set value to use in the search * @param searchop search operator (contains, ishigherthan, etc.) * * @return true if the term matches the message, else false */ boolean match(in nsimsgdbhdr msghdr, in autf8string searchvalue, in nsmsgsearchopvalue searchop); ...
nsIPermission
host autf8string the host, that is uri, on which the permission is applied.
... type acstring the type of permission: cookie, image, and so on.
... this is a case-sensitive string.
... this string is specified by the consumer when adding a permission via nsipermissionmanager read only.
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.
... atopic - the string defined by ns_prefbranch_prefchange_topic_id adata - the name of the preference which has changed, relative to the "root" of the asubject branch.
... void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to listen for changes.
... void removeobserver( in string adomain, in nsiobserver aobserver ); parameters adomain the preference which is being observed for changes.
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.
... void getkey( in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key ); parameters name the encryption key name.
...tservice(ci.nsipushservice); function sendsubscriptiontoserver(subscription) { let request = cc["@mozilla.org/xmlextras/xmlhttprequest;1"] .createinstance(ci.nsixmlhttprequest); request.open("post", "https://example.com/register-for-push", true); request.addeventlistener("error", () => { cu.reporterror("error sending subscription to server"); }); request.send(json.stringify({ endpoint: subscription.endpoint, // base64-encode the key and authentication secret.
... key: string.fromcharcode.apply(null, btoa(subscription.getkey("p256dh"))), secret: string.fromcharcode.apply(null, btoa(subscription.getkey("auth"))), })); } pushservice.subscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.reporterror("error creating subscription: " + code); } else { sendsubscriptiontoserver(subscription); } } ); see also nsipushservice nsipushmessage pushsubscription ...
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.
...pass an empty string to use anything.
...void resumeat( in unsigned long long startpos, in acstring entityid ); parameters startpos the starting offset, in bytes, to use to download.
...pass an empty string to use anything.
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.
... category a string indicating what kind of code caused the message.
... there are quite a few category strings and they don't seem to be listed in a single place.
nsISelection
nsidomrange getrangeat(in long index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); domstring tostring(); attributes attribute type description anchornode nsidomnode returns the n...
...void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend()" } "move" collapses the selection to the end of the selection and applies the movement direction/granularity to the collapsed() selection.
... tostring() returns the whole selection into a plain text string.
... domstring tostring(); remarks see also ...
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!
... void newsocket(in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, out prfiledescstar afiledesc, out nsisupports asecurityinfo); native code only!
...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 ); parameters afamily the address family for this socket (pr_af_inet or pr_af_inet6).
...void newsocket( in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, out prfiledescstar afiledesc, out nsisupports asecurityinfo ); parameters afamily the address family for this socket (pr_af_inet or pr_af_inet6).
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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value 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.
... string tostring(); parameters none.
... return value a string valued representation of the object.
nsITaggingService
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 type description alltags nsivariant retrieves all tags used to tag uris in the data-base (sorted by name).
... tagcontainericonspec autf8string retrieves the url spec for the tag container icon methods taguri() this method tags a uri with the given set of tags.
... nsivariant geturisfortag( in astring atag ); parameters atag the tag name.
...nsivariant gettagsforuri( in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out wstring atags ); parameters auri the uri for which to return the tags.
nsIURLFormatter
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.
...astring formaturl( in astring aformat ); parameters aformat unformatted url as a string.
...formaturlpref() formats a string url stored in a preference.
...astring formaturlpref( in astring apref ); parameters apref a string representing the name of the preference from which to fetch the url to format.
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.
... void registertimer( in astring id, in nsitimercallback callback, in unsigned long interval ); parameters id an id used to identify the timer interval; used for persistence.
... 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," + "interval" }], this allows you to schedule the timer without actually having to instantiate the component; instea...
...this can be an empty string if the default interval should not be overridden.
nsIUserInfo
attributes attribute type description linux mac osx os/2 windows domain string read only.
... emailaddress string read only.
... fullname wstring read only.
... username string read only.
nsIWebBrowserPersist
erpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferr...
...er, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in boolean aisprivate); attributes attribute type description currentstate unsigned long current state of the persister object.
... void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file.
... void saveuri( in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext ); parameters auri uri to save to file.
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 nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(i...
... nsidomwindow getwindowbyname( in wstring atargetname, in nsidomwindow acurrentwindow ); parameters atargetname the window name.
... nsidomwindow openwindow( in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments ); parameters aparent the parent window, if any.
... atopic - a wstring, either "domwindowopened" or "domwindowclosed".
nsIXSLTProcessor
to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in ...
...nsivariant getparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter.
...void removeparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter.
...void setparameter( in domstring namespaceuri, in domstring localname, in nsivariant value ); parameters namespaceuri the namespaceuri of the xslt parameter.
nsPIPromptService
this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++.
... the indexes for getstring() and setstring() are: emsg the value is 0.
... method overview void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl); methods dodialog() opens a dialog.
... void dodialog( in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl ); parameters aparent the parent window of the dialog.
XPCOM ABI
abi naming each abi is named with a string [target_xpcom_abi] of the following format: {cpu_arch}-{target_compiler_abi} {cpu_arch} [platforms] represents the cpu architecture and may be either: x86 - i386 and higher series (including x86-64 cpus in 32-bit mode) ppc - powerpc series alpha - alpha series x86_64 - amd64/emt64 series in 64-bit mode (32-bit mode is still considered x86) sparc - sparc series ia64 - itanium series {...
...target_compiler_abi}[platforms] represents the compiler abi and may be either: msvc - microsoft visual c++ n32 - irix 6 c++ compiler gcc2 - gnu c++ compiler 2.x gcc3 - gnu c++ compiler 3.x or 4.x sunc - sun c++ compiler ibmc - ibm c++ compiler for example: firefox built with the gnu c++ compiler 4.0.0 for the intel pentium processor would have xpcom abi of x86-gcc3 the xpcom abi string can be retrieved programmatically by using the nsixulruntime interface.
...o retrieve the abi of your firefox or thunderbird, open the error console (accessible through tools | error console) and evaluate the following javascript code: components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime) .xpcomabi if either the cpu architecture or the c++ compiler are unknown, the application wouldn't have an xpcom abi string and attempts to get it will result in error ns_error_not_available.
... if the application doesn't have an xpcom abi string (due to the fact that either its cpu architecture or c++ compiler are unknown, as described in the abi naming section), you should use the operating system's name (without appending the xpcom abi) as the platform name in the install manifest etc.
Creating a Custom Column
from nsitreeview: getcellproperties(row, col, props): optionally modify the props array getrowproperties(row, props): optionally modify the props array getimagesrc(row, col): return a string (or null) getcelltext(row, col): return a string representing the actual text to display in the column from nsimsgcustomcolumnhandler: getsortstringforrow(hdr): return the string value that the column will be sorted by getsortlongforrow(hdr): return the long value that the column will be sorted by isstring(): return true / false warning!
... do not get confused between getcelltext() and getsortstring/longforrow()!
... internally when sorting by your column a simple implementation objects in javascript are just "advanced" variables, so an implementation of the nsimsgcustomcolumnhandler interface looks like: var columnhandler = { getcelltext: function(row, col) { //get the message's header so that we can extract the reply to field var hdr = gdbview.getmsghdrat(row); return hdr.getstringproperty("replyto"); }, getsortstringforrow: function(hdr) {return hdr.getstringproperty("replyto");}, isstring: function() {return true;}, getcellproperties: function(row, col, props){}, getrowproperties: function(row, props){}, getimagesrc: function(row, col) {return null;}, getsortlongforrow: function(hdr) {return 0;} } basically, all we are doi...
...ng here is making sure that both the text that is displayed to the user (getcelltext()) and the string we sort according to (when the user decided to sort the view by our custom column) are identical.
ArrayType
property type description name string the type's name.
...for structure and opaque pointer types, this is simply the string that was passed to the constructor.
... 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
property type description name string the type's name.
...for structure and opaque pointer types, this is simply the string that was passed to the constructor.
... 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.
Debugger.Environment - Firefox Developer Tools
names() return an array of strings giving the names of the identifiers bound by this environment.
... getvariable(name) return the value of the variable bound toname in this environment, or undefined if this environment does not bindname.name must be a string that is a valid ecmascript identifier name.
... setvariable(name,value) storevalue as the value of the variable bound toname in this environment.name must be a string that is a valid ecmascript identifier name;value must be a debuggee value.
...ifname is not in scope in this environment, return null.name must be a string whose value is a valid ecmascript identifier name.
Waterfall - Firefox Developer Tools
restyle hint a string indicating what kind of restyling is needed.
... reason a string indicating the reason gc was performed.
... non-incremental reason if the gc event was non-incremental, the string indicates the reason non-incremental gc was performed.
... for example, suppose we adapt the code above to make a timestamp every 10 iterations of the loop, labeled with the iteration number: var iterations = 70; var multiplier = 1000000000; function calculateprimes() { console.time("calculating..."); var primes = []; for (var i = 0; i < iterations; i++) { if (i % 10 == 0) { console.timestamp(i.tostring()); } var candidate = i * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } } console.timeend("calculating..."); return primes; } in the waterfall you'll n...
Storage Inspector - Firefox Developer Tools
the sidebar can parse the value of the cookie or local storage item or an indexeddb item and convert it into a meaningful object instead of just a string.
... for example: a stringified json like '{"foo": "bar"}' is shown as the origin json: {foo: "bar"}.
... a string containing a key separated value, like "1~2~3~4" or "1=2=3=4" is shown like an array: [1, 2, 3, 4].
... a string containing key-value pairs, like "id=1234:foo=bar" is shown as json: {id:1234, foo: "bar"}.
AnimationEvent() - Web APIs
type a domstring representing the name of the type of the animationevent.
... animationname optional a domstring containing the value of the animation-name css property associated with the transition.
... pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
... if the animation doesn't run on a pseudo-element but on the element itself, specify an empty string: "".
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.
... namespaceuri read only a domstring representing the namespace uri of the attribute, or null if there is no namespace.
... localname read only a domstring representing the local part of the qualified name of the attribute.
... prefix read only a domstring representing the namespace prefix of the attribute, or null if no prefix is specified.
AudioTrackList.getTrackById() - Web APIs
the audiotracklist method gettrackbyid() returns the first audiotrack object from the track list whose id matches the specified string.
... this lets you find a specified track if you know its id string.
... syntax var thetrack = audiotracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
... return value an audiotrack object indicating the first track found within the audiotracklist whose id matches the specified string.
AuthenticatorResponse.clientDataJSON - Web APIs
the clientdatajson property of the authenticatorresponse interface stores a json string in an arraybuffer, representing the client data that was passed to credentialscontainer.create() or credentialscontainer.get().
... properties after the clientdatajson object is converted from an arraybuffer to a javascript object, it will have the following properties: type a string which is either "webauthn.get" when an existing credential is retrieved or "webauthn.create" when a new credential is created.
...it has two properties: status: a string which is either "supported" which indicates the client support token binding but did not negotiate with the relying party or "present" when token binding was used already id: a domstring which is the base64url encoding of the token binding id which was used for the communication.
... examples function arraybuffertostr(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } // pk is a publickeycredential that is the result of a create() or get() promise var clientdatastr = arraybuffertostr(pk.clientdatajson); var clientdataobj = json.parse(clientdatastr); console.log(clientdataobj.type); // "webauthn.create" or "webauthn.get" console.log(clientdataobj.challenge); // base64 encoded string containing the original challenge console.log(clientdataobj.origin); // the window.origin specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'clientda...
Blob() - Web APIs
WebAPIBlobBlob
syntax var newblob = new blob(array, options); parameters array an array of arraybuffer, arraybufferview, blob, usvstring objects, or a mix of any of such objects, that will be put inside the blob.
... usvstring objects are encoded as utf-8.
...the default value is the empty string, ("").
... example var afileparts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single domstring var omyblob = new blob(afileparts, {type : 'text/html'}); // the blob specification specification status comment file apithe definition of 'blob()' in that specification.
CSSStyleDeclaration.getPropertyPriority() - Web APIs
the cssstyledeclaration.getpropertypriority() method interface returns a domstring that provides all explicitly set priorities on the css property.
... syntax var priority = style.getpropertypriority(property); parameters property is a domstring representing the property name to be checked.
... return value priority is a domstring that represents the priority (e.g.
...if none exists, returns the empty string.
CSSStyleDeclaration.getPropertyValue() - Web APIs
the cssstyledeclaration.getpropertyvalue() method interface returns a domstring containing the value of a specified css property.
... syntax var value = style.getpropertyvalue(property); parameters property is a domstring representing the property name to be checked.
... return value value is a domstring containing the value of the property.
... if not set, returns the empty string.
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 can be a request object or a url string.
...the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
... cachename: a domstring that represents a specific cache to search within.
ChildNode.replaceWith() - Web APIs
the childnode.replacewith() method replaces this childnode in the children list of its parent with a set of node or domstring objects.
... domstring objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.replacewith((node or domstring)...
... nodes); parameters nodes a set of node or domstring objects to replace.
CompositionEvent.data - Web APIs
syntax mydata = compositionevent.data value a domstring representing the event data: for compositionstart events, this is the currently selected text that will be replaced by the string being composed.
... this value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started.
... for compositionupdate, this is the string as it stands currently as editing is ongoing.
... for compositionend events, this is the string as committed to the editor.
console.debug() - Web APIs
WebAPIConsoledebug
the string representations of each of these objects are appended together in the order listed and output to the console.
... msg a javascript string containing zero or more substitution strings, which are replaced with subst1 through substn in consecutive order.
...substn javascript objects with which to replace substitution strings within msg.
...see using string substitutions in console for a description of how substitutions work.
Constraint validation API - Web APIs
validationmessage a read-only property that returns an empty string if the element is not a candidate for constraint validation, or if the element's value is valid.
... setcustomvalidity(message) sets a custom error message string to be shown to the user upon submitting the form, explaining why the value is not valid — when a message is set, the validity state is set to invalid.
... to clear this state, invoke the function with an empty string passed as its argument.
...for this to happen, the custom validity has to be cancelled, by invoking setcustomvalidity() with an empty string value.
CredentialsContainer.create() - Web APIs
tbd id: (required) usvstring inherited from credentialdata.
... name: optional usvstring tbd iconurl: optional usvstring tbd password: (required) usvstring tbd federated: optional an federatedcredentialinit object.
...the available options are: id: (required) usvstring inherited from credentialdata.
... name: optional usvstring tbd iconurl: optional usvstring tbd provider: (required) usvstring tbd protocol: optional usvstring tbd publickey: optional an publickeycredentialcreationoptions object that describes the options for creating a webauthn credential.
DOMError - Web APIs
WebAPIDOMError
properties domerror.name read only returns a domstring representing one of the error type names (see below).
... domerror.message read only returns a domstring representing a message or description associated with the given error type name.
... invalidcharactererror the string contains invalid characters.
... syntaxerror the string did not match the expected pattern.
DataTransfer.types - Web APIs
the datatransfer.types read-only property returns an array of the drag data formats (as strings) that were set in the dragstart event.
... the formats are unicode strings giving the type or format of the data, generally given by a mime type.
...each format is string.
...if any files are included in the drag operation, then one of the types will be the string files.
DataTransferItem.type - Web APIs
the type is a unicode string generally given by a mime type, although a mime type is not required.
... syntax dataitem.type; return value a domstring representing the drag data item's type.
... function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("...
... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("...
DeprecationReportBody - Web APIs
properties id a string representing the deprecated feature that generated the report, for example navigatorgetusermedia.
... anticipatedremoval a date object (rendered as a string) representing the date when the feature is expected to be removed from the current browser.
... message a string containing a human-readable description of the deprecation, including information such as what newer feature has superceded it, if any.
... sourcefile a string containing the path to the source file where the deprecated feature was used, if known, or null otherwise.
DisplayMediaStreamConstraints.video - Web APIs
cursor a constraindomstring which specifies whether or not to include the mouse cursor in the generated track, and if so, whether or not to hide it while not moving.
... the value may be a single one of the following strings, or an array of them to allow the browser flexibility in deciding what to do about the cursor.
... displaysurface a constraindomstring which specifies the types of display surface that may be selected by the user.
... this may be a single one of the following strings, or a list of them to allow multiple source surfaces: application the stream contains all of the windows of the application chosen by the user rendered into the one video track.
Document.lastModified - Web APIs
the lastmodified property of the document interface returns a string containing the date and time on which the current document was last modified.
... syntax var string = document.lastmodified; examples simple usage this example alerts the value of lastmodified.
... let nlastmodif = date.parse(document.lastmodified); notes note that as a string, lastmodified cannot easily be used for comparing the modification dates of documents.
...eplace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1")), nlastmodif = date.parse(document.lastmodified); if (isnan(nlastvisit) || nlastmodif > nlastvisit) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; if (isfinite(nlastvisit)) { alert("this page has been changed!"); } } note: webkit returns the time string in utc; gecko and internet explorer return a time in the local timezone.
Document.querySelectorAll() - Web APIs
syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
... this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown.
...since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters.
... exceptions syntaxerror the syntax of the specified selectors string is not valid.
Document - Web APIs
WebAPIDocument
document.documenturiread only returns the document location as a string.
... document.undomanager read only … document.visibilitystateread only returns a string denoting the visibility state of the document.
... document.urlread only returns the document location as a string.
... the document interface is extended with the parentnode interface: document.getelementbyid(string id) returns an object reference to the identified element.
DocumentType - Web APIs
documenttype.internalsubset read only a domstring of the internal subset, or null if there is none.
... documenttype.name read only a domstring, eg "html" for <!doctype html>.
... documenttype.publicid read only a domstring, eg "-//w3c//dtd html 4.01//en", empty string for html5.
... documenttype.systemid read only a domstring, eg "http://www.w3.org/tr/html4/strict.dtd", empty string for html5.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
whitespace is any string of text composed only of spaces, tabs or line breaks (to be precise, crlf sequences, carriage returns or line feeds).
... */ function is_all_ws( nod ) { // use ecma-262 edition 3 string and regexp features return !(/[^\t\n\r ]/.test(nod.textcontent)); } /** * determine if a node should be ignored by the iterator functions.
... (normally * |data| is a property of text nodes that gives the text of the node.) * * @param txt the text node whose data should be returned * @return a string giving the contents of the text node with * whitespace collapsed.
... */ function data_of( txt ) { var data = txt.textcontent; // use ecma-262 edition 3 string and regexp features data = data.replace(/[\t\n\r ]+/g, " "); if (data.charat(0) == " ") data = data.substring(1, data.length); if (data.charat(data.length - 1) == " ") data = data.substring(0, data.length - 1); return data; } example the following code demonstrates the use of the functions above.
Element.querySelectorAll() - Web APIs
syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
... this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown.
...since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters.
... exceptions syntaxerror the syntax of the specified selectors string is not valid.
File.File() - Web APIs
WebAPIFileFile
syntax new file(bits, name[, options]); parameters bits an array of arraybuffer, arraybufferview, blob, usvstring objects, or a mix of any of such objects, that will be put inside the file.
... usvstring objects are encoded as utf-8.
... name a usvstring representing the file name or the path to the file.
...available options are as follows: type: a domstring representing the mime type of the content that will be put into the file.
File.getAsText() - Web APIs
WebAPIFilegetAsText
syntax var str = instanceoffile.getastext(encoding); parameters encoding a string indicating the encoding to use for the returned data.
... if this string is empty, utf-8 is assumed.
... returns a string containing the file's data interpreted as text in the specified encoding.
...text/plain", "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.
FileReader.result - Web APIs
WebAPIFileReaderresult
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.
... readasbinarystring() the result contains the raw binary data from the file in a string.
... readasdataurl() the result is a string with a data: url representing the file's data.
... readastext() the result is text in a string.
FormData.append() - Web APIs
WebAPIFormDataappend
this can be a usvstring or blob (including subclasses such as file).
... if none of these are specified the value is converted to a string.
... filename optional the filename reported to the server (a usvstring), when a blob or file is passed as the second parameter.
... if the sent value is different than string or blob it will be automatically converted to string: formdata.append('name', true); formdata.append('name', 74); formdata.append('name', 'john'); formdata.getall('name'); // ["true", "74", "john"] specifications specification status comment xmlhttprequestthe definition of 'append()' in that specification.
FormData.set() - Web APIs
WebAPIFormDataset
this can be a usvstring or blob (including subclasses such as file).
... if none of these are specified the value is converted to a string.
... filename optional the filename reported to the server (a usvstring), when a blob or file is passed as the second parameter.
... example the following line creates an empty formdata object: var formdata = new formdata(); // currently empty you can set key/value pairs on this using formdata.set: formdata.set('username', 'chris'); formdata.set('userpic', myfileinput.files[0], 'chris.jpg'); if the sent value is different than string or blob it will be automatically converted to string: formdata.set('name', 72); formdata.get('name'); // "72" specifications specification status comment xmlhttprequestthe definition of 'set()' in that specification.
Using the Gamepad API - Web APIs
%d buttons, %d axes.", gp.index, gp.id, gp.buttons.length, gp.axes.length); }); the gamepad object's properties are as follows: id: a string containing some information about the controller.
... this is not strictly specified, but in firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller, and the name of the controller as provided by the driver.
... mapping: a string indicating whether the browser has remapped the controls on the device to a known layout.
...if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard.
HTMLHRElement - Web APIs
htmlhrelement.align is a domstring, an enumerated attribute indicating alignment of the rule with respect to the surrounding context.
... htmlhrelement.color is a domstring representing the name of the color of the rule.
... htmlhrelement.size is a domstring representing the height of the rule.
... htmlhrelement.width is a domstring representing the width of the rule on the page.
HTMLImageElement.useMap - Web APIs
the usemap property on the htmlimageelement interface reflects the value of the html usemap attribute, which is a string providing the name of the client-side image map to apply to the image.
... syntax htmlimageelement.usemap = imagemapanchor; let imagemapanchor = htmlimageelement.usemap; value a usvstring providing the page-local url (that is, a url that begins with the hash or pound symbol, "#") of the <map> element which defines the image map to apply to the image.
... usage notes the string value of usemap must be a valid anchor for a <map> element.
... in other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it.
HTMLMediaElement.canPlayType() - Web APIs
syntax canplayresponse = audioorvideo.canplaytype(mediatype); parameters mediatype a domstring containing the mime type of the media.
... return value a domstring indicating how likely it is that the media can be played.
... the string will be one of the following values: probably media of the type indicated by the mediatype parameter is probably playable on this device.
... "" (empty string) media of the given type definitely can't be played on the current device.
HTMLMetaElement - Web APIs
name type description content domstring gets or sets the value of meta-data property.
... httpequiv domstring gets or sets the name of an http response header to define for a document.
... name domstring gets or sets the name of a meta-data property to define for a document.
... scheme domstring gets or sets the name of a scheme used to interpret the value of a meta-data property.
HTMLParamElement - Web APIs
htmlparamelement.name is a domstring representing the name of the parameter.
... htmlparamelement.value is a domstring representing the value associated to the parameter.
... htmlparamelement.type is a domstring containing the type of the parameter when valuetype has the "ref" value.
... htmlparamelement.valuetype is a domstring containing the type of the value.
HTMLSourceElement - Web APIs
htmlsourceelement.media is a domstring reflecting the media html attribute, containing the intended type of the media resource.
... htmlsourceelement.sizes is a domstring representing image sizes between breakpoints htmlsourceelement.src is a domstring reflecting the src html attribute, containing the url for the media resource.
... htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma).
... htmlsourceelement.type is a domstring reflecting the type html attribute, containing the type of the media resource.
HTMLTableSectionElement - Web APIs
htmltablesectionelement.align is a domstring containing an enumerated value reflecting the align attribute.
... htmltablesectionelement.ch is a domstring containing one single chararcter.
... htmltablesectionelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch.
... htmltablesectionelement.valign is a domstring representing an enumerated value indicating how the content of the cell must be vertically aligned.
HTMLTimeElement.dateTime - Web APIs
the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value.
... the format of the string must follow one of the following html microsyntaxes: microsyntax description examples valid month string yyyy-mm 2011-11, 2013-05 valid date string yyyy-mm-dd 1887-12-01 valid yearless date string mm-dd 11-12 valid time string hh:mm hh:mm:ss hh:mm:ss.mmm 23:59 12:15:47 12:15:52.998 valid local date and time string yyyy-mm-dd hh:mm yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss.mmm yyyy-mm-ddthh:mm yyyy-mm-ddthh:mm:ss yyyy-mm-ddthh:mm:ss.mmm 2013-12-25 11:12 1972-07-25 13:43:07 1941-03-15 07:06:23.678 2013-12-25t11:12 1972-07-25t13:43:07 1941-03-15t07:06:23.678 valid time-zone offset string z +hhmm +hh:mm ...
... -hhmm -hh:mm z +0200 +04:30 -0300 -08:00 valid global date and time string any combination of a valid local date and time string followed by a valid time-zone offset string 2013-12-25 11:12+0200 1972-07-25 13:43:07+04:30 1941-03-15 07:06:23.678z 2013-12-25t11:12-08:00 valid week string yyyy-www 2013-w46 four or more ascii digits yyyy 2013, 0001 valid duration string pddthhmmss pddthhmms.xs pddthhmms.xxs pddthhmms.xxxs pthhmmss pthhmms.xs pthhmms.xxs pthhmms.xxxs ww dd hh mm ss p12dt7h12m13s p12dt7h12m13.3s p12dt7h12m13.45s p12dt7h12m13.455s pt7h12m13s pt7h12m13.2s pt7h12m13.56s pt7h12m13.999s 7d 5h 24m 13s syntax datetimestring = ...
...timeelt.datetime; timeelt.datetime = datetimestring example // assumes there is <time id="t"> element in the html var t = document.getelementbyid("t"); t.datetime = "6w 5h 34m 5s"; specifications specification status comment html living standardthe definition of 'htmltimeelement' in that specification.
HTMLTrackElement - Web APIs
htmltrackelement.kind is a domstring that reflects the kind html attribute, indicating how the text track is meant to be used.
... htmltrackelement.src is a domstring that reflects the src html attribute, indicating the address of the text track data.
... htmltrackelement.srclang is a domstring that reflects the srclang html attribute, indicating the language of the text track data.
... htmltrackelement.label is a domstring that reflects the label html attribute, indicating a user-readable title for the track.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
const messagequeue = []; let sendmessage = message => { messagequeue.push(message); if (messagequeue.length === 1) { queuemicrotask(() => { const json = json.stringify(messagequeue); messagequeue.length = 0; fetch("url-of-receiver", json); }); } }; when sendmessage() gets called, the specified message is first pushed onto the message queue array.
...it starts by encoding it as json using the json.stringify() method.
...finally, we use the fetch() method to send the json string to the server.
... the server will receive the json string, then will presumably decode it and process the messages it finds in the resulting array.
Recommended Drag Types - Web APIs
the second data parameter should be the dragged string.
... because a file is not a string, you must use the mozsetdataat() method to assign the data.
... updates to datatransfer.types the latest spec dictates that datatransfer.types should return a frozen array of domstrings rather than a domstringlist (this is supported in firefox 52 and above).
...nts.results.ns_nointerface; }, getflavordata : function(atransferable, aflavor, adata, adatalen) { if (aflavor == 'application/x-moz-file-promise') { var urlprimitive = {}; var datasize = {}; atransferable.gettransferdata('application/x-moz-file-promise-url', urlprimitive, datasize); var url = urlprimitive.value.queryinterface(components.interfaces.nsisupportsstring).data; console.log("url file orignal is = " + url); var nameprimitive = {}; atransferable.gettransferdata('application/x-moz-file-promise-dest-filename', nameprimitive, datasize); var name = nameprimitive.value.queryinterface(components.interfaces.nsisupportsstring).data; console.log("target filename is = " + name); var dirprimitive = {}; atrans...
HTML Drag and Drop API - Web APIs
a datatransferitem object represents a single drag item, each with a kind property (either string or file) and a type property for the data item's mime type.
... a key difference between the datatransfer and datatransferitem interfaces is that the former uses the synchronous getdata() method to access a drag item's data, but the latter instead uses the asynchronous getasstring() method.
...these are convenience functions to help with dragging multiple items or non-string data (such as files).
...each data item is a string of a particular type — typically a mime type such as text/html.
InputEvent() - Web APIs
syntax event = new inputevent(typearg, inputeventinit); values typearg is a domstring representing the name of the event.
... inputeventinitoptional is a inputeventinit dictionary, having the following fields: inputtype: (optional) a string specifying the type of change for editible content such as, for example, inserting, deleting, or formatting text.
... data: (optional) a string containing characters to insert.
... this may be an empty string if the change doesn't insert text (such as when deleting characters, for example).
IntersectionObserver.rootMargin - Web APIs
the intersectionobserver interface's read-only rootmargin property is a string with syntax similar to that of the css margin property.
... syntax var marginstring = intersectionobserver.rootmargin; value a string, formatted similarly to the css margin property's value, which contains offsets for one or more sides of the root's bounding box.
... the string returned by this property may not match the one specified when the intersectionobserver was instantiated.
... the browser is permitted to alter the values if rootmargin isn't specified when the object was instantiated, it defaults to the string "0px 0px 0px 0px", meaning that the intersection will be computed between the root element's unmodified bounds rectangle and the target's bounds.
MediaDevices.ondevicechange - Web APIs
this uses destructuring assignment (a new feature of ecmascript 6) to assign the values of the first three items in the array returned by string.match() to the variables kind, type, and direction.
... we do this because the value of mediadeviceinfo.kind is a single string that includes both the media type and the direction the media flows, such as "audioinput" or "videooutput".
... this line, then, pulls out the type ("audio" or "video") and direction ("input" or "output") so they can be used to construct the string displayed in the list.
... once the string is assembled, containing the device's name in bold and the direction in parentheses, it's appended to the appropriate list by calling appendchild() on either audiolist or videolist, as appropriate based on the device type.
MediaList.mediaText - Web APIs
the mediatext property of the medialist interface is a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist.
... syntax medialistinstance.mediatext; medialistinstance.mediatext = string; value a domstring representing the media queries of a stylesheet.
... if you wish to set new media queries on the document, the string value must have the different queries separated by commas, e.g.
... also note that is you try to set mediatext to null, it will be treated as an empty string, i.e.
MessageEvent.MessageEvent() - Web APIs
origin: a usvstring representing the origin of the message emitter.
... this defaults to an empty string ("") if not specified.
... lasteventid: a domstring representing a unique id for the event.
... this defaults to an empty string ("") if not specified.
MutationRecord - Web APIs
properties property type description mutationrecord.type string returns "attributes" if the mutation was an attribute mutation, "characterdata" if it was a mutation to a characterdata node, and "childlist" if it was a mutation to the tree of nodes.
... mutationrecord.attributename string returns the local name of the changed attribute, or null.
... mutationrecord.attributenamespace string returns the namespace of the changed attribute, or null.
... mutationrecord.oldvalue string the return value depends on the mutationrecord.type.
NavigatorID.platform - Web APIs
returns a string representing the platform of the browser.
... the specification allows browsers to always return the empty string, so don't rely on this property to get a reliable answer.
... syntax platform = navigator.platform value a domstring identifying the platform on which the browser is running, or an empty string if the browser declines to (or is unable to) identify the platform.
... platform is a string that must be an empty string or a string representing the platform on which the browser is executing.
ParentNode.prepend() - Web APIs
the parentnode.prepend() method inserts a set of node objects or domstring objects before the first child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
...each node can be specified as either a node object or as a string; strings are inserted as new text nodes.
...argitem : document.createtextnode(string(argitem))); }); this.insertbefore(docfrag, this.firstchild); } }); }); })([element.prototype, document.prototype, documentfragment.prototype]); specification specification status comment domthe definition of 'parentnode.prepend()' in that specification.
ParentNode.querySelector() - Web APIs
syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against.
... this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown.
...since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters.
... exceptions syntaxerror the syntax of the specified selectors string is not valid.
ParentNode.querySelectorAll() - Web APIs
note: this method is implemented as element.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
... this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown.
...since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters.
... exceptions syntaxerror the syntax of the specified selectors string is not valid.
ParentNode - Web APIs
methods parentnode.append() inserts a set of node objects or domstring objects after the last child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
... parentnode.prepend() inserts a set of node objects or domstring objects before the first child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
PayerErrors - Web APIs
for each field in the payment information that fails validation, the payererrors object contains a string explaining the error.
... properties email optional if present, this domstring is a string describing the validation error from which the payer's email address—as given by paymentresponse.payeremail—currently suffers.
... name optional if this domstring is present in the object, the paymentresponse.payername property failed validation, and this string explains what needs to be corrected.
... if this property is absent, the paer name is fine phone optional if present, this string is an error message explaining why the payer's phone number (paymentresponse.payerphone) failed validation.
PaymentAddress.country - Web APIs
the country read-only property of the paymentaddress interface is a string identifying the address's country using the iso 3166-1 alpha-2 standard.
... the string is always in its canonical upper-case form.
... syntax var paymentcountry = paymentaddress.country; value a domstring which contains the iso3166-1 alpha-2 code identifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to paymentrequestupdateevent.updatewith() will be made with a details object containing a shippingaddresserrors field.
... that field contains an addresserrors-compliant object whose country property is a string indicating the validation error that occurred and, if possible, suggests how to fix it.
PaymentAddress.regionCode - Web APIs
the regioncode read-only attribute of the paymentaddress interface returns a one-, two-, or three-alphanumeric code (domstring) representing the region of the address (e.g., "ca" for california, or "11" for lisbon, portugal).
... if the browser can't determine the region code, or the country doesn't use regions for postal addresses, it returns an empty string.
... syntax var regioncode = paymentaddress.regioncode; value a domstring indicating the one to three character alphanumeric code representing the region portion of the address.
...the string is empty if the region code couldn't be determined, isn't needed for the address's country, or was not provided.
PaymentCurrencyAmount - Web APIs
currency a string containing a valid 3-letter iso 4217 currency identifier (iso 4217) indicating the currency used for the payment value.
... value a string containing a valid decimal value representing the mount of currency constituting the payment amount.
... this string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional decimal point (".", regardless of locale) followed by at least one more digit.
... currencysystem optional a string describing the standard or specification as well as the currency system identifier within that system which was used to provide the value.
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.
... syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler.
... this may be a string chosen from the list of standardized payment method identifiers, or a url used by the payment processing service.
... the default value is the empty string, "".
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.
... 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.
PerformanceEntry.name - Web APIs
domstring performancemark mark the name used when the mark was created by calling performance.mark().
... domstring performancemeasure measure name used when the measure was created by calling performance.measure().
... domstring performancepainttiming paint either 'first-paint' or 'first-contentful-paint'.
... 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.
PerformanceResourceTiming.initiatorType - Web APIs
the initiatortype read-only property is a string that represents the type of resource that initiated the performance event.
... the value of this string is as follows: if the initiator is a element, the property returns the element's localname.
... if the initiator is a performancenavigationtiming object, the property returns an empty string ("").
... syntax resource.initiatortype; return value a string representing the type of resource that initiated the performance event, as specified above.
PublicKeyCredentialRequestOptions.extensions - Web APIs
also chrome doesn't plan to support any other extension in future extension identifier type description appid usvstring fido appid.
... txauthsimple usvstring simple transaction authorization.
...the client outputs a usvstring which is the text as it was displayed (line breaks may have been added).
... txauthgeneric an object with two properties: contenttype (usvstring) content (arraybuffer) generic transaction authorization.
RTCConfiguration - Web APIs
peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection.
... constants rtcbundlepolicy enum the rtcbundlepolicy enum defines string constants which are used to request a specific policy for gathering ice candidates if the remote peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link).
... rtcicetransportpolicy enum the rtcicetransportpolicy enum defines string constants which can be used to limit the transport policies of the ice candidates to be considered during the connection process.
... rtcrtcpmuxpolicy enum the rtcrtcpmuxpolicy enum defines string constants which specify what ice candidates are gathered to support non-multiplexed rtcp.
RTCDTMFToneChangeEvent - Web APIs
properties in addition to the properties of event, this interface offers the following: rtcdtmftonechangeevent.tone read only a domstring specifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing.
...it takes two parameters, the first being a domstring representing the type of the event (always "tonechange"); the second a dictionary containing the initial state of the properties of the event.
...it appends each tone to a display box as it's played, and, once all tones have been sent, re-enabled a previously-disabled "send" button, allowing the next dmtf string to be entered.
... dtmfsender.addeventlistener("change", function(event) { if (event.tone !== "") { dialstringbox.innertext += event.tone; } else { senddtmfbutton.disabled = false; } }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdtmftonechangeevent' in that specification.
RTCDataChannel.binaryType - Web APIs
the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel.
... syntax var type = adatachannel.binarytype; adatachannel.binarytype = type; value a domstring that can have one of these values: "blob" received binary messages' contents will be contained in blob objects.
... example this code configures a data channel to receive binary data in arraybuffer objects, and establishes a listener for message events which constructs a string representing the received data as a list of hexadecimal byte values.
... var dc = peerconnection.createdatachannel("binary"); dc.binarytype = "arraybuffer"; dc.onmessage = function(event) { let bytearray = new uint8array(event.data); let hexstring = ""; bytearray.foreach(function(byte) { hexstring += byte.tostring(16) + " "; }); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.binarytype' in that specification.
RTCDataChannel.protocol - Web APIs
the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use.
... if no protocol was specified when the data channel was created, then this property's value is "" (the empty string).
... syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel.
... if none has been established, this is an empty string ("").
RTCDataChannel - Web APIs
propertiesalso inherits properties from: eventtargetbinarytype the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel.
...threshold the rtcdatachannel property bufferedamountlowthreshold is used to specify the number of bytes of buffered outgoing data that is considered "low." the default value is 0.id read only the read-only rtcdatachannel property id returns an id number (between 0 and 65,534) which uniquely identifies the rtcdatachannel.label read only the read-only rtcdatachannel property label returns a domstring containing a name describing the data channel.
...atachannel's connection was negotiated by the web app (true) or by the webrtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol read only the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use.
... if no protocol was specified when the data channel was created, then this property's value is "" (the empty string).readystate read only the read-only rtcdatachannel property readystate returns an enum of type rtcdatachannelstate which indicates the state of the data channel's underlying data connection.reliable read only the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable.stream read only the deprecated (and never part of the official specification) read-only rtcdatachannel property stream returns an id number (between 0 and 65,535) which uniquely identifies the rtcdatachannel.event handlersalso inherits event handlers from: eventtargetonbufferedamountlow the rtcdatachannel.onbufferedamountlow property is an eventhandler which specifi...
RTCError - Web APIs
WebAPIRTCError
constructor rtcerror() creates and returns a new rtcerror object initialized with the properties of the provided rtcerrorinit dictionary and, optionally, a string to use as the value of the error's message property.
... properties in addition to the properties defined by the parent interface, domexception, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred.
...only valid if the errordetail string is dtls-failure.
...let errline = error.sdplinenumber; let errmessage = error.message; let alertmessage = `a syntax error occurred interpreting line ${errline} of the sdp: ${errmessage}`; showmyalertmessage("data channel error", alertmessage); } else { terminatemyconnection(); } }); if the error is an sdp syntax error—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message and the line number within the sdp at which the error occurred.
RTCIceTransport - Web APIs
the value is one of the strings from the rtcicetransport enumerated type: "rtp" or "rtsp".
... gatheringstate read only a domstring indicating which gathering state the ice agent is currently in.
... role read only returns a domstring whose value is one of the members of the rtcicerole enumerated type: "controlling" or "controlled"; this indicates whether the ice agent is the one that makes the final decision as to the candidate pair to use or not.
... state read only a domstring indicating what the current state of the ice agent is.
RTCInboundRtpStreamStats - Web APIs
perdscppacketsreceived a record of key-value pairs with strings as the keys mapped to 32-bit integer values, each indicating the total number of packets this receiver has received on this rtp stream from this source for each differentiated services code point (dscp).
... receiverid a string indicating which identifies the rtcaudioreceiverstats or rtcvideoreceiverstats object associated with the stream's receiver.
... remoteid a string which identifies the rtcremoteoutboundrtpstreamstats object that provides statistics for the remote peer for this same ssrc.
... trackid a string which identifies the statistics object representing the receiving track; this object is one of two types: rtcreceiveraudiotrackattachmentstats or rtcreceivervideotrackattachmentstats.
RTCPeerConnectionIceErrorEvent - Web APIs
properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate.
... errortext read only a domstring containing the stun reason text returned by the stun or turn server.
... if communication with the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error.
... url read only a domstring indicating the url of the stun or turn server with which the error occurred.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
the rtcremoteoutboundrtpstreamstats dictionary's localid property is a string which can be used to identify the rtcinboundrtpstreamstats object whose remoteid matches this value.
... syntax let localid = rtcremoteoutboundrtpstreamstats.localid; value a domstring which can be compared to the value of an rtcinboundrtpstreamstats object's remoteid property to see if the two represent statistics for each of the two sides of the same set of data received by the local peer.
...oteoutbound.timestamp) / 1000; /* in seconds */ let packetssent = endremoteoutbound.packetssent - startremoteoutbound.packetssent; let bytessent = endremoteoutbound.bytessent - startremoteoutbound.bytessent; let framesdecoded = endinboundstats.framesdecoded - startinboundstats.framesdecoded; let framerate = framesdecoded / elapsedtime; let timestring = ""; if (!isnan(elapsedtime)) { timestring = ` representing ${elapsedtime}s`; } let framestring = ""; if (!isnan(framesdecoded)) { framestring = `decoded ${framesdecoded} frames for a frame rate of ${framerate.tofixed(2)} fps.<br>`; } let logentry = `<div class="stats-entry"><h2>report id: ${endremoteoutbound.i...
...d}</h2>` + `remote peer sent ${packetssent} packets ${timestring}.<br>` + `${framestring}` + `data size: ${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...
RTCRtpStreamStats - Web APIs
standard fields included for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream.
... kind a domstring whose value is "audio" if the associated mediastreamtrack is audio-only or "video" if the track contains video.
... trackid a domstring which uniquely identifies the rtcmediastreamtrackstats object representing the associated mediastreamtrack.
... transportid a domstring uniquely identifying the object which was inspected to produce the rtctransportstats object associated with this rtp stream.
RTCRtpTransceiver.currentDirection - Web APIs
the read-only rtcrtptransceiver property currentdirection is a string which indicates the current directionality of the transceiver.
... its value is one of the strings defined by the rtcrtptransceiverdirection enumeration.
... syntax var direction = rtcrtptransceiver.currentdirection value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type.
... the rtcrtptransceiverdirection type is an enumeration of string values.
RTCRtpTransceiver.direction - Web APIs
the rtcrtptransceiver property direction is a string which indicates the transceiver's preferred directionality.
... its value must be one of the strings defined by the rtcrtptransceiverdirection enumeration.
... syntax var direction = rtcrtptransceiver.direction value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type, indicating the transceiver's preferred direction.
... the rtcrtptransceiverdirection type is an enumeration of string values.
RTCStats.type - Web APIs
WebAPIRTCStatstype
the rtcstats dictionary's property type is a string which specifies the type of statistic represented by the object, where the permitted values are drawn from the enum type rtcstatstype.
... the string can be used to determine which of the rtcstats-based dictionaries are the foundation of the statistics object.
... syntax var type = rtcstats.type; value a domstring which specifies which type of statistic is represented by the object.
... the string comes from the rtcstatstype enum and corrsponds to one of the rtcstats-based statistic object types.
ReadableStream.ReadableStream() - Web APIs
the reason parameter contains a domstring describing why the stream was cancelled.
...the start() function generates a random string of text every second and enqueues it into the stream.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) },...
... pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'readablestream()' in that specification.
Request() - Web APIs
WebAPIRequestRequest
this can either be: a usvstring containing the direct url of the resource you want to fetch.
... headers: any headers you want to add to your request, contained within a headers object or an object literal with bytestring values.
... body: any body that you want to add to your request: this can be a blob, buffersource, formdata, urlsearchparams, usvstring, or readablestream object.
... referrer: a usvstring specifying no-referrer, client, or a url.
Request.destination - Web APIs
the destination read-only property of the request interface returns a string describing the type of content being requested.
... the string must be one of those found in the requestdestination enumerated type or the empty string, which is the default value.
... syntax var destination = request.destination; value a string from the requestdestination enumerated type which indicates the type of content the request is asking for.
... example in the following snippet, we create a new request using the request() constructor (for an image file in the same directory as the script), then save the request's destination: var myrequest = new request('flowers.jpg'); var mydestination = myrequest.destination; // returns the empty string by default specifications specification status comment fetchthe definition of 'destination' in that specification.
SVGAElement - Web APIs
svgaelement.hreflang is a domstring that reflects the hreflang attribute, indicating the language of the linked resource.
... svgaelement.ping is a domstring that reflects the ping attribute, containing a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background).
... svgaelement.text is a domstring being a synonym for the node.textcontent property.
... svgaelement.type is a domstring that reflects the type attribute, indicating the mime type of the linked resource.
format - Web APIs
the svgaltglyphelement.format property is a domstring that defines the format of the given font.
...if the font is in one of the formats listed in css2([css2], section15.3.5), then its value is the corresponding <string> parameter of the font.
... syntax string = myglyph.format; myglyph.format = string; value the format values listed below are taken from css2([css2], section15.3.5).
... string font format examples of common extensions truedoc-pfr truedoc™ portable font resource .pfr embedded-opentype embedded opentype .eot type-1 postscript™ type 1 .pfb, .pfa truetype truetype .ttf opentype opentype, including truetype open .ttf truetype-gx truetype with gx extensions - speedo speedo - intellifont intellifont - example myglyph.format = "truedoc-pfr"; specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'format' in that specification.
Screen.lockOrientation() - Web APIs
this is either a string or an array of strings.
... passing several strings lets the screen rotate only in the selected orientations.
... the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode.
... examples usage with a domstring argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation; if (screen.lockorientationuniversal("landscape-primary")) { // orientation was locked } else { // orientation lock failed } usage with an array argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation...
Using server-sent events - Web APIs
fields each message received has some combination of the following fields, one per line: event a string identifying the type of event described.
... note: if a line doesn't contain a colon, the entire line is treated as the field name with an empty value string.
...each has an event name specified by the event field, and a data field whose value is an appropriate json string with the data needed for the client to act on the event.
... the data field could, of course, have any string data; it doesn't have to be json.
StorageEvent - Web APIs
"><rect x="116" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">storageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} method overview void initstorageevent( in domstring type, in boolean canbubble, in boolean cancelable, in domstring key, in domstring oldvalue, in domstring newvalue, in usvstring url, in storage storagearea ); attributes attribute type description key domstring represents the key changed.
... newvalue domstring the new value of the key.
... oldvalue domstring the original value of the key.
... url usvstring the url of the document whose key changed.
SubtleCrypto.digest() - Web APIs
syntax const digest = crypto.subtle.digest(algorithm, data); parameters algorithm is a domstring defining the hash function to use.
...the inhabitants refer to it as the planet earth.'; async function digestmessage(message) { const encoder = new textencoder(); const data = encoder.encode(message); const hash = await crypto.subtle.digest('sha-256', data); return hash; } const digestbuffer = await digestmessage(text); console.log(digestbuffer.bytelength); converting a digest to a hex string the digest is returned as an arraybuffer, but for comparison and display digests are often represented as hex strings.
... this example calculates a digest, then converts the arraybuffer to a hex string: const text = 'an obscure body in the s-k system, your majesty.
... function digestmessage(message) { const msguint8 = new textencoder().encode(message); // encode as (utf-8) uint8array const hashbuffer = await crypto.subtle.digest('sha-256', msguint8); // hash the message const hasharray = array.from(new uint8array(hashbuffer)); // convert buffer to byte array const hashhex = hasharray.map(b => b.tostring(16).padstart(2, '0')).join(''); // convert bytes to hex string return hashhex; } const digesthex = await digestmessage(text); console.log(digesthex); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.digest()' in that specification.
getTrackById() - Web APIs
the texttracklist method gettrackbyid() returns the first texttrack object from the track list whose id matches the specified string.
... this lets you find a specified track if you know its id string.
... syntax var thetrack = texttracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
... return value a texttrack object indicating the first track found within the texttracklist whose id matches the specified string.
TransitionEvent() - Web APIs
type is a domstring representing the name of the type of the transitionevent.
... propertyname optional is a domstring containing the value of the property-name css property associated with the transition.
... pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
... if the animation doesn't run on a pseudo-element but on the element, an empty string: "".
URLSearchParams.set() - Web APIs
params.set('baz', 3); params.tostring(); // "foo=1&bar=2&baz=3" below is a real-life example demonstrating how to create a url and set some search parameters.
... line #43: dumps the generated object and it's string representation to the console (info).
... 'use strict' function genurl(rexp, atext, bdebug=false){ let theurl theurl= new url('https://regexr.com') theurl.searchparams.set( 'expression', rexp.tostring() ) theurl.searchparams.set( 'tool', 'replace' ) theurl.searchparams.set( 'input', '\u2911\u20dc' )// ⤑⃜ theurl.searchparams.set( 'text', atext.join('\n') ) if( bdebug ){ // display the key/value pairs for(var pair of theurl.searchparams.entries()) { console.debug(pair[0] + ' = \'' + pair[1] + '\''); } console.debug(theurl) } return theurl } var url = genurl( /(^\s*\/\/|\s*[^:]\/\/).*\s*$|\s*\/\*(.|\n)+?\*\/\s*$/gm // single/multi-line comments // /(^\s*\/\/.*|\s*[^:]\/\/.*)/g // single-line comments ,[ ...
...next-line no-unused-vars", "lockpref( 'keyword.url',\t\t'https://duckduckgo.com/html/?q=!+' )\t// test", "/*", " * bla bla ", "*/", "", "/* bla bla */", "", "// bla bla ", "", "these shouldn\'t work:", "console.log(\"http://foo.co.uk/\")", "var url = \"http://regexr.com/foo.html?q=bar\"", "alert(\"https://mediatemple.net\")", ] , true ) console.info( url, url.tostring() ) // window.open( url, 'regex_site' ) specifications specification status comment urlthe definition of 'set()' in that specification.
getTrackById - Web APIs
the videotracklist method gettrackbyid() returns the first videotrack object from the track list whose id matches the specified string.
... this lets you find a specified track if you know its id string.
... syntax var thetrack = videotracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
... return value a videotrack object indicating the first track found within the videotracklist whose id matches the specified string.
Example and tutorial: Simple synth keyboard - Web APIs
this lets us provide a set of common values and special strings which the browser may optionally choose to display in some fashion; we provide names for the values 0.0 ("mute") and 1.0 ("100%").
... if (!object.entries) { object.entries = function entries(o) { return reduce(keys(o), (e, k) => concat(e, typeof k === 'string' && isenumerable(o, k) ?
...if the note's name is only one character, then we call createkey(), specifying the note string, octave, and frequency.
...then we add data-* attributes which contain the key's octave (attribute data-octave), string representing the note to play (attribute data-note), and frequency (attribute data-frequency) in hertz.
Worker() - Web APIs
WebAPIWorkerWorker
syntax var myworker = new worker(aurl, options); parameters aurl a usvstring representing the url of the script the worker will execute.
...available properties are as follows: type: a domstring specifying the type of worker to create.
... credentials: a domstring specifying the type of credentials to use for the worker.
... name: a domstring specifying an identifying name for the dedicatedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes.
XMLHttpRequest.response - Web APIs
the xmlhttprequest response property returns the response's body content as an arraybuffer, blob, document, javascript object, or domstring, depending on the value of the request's responsetype property.
... the value is null if the request is not yet complete or was unsuccessful, with the exception that when reading text data using a responsetype of "text" or the empty string (""), the response can contain the response so far while the request is still in the loading readystate (3).
... "" an empty responsetype string is treated the same as "text", the default type.
... text the response is a text in a domstring object.
XRInputSource.profiles - Web APIs
the read-only xrinputsource property profiles returns an array of strings, each describing a configuration profile for the input source.
... syntax let profilelist = xrinputsource.profiles; value an array of domstring objects, each describing one configuration profile for the input device represented by the xrinputsource object.
... usage notes input profile names an input profile name is a string describing a visual representation and behavior the input source may be configured to use.
... each string: has no spaces; instead, words are separated by hyphen ("-") characters if the platform makes it available, the usb vendor and product id may be provided but cannot be relied upon does not uniquely identify a specific device; rather, it identifies a configuration that the product is capable of using does not provide information about handedness of the device, if applicable the webxr input profiles registry is used by device developers and browser developers to attempt to ensure that a given device will report the same profile strings regardless of which browser or other user agent you use.
prefix - CSS: Cascading Style Sheets
if not specified, the default value will be "" (an empty string).
...it may be a <string>, <image>, or <custom-ident>.
... formal definition related at-rule@counter-styleinitial value"" (the empty string)computed valueas specified formal syntax <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
symbols - CSS: Cascading Style Sheets
this must be one of the following data types: <string> <image> (note: this value is "at risk" and may be removed from the specification.
... it is not yet implemented.) <custom-ident> description a symbol can be a string, image, or identifier.
... formal definition related at-rule@counter-styleinitial valuen/acomputed valueas specified formal syntax <symbol>+where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
font-variation-settings - CSS: Cascading Style Sheets
<string> <number> when rendering text, the list of opentype axis names is passed to the text layout engine to enable or disable font features.
... each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value.
... if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid.
... formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification.
src - CSS: Cascading Style Sheets
WebCSS@font-facesrc
/* fragment identifying font */ /* <font-face-name> values */ src: local(font); /* unquoted name */ src: local(some font); /* name containing space */ src: local("font"); /* quoted name */ /* multiple items */ src: local(font), url(path/to/font.svg) format("svg"), url(path/to/font.woff) format("woff"), url(path/to/font.otf) format("opentype"); values <url> [ format( <string># ) ]?
...the format hint contains a comma-separated list of format strings that denote well-known font formats.
... formal definition related at-rule@font-faceinitial valuen/a (required)computed valueas specified formal syntax [ <url> [ format( <string># ) ]?
... | local( <family-name> ) ]#where <family-name> = <string> | <custom-ident>+ examples specifying font resources using url() and local() @font-face { font-family: examplefont; src: local(example font), url('examplefont.woff') format("woff"), url('examplefont.otf') format("opentype"); } specifications specification status comment css fonts module level 3the definition of 'src' in that specification.
<custom-ident> - CSS: Cascading Style Sheets
the <custom-ident> css data type denotes an arbitrary user-defined string used as an identifier.
... forbidden values a <custom-ident> must not be placed between single or double quotes as this would be identical to a <string>.
...'bilibob' this would be a <string>.
... "bilibob" this would be a <string>.
font-variation-settings - CSS: Cascading Style Sheets
<string> <number> when rendering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features.
... each setting is always one or more pairs consisting of a <string> of 4 ascii characters followed by a <number> indicating the axis value to set.
... if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea transform formal syntax normal | [ <string> <number> ]# examples you can find a number of other variable fonts examples at our variable fonts guide, v-fonts.com, and axis-praxis.org.
list-style-type - CSS: Cascading Style Sheets
syntax /* partial list of types */ list-style-type: disc; list-style-type: circle; list-style-type: square; list-style-type: decimal; list-style-type: georgian; list-style-type: trad-chinese-informal; list-style-type: kannada; /* <string> value */ list-style-type: '-'; /* identifier matching an @counter-style rule */ list-style-type: custom-counter-style; /* keyword value */ list-style-type: none; /* global values */ list-style-type: inherit; list-style-type: initial; list-style-type: unset; the list-style-type property may be defined as any one of: a <custom-ident> value a symbols() value a <string> value the keyword ...
... <string> the specified string will be used as the item's marker.
... list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valuediscapplies tolist itemsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <counter-style> | <string> | nonewhere <counter-style> = <counter-style-name> | symbols()where <counter-style-name> = <custom-ident> examples setting list item markers html list 1 <ol class="normal"> <li>hello</li> <li>world</li> <li>what's up?</li> </ol> list 2 <ol class="shortcut"> <li>looks</li> <li>like</li> <li>the</li> <li>same</li> </ol> css ol.normal { list-style-type: upper-alpha; } /* or ...
... support for a simple <string>.
text-align - CSS: Cascading Style Sheets
using a <string> value only, in which case the other value defaults to right.
... using both a keyword value and a <string> value.
... <string> when applied to a table cell, specifies the alignment character around which the cell's contents will align.
... editor's draft added the <string> value.
text-emphasis - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: text-emphasis-color text-emphasis-style syntax /* initial value */ text-emphasis: none; /* no emphasis marks */ /* <string> value */ text-emphasis: 'x'; text-emphasis: '点'; text-emphasis: '\25b2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* should not use.
... <string> display the given string as marks.
... authors should not specify more than one character in <string>.
... the ua may truncate or ignore strings consisting of more than one grapheme cluster.
str:concat() - EXSLT
WebEXSLTstrconcat
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:concat() returns a string containing all the string values in a node-set concatenated together.
... syntax str:concat(nodeset) parameters nodeset the node-set whose nodes' string values should be concatenated into one string.
... returns a string whose value is all the string values of the nodes in nodeset concatenated together.
... if nodeset is empty, an empty string is returned.
str:split() - EXSLT
WebEXSLTstrsplit
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.
... syntax str:split(string, pattern) parameters string the string to split.
... pattern the pattern indicating where to split the string.
... returns a node-set of token elements, each containing one token from the string.
str:tokenize() - EXSLT
WebEXSLTstrtokenize
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.
... syntax str:tokenize(string, delimiters) parameters string the string to tokenize.
... delimiters each character in this string is used as a word separator while tokenizing.
... returns a node-set of token elements, each containing one token from the string.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
tokenization of left angle-bracket within a tag given the string <foo<bar>, the new parser reads it as one tag named foo<bar.
... in an inline script, in order to use the literal strings <script, </script>, and <!--, you should prevent them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--.
... the older practice of escaping the string </script> by surrounding it with comment markers, while supported by html5, is problematic in cases where the closing comment marker is omitted (see preceding point).
...when the attribute value is not the empty string and does not contain whitespace, ", ', `, <, =, or >).
<del>: The Deleted Text element - HTML: Hypertext Markup Language
WebHTMLElementdel
datetime this attribute indicates the time and date of the change and must be a valid date string with an optional time.
... if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp.
... for the format of the string without a time, see date strings.
... the format of the string if it includes both date and time is covered in local date and time strings.
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
value a domstring representing the value of the radio button.
... events change and input supported common attributes checked and value idl attributes checked and value methods select() value the value attribute is a domstring containing the radio button's value.
... additional attributes in addition to the common attributes shared by all <input> elements, radio inputs support the following attributes: attribute description checked a boolean indicating whether or not this radio button is the currently-selected item in the group value the string to use as the value of the radio when submitting the form, if the radio is currently toggled on checked a boolean attribute which, if present, indicates that this radio button is the currently selected one in the group.
...if the value is not otherwise specified, it is the string on by default.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number.
... value the value attribute contains a domstring which contains a string representation of the selected number.
... the value is never an empty string ("").
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
<ins> - HTML: Hypertext Markup Language
WebHTMLElementins
datetime this attribute indicates the time and date of the change and must be a valid date with an optional time string.
... if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp.
... for the format of the string without a time, see format of a valid date string.
... the format of the string if it includes both date and time is covered in format of a valid local date and time string.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
headers this attribute contains a list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element.
... axis obsolete since html5 this attribute contains a list of space-separated strings.
... each string is the id of a group of cells that this header applies to.
...this attribute may be used with one of sixteen predefined color strings: black = "#000000" green = "#008000" silver = "#c0c0c0" lime = "#00ff00" gray = "#808080" olive = "#808000" white = "#ffffff" yellow = "#ffff00" maroon = "#800000" navy = "#000080" red = "#ff0000" blue = "#0000ff" purple = "#800080" teal = "#008080" fuchsi...
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
6 date and time formats used in html date, element, format, html, iso 8601, input, reference, string, time, week, datetime, datetime-local, del, ins, month, month-year, week-year certain html elements use date and/or time values.
... the formats of the strings that specify these values are described in this article.
...property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>.
...the value is a string whose value is in the format "yyyy-mm", where yyyy is the four-digit year and mm is the month number.
Referrer-Policy - HTTP
the origin, path, and querystring of the url are sent as a referrer when the protocol security level stays the same (http→http, https→https) or improves (http→https), but isn't sent to less secure destinations (https→http).
... origin-when-cross-origin send the origin, path, and query string when performing a same-origin request, but only send the origin of the document for other cases.
... strict-origin-when-cross-origin send the origin, path, and querystring when performing a same-origin request, only send the origin when the protocol security level stays the same while performing a cross-origin request (https→https), and send no header to any less-secure destinations (https→http).
... unsafe-url send the origin, path, and query string when performing any request, regardless of security.
HTTP Index - HTTP
WebHTTPIndex
104 csp: trusted-types the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
... 191 user-agent http, http header, reference, user-agent the user-agent request header contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent.
... 192 firefox user agent string reference compatibility, firefox, firefox 4, gecko, gecko 2.0, guide this document describes the user agent string used in firefox 4 and later and applications based on gecko 2.0 and later.
... for a breakdown of changes to the string in gecko 2.0, see final user agent string for firefox 4 (blog post).
Closures - JavaScript
rather than the callbacks all sharing a single lexical environment, the makehelpcallback function creates a new lexical environment for each callback, in which help refers to the corresponding string from the helptext array.
... consider the following case: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); this.getname = function() { return this.name; }; this.getmessage = function() { return this.message; }; } because the previous code does not take advantage of the benefits of using closures in this particular instance, we could instead rewrite it to avoid using closure as follows: function myobject(name, message) { this.name = name.tos...
...tring(); this.message = message.tostring(); } myobject.prototype = { getname: function() { return this.name; }, getmessage: function() { return this.message; } }; however, redefining the prototype is not recommended.
... the following example instead appends to the existing prototype: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype.getname = function() { return this.name; }; myobject.prototype.getmessage = function() { return this.message; }; in the two previous examples, the inherited prototype can be shared by all objects and the method definitions need not occur at every object creation.
Assertions - JavaScript
/oon\b/ matches the "oon" in "moon", because "oon" is the end of the string, thus not followed by a word character.
...the beginning and end of a string are considered non-words.
... examples general boundary-type overview example // using regex boundaries to fix buggy string.
... buggymultiline = `tey, ihe light-greon apple tangs on ihe greon traa`; // 1) use ^ to fix the matching at the begining of the string, and right after newline.
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.
... message rangeerror: invalid argument (edge) rangeerror: radix must be an integer at least 2 and no greater than 36 (firefox) rangeerror: tostring() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong?
... the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified.
... examples invalid cases (42).tostring(0); (42).tostring(1); (42).tostring(37); (42).tostring(150); // you cannot use a string like this for formatting: (12071989).tostring('mm-dd-yyyy'); valid cases (42).tostring(2); // "101010" (binary) (13).tostring(8); // "15" (octal) (0x42).tostring(10); // "66" (decimal) (100000).tostring(16) // "186a0" (hexadecimal) ...
TypeError: cyclic object value - JavaScript
json.stringify() doesn't try to solve them and fails accordingly.
... the json format per se doesn't support object references (although an ietf draft exists), hence json.stringify() doesn't try to solve them and fails accordingly.
... examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // typeerror: cyclic object value to serialize circular references you can use a library that supports them (e.g.
... the snippet below illustrates how to find and filter (thus causing data loss) a cyclic reference by using the replacer parameter of json.stringify(): const getcircularreplacer = () => { const seen = new weakset(); return (key, value) => { if (typeof value === "object" && value !== null) { if (seen.has(value)) { return; } seen.add(value); } return value; }; }; json.stringify(circularreference, getcircularreplacer()); // {"otherdata":123} ...
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
it uses a format string in the same format expected by the strftime() function in c.
... you can now either use the date.prototype.tolocaledatestring method if you just want to format one date.
... var today = new date(); var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var date = today.tolocaledatestring('de-de', options); console.log(date); // "freitag, 10.
...mai 2014" alternative standard syntax using date methods the date object offers several methods to build a custom date string.
RangeError: invalid date - JavaScript
the javascript exception "invalid date" occurs when a string leading to an invalid date has been provided to date or date.parse().
... a string leading to an invalid date has been provided to date or date.parse().
... examples invalid cases unrecognizable strings or dates containing illegal element values in iso formatted strings usually return nan.
... however, depending on the implementation, non–conforming iso format strings, may also throw rangeerror: invalid date, like the following cases in firefox: new date('foo-bar 2014'); new date('2014-25-23').toisostring(); new date('foo-bar 2014').tostring(); this, however, returns nan in firefox: date.parse('foo-bar 2014'); // nan for more details, see the date.parse() documentation.
Intl.Collator.prototype.compare() - JavaScript
the intl.collator.prototype.compare() method compares two strings according to the sort order of this collator object.
... syntax collator.compare(string1, string2) parameters string1 string2 the strings to compare against each other.
... description the compare getter function returns a number indicating how string1 and string2 compare to each other according to the sort order of this collator object: a negative value if string1 comes before string2; a positive value if string1 comes after string2; 0 if they are considered equal.
... var a = ['offenbach', 'Österreich', 'odenwald']; var collator = new intl.collator('de-u-co-phonebk'); a.sort(collator.compare); console.log(a.join(', ')); // → "odenwald, Österreich, offenbach" using compare for array search use the compare getter function for finding matching strings in arrays: var a = ['congrès', 'congres', 'assemblée', 'poisson']; var collator = new intl.collator('fr', { usage: 'search', sensitivity: 'base' }); var s = 'congres'; var matches = a.filter(v => collator.compare(v, s) === 0); console.log(matches.join(', ')); // → "congrès, congres" specifications specification ecmascript internationalization api (ecma-402)the definiti...
Intl.Locale.prototype.baseName - JavaScript
the intl.locale.prototype.basename property returns a substring of the locale's string representation, containing core information about the locale.
...the basename property returns basic, core information about the locale in the form of a substring of the complete data string.
... specifically, the property returns the substring containing the language, and the script and region if available.
... examples basic example let myloc = new intl.locale("fr-latn-ca"); // sets locale to canadian french console.log(myloc.tostring()); // prints out "fr-latn-ca-u-ca-gregory" console.log(myloc.basename); // prints out "fr-latn-ca" example with options in the input string // sets language to japanese, region to japan, // calendar to gregorian, hour cycle to 24 hours let japan = new intl.locale("ja-jp-u-ca-gregory-hc-24"); console.log(japan.tostring()); // prints out "ja-jp-u-ca-gregory-hc-h24" console.log(japan.basename); // prints out "ja-jp" example with options that override input string // input string indicates language as dutch and region as belgium, // but options o...
Intl.Locale.prototype.numberingSystem - JavaScript
c tamldec modern tamil decimal digits telu telugu digits thai thai digits tirh tirhuta digits tibt tibetan digits traditio traditional numerals — may be algorithmic vaii vai digits wara warang citi digits wcho wancho digits examples setting the numberingsystem value via the locale string in the unicode locale string spec, the values that numberingsystem represents correspond to the key nu.
... nu is considered a locale string "extension subtag".
...to set the numberingsystem value via the string argument to the locale constructor, first add the -u extension key.
...finally, add the numberingsystem value to the string.
Number.prototype.toFixed() - JavaScript
return value a string representing the given number using fixed-point notation.
... description tofixed() returns a string representation of numobj that does not use exponential notation and has exactly digits digits after the decimal place.
...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.
...note it rounds down - see warning above -2.34.tofixed(1) // returns -2.3 (due to operator precedence, negative number literals don't return a string...) (-2.34).tofixed(1) // returns '-2.3' specifications specification ecmascript (ecma-262)the definition of 'number.prototype.tofixed' in that specification.
Object.assign() - JavaScript
both string and symbol properties are copied.
... function test() { 'use strict'; let obj1 = { a: 0 , b: { c: 0}}; let obj2 = object.assign({}, obj1); console.log(json.stringify(obj2)); // { "a": 0, "b": { "c": 0}} obj1.a = 1; console.log(json.stringify(obj1)); // { "a": 1, "b": { "c": 0}} console.log(json.stringify(obj2)); // { "a": 0, "b": { "c": 0}} obj2.a = 2; console.log(json.stringify(obj1)); // { "a": 1, "b": { "c": 0}} console.log(json.stringify(obj2)); // { "a": 2, "b": { "c": 0}} obj2.b.c = 3; console.log(json.stringify(obj1)); // { "a": 1...
..., "b": { "c": 3}} console.log(json.stringify(obj2)); // { "a": 2, "b": { "c": 3}} // deep clone obj1 = { a: 0 , b: { c: 0}}; let obj3 = json.parse(json.stringify(obj1)); obj1.a = 4; obj1.b.c = 4; console.log(json.stringify(obj3)); // { "a": 0, "b": { "c": 0}} } test(); merging objects const o1 = { a: 1 }; const o2 = { b: 2 }; const o3 = { c: 3 }; const obj = object.assign(o1, o2, o3); console.log(obj); // { a: 1, b: 2, c: 3 } console.log(o1); // { a: 1, b: 2, c: 3 }, target object itself is changed.
...// note, only string wrappers can have own enumerable properties.
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.
... syntax object.entries(obj) parameters obj the object whose own enumerable string-keyed property [key, value] pairs are to be returned.
... return value an array of the given object's own enumerable string-keyed property [key, value] pairs.
... description object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object.
RegExp.prototype[@@matchAll]() - JavaScript
the [@@matchall] method returns all matches of the regular expression against a string.
... syntax regexp[symbol.matchall](str) parameters str a string that is a target of the match.
... description this method is called internally in string.prototype.matchall().
... examples direct call this method can be used in almost the same way as string.prototype.matchall(), except for the different value of this and the different order of arguments.
Symbol() constructor - JavaScript
syntax symbol([description]) parameters description optional a string.
... examples creating symbols to create a new primitive symbol, you write symbol() with an optional string as its description: let sym1 = symbol() let sym2 = symbol('foo') let sym3 = symbol('foo') the above code creates three new symbols.
... note that symbol("foo") does not coerce the string "foo" into a symbol.
...o') === symbol('foo') // false new symbol(...) the following syntax with the new operator will throw a typeerror: let sym = new symbol() // typeerror this prevents authors from creating an explicit symbol wrapper object instead of a new symbol value and might be surprising as creating explicit wrapper objects around primitive data types is generally possible (for example, new boolean, new string and new number).
Symbol.matchAll - JavaScript
the symbol.matchall well-known symbol returns an iterator, that yields matches of the regular expression against a string.
... this function is called by the string.prototype.matchall() method.
... description this symbol is used for string.prototype.matchall() and specifically in regexp.prototype[@@matchall]().
...no enumerable no configurable no examples using symbol.matchall let re = /[0-9]+/g; let str = '2016-01-02|2019-03-07'; const numbers = { *[symbol.matchall] (str) { for (const n of str.matchall(/[0-9]+/g)) yield n[0]; } }; console.log(array.from(str.matchall(numbers))); // array ["2016", "01", "02", "2019", "03", "07"] see string.prototype.matchall() and regexp.prototype[@@matchall]() for more examples.
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.
... for more information, see regexp.prototype[@@replace]() and string.prototype.replace().
... property attributes of symbol.replace writable no enumerable no configurable no examples using symbol.replace class customreplacer { constructor(value) { this.value = value; } [symbol.replace](string) { return string.replace(this.value, '#!@?'); } } console.log('football'.replace(new customreplacer('foo'))); // expected output: "#!@?tball" specifications specification ecmascript (ecma-262)the definition of 'symbol.replace' in that specification.
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.
... for more information, see regexp.prototype[@@search]() and string.prototype.search().
... property attributes of symbol.search writable no enumerable no configurable no examples custom string search class caseinsensitivesearch { constructor(value) { this.value = value.tolowercase(); } [symbol.search](string) { return string.tolowercase().indexof(this.value); } } console.log('foobar'.search(new caseinsensitivesearch('bar'))); // expected output: 3 specifications specification ecmascript (ecma-262)the definition of 'symbol.search' in that specificat...
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.
... for more information, see regexp.prototype[@@split]() and string.prototype.split().
... property attributes of symbol.split writable no enumerable no configurable no examples custom reverse split class reversesplit { [symbol.split](string) { const array = string.split(' '); return array.reverse(); } } console.log('another one bites the dust'.split(new reversesplit())); // expected output: [ "dust", "the", "bites", "one", "another" ] specifications specification ecmascript (ecma-262)the definition of 'symbol.split' in that specification.
TypedArray.prototype.join() - JavaScript
the join() method joins all elements of an array into a string.
...specifies a string to separate each element.
... the separator is converted to a string if necessary.
... return value a string with all array elements joined.
in operator - JavaScript
syntax prop in object parameters prop a string or symbol representing a property name or array index (non-symbols will be coerced to strings).
...for example, you can specify a string created with the string constructor, but you cannot specify a string literal.
... let color1 = new string('green') 'length' in color1 // returns true let color2 = 'coral' // generates an error (color2 is not a string object) 'length' in color2 using in with deleted or undefined properties if you delete a property with the delete operator, the in operator returns false for that property.
...(if you want to check for only non-inherited properties, use object.prototype.hasownproperty() instead.) 'tostring' in {} // returns true specifications specification ecmascript (ecma-262)the definition of 'relational operators' in that specification.
throw - JavaScript
each of the following throws an exception: throw 'error2'; // generates an exception with a string value throw 42; // generates an exception with the value 42 throw true; // generates an exception with the value true throw new error('required'); // generates an error object with the message of required also note that the throw statement is affected by automatic semicolon insertion (asi) as no line terminator between the throw keyword and the expression is allowed.
... else { throw new userexception('invalidmonthno'); } } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s.
... */ function zipcode(zip) { zip = new string(zip); pattern = /[0-9]{5}([- ]?[0-9]{4})?/; if (pattern.test(zip)) { // zip code value will be the first match in the string this.value = zip.match(pattern)[0]; this.valueof = function() { return this.value }; this.tostring = function() { return string(this.value) }; } else { throw new zipcodeformatexception(zip); } } functi...
...on zipcodeformatexception(value) { this.value = value; this.message = 'does not conform to the expected format for a zip code'; this.tostring = function() { return this.value + this.message; }; } /* * this could be in a script that validates address data * for us addresses.
<ms> - MathML
WebMathMLElementms
the mathml <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems.
... by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display.
... note that quotation marks should not be specified unless they are part of the string literal.
... the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements.
MathML documentation index - MathML
WebMathMLIndex
27 <ms> mathml, mathml reference, mathml:element, mathml:token elements the mathml <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems.
... by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display.
... note that quotation marks should not be specified unless they are part of the string literal.
... the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements.
Content type - SVG: Scalable Vector Graphics
an rgb start-function is the case-insensitive string "rgb(", for example "rgb(" or "rgb(".
...some attributes allow both iris and text strings as content.
... to disambiguate a text string from a relative iri, the functional notation <funciri> is used.
... name <name> a name, which is a string where a few characters of syntactic significance are disallowed.
<style> - SVG: Scalable Vector Graphics
WebSVGElementstyle
html,body,svg { height:100%; margin: 0; padding: 0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> circle { fill: gold; stroke: maroon; stroke-width: 2px; } </style> <circle cx="5" cy="5" r="4" /> </svg> attributes type this attribute defines type of the style sheet language to use as a media type string.
... value type: <string>; default value: text/css; animatable: no media this attribute defines to which media the style applies.
... value type: <string>; default value: all; animatable: no title this attribute the title of the style sheet which can be used to switch between alternate style sheets.
... value type: <string>; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<style>' in that specification.
concat - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the concat function concatenates two or more strings and returns the resulting string.
... syntax concat(string1 ,string2 [,stringn]* ) arguments stringn this function accepts two or more arguments.
... each of these arguments is a string.
... returns a single string that is the concatenation of all the strings passed to the function as arguments.
namespace-uri - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the namespace-uri function returns a string representing the namespace uri of the first node in a given node-set.
... returns a string representing uri of the namespace in which the given node resides.
... notes if the given node does not have a specified namespace, the returned string will be an empty string.
... for nodes other than element and attribute nodes, the returned string will always be an empty string.
normalize-space - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the normalize-space function strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.
... syntax normalize-space( [string] ) arguments string (optional) the string to be normalized.
... if omitted, string used will be the same as the context node converted to a string.
... returns the normalized string.
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
value contains the string value for the parameter.
...the datatype will always bestring.
... examples set the parameter 'color' to the string 'red': <?xslt-param name="color" value="red"?> set the parameter 'columns' to the number 2: <?xslt-param name="columns" select="2"?> set the parameter 'books' to a nodeset containing all <book> elements in the null namespace: <?xslt-param name="books" select="//book"?> set the parameter 'show-toc' to boolean true: <?xslt-param name="show-toc" select="true()"?> the select attribute co...
...document() seems useful, but it seems tricky to maintain the invariant that generate-id() should produce the same string for the same document.
Communicating using "postMessage" - Archive of obsolete content
constructor: panel = require("sdk/panel").panel({ onmessage: function(contentscriptmessage) { // handle message from the content script } }); message events versus user-defined events you can use message events as an alternative to user-defined events: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.postmessage(event.target.tostring());" + "}, false);"; var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.on('message', function(message) { console.log('mouseover: ' + message); }); } }); the reason to prefer user-defined events is that as soon as you need to send more than one type of message, then both sen...
...now we have to embed the event type in the message payload, and implement a switch function in the receiver to dispatch the message: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.postmessage({" + " kind: 'mouseover'," + " element: event.target.tostring()" + " });" + "}, false);" + "window.addeventlistener('mouseout', function(event) {" + " self.postmessage({" + " kind: 'mouseout'," + " element: event.target.tostring()" + " });" + " }, false);" var pagemod = require('sdk/page-mo...
...log('mouseover: ' + message.element); break; case 'mouseout': console.log('mouseout: ' + message.element); break; } }); } }); implementing the same add-on with user-defined events is shorter and more readable: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.port.emit('mouseover', event.target.tostring());" + "}, false);" + "window.addeventlistener('mouseout', function(event) {" + " self.port.emit('mouseout', event.target.tostring());" + "}, false);"; var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.port.on('mouseover', func...
simple-storage - Archive of obsolete content
to store a value, just assign it to a property on storage: var ss = require("sdk/simple-storage"); ss.storage.myarray = [1, 1, 2, 3, 5, 8, 13]; ss.storage.myboolean = true; ss.storage.mynull = null; ss.storage.mynumber = 3.1337; ss.storage.myobject = { a: "foo", b: { c: true }, d: null }; ss.storage.mystring = "o frabjous day!"; you can store array, boolean, number, object, null, and string values.
... if you'd like to store other types of values, you'll first have to convert them to strings or another one of these types.
...properties with array, boolean, number, object, null, and string values will be persisted.
content/symbiont - Archive of obsolete content
contentscriptwhen string when to load the content scripts.
... any kind of jsonable value (object, array, string, etc.) can be used here.
... any kind of jsonable value (object, array, string, etc.) can be used here.
core/heritage - Archive of obsolete content
also you can mix inheritance and composition together if necessary: var point = class({ initialize: function initialize(x, y) { this.x = x; this.y = y; }, tostring: function tostring() { return this.x + ':' + this.y; } }) var pixel = class({ extends: point, implements: [ color ], initialize: function initialize(x, y, color) { color.prototype.initialize.call(this, color); point.prototype.initialize.call(this, x, y); }, tostring: function tostring() { return this.hex() + '@' + point.prototype.tostring.call(this) } }); var pixel...
... = pixel(11, 23, 'cc3399'); pixel.tostring(); // => #cc3399@11:23 pixel instanceof pixel // => true pixel instanceof point // => true extend module exports extend utility function, that is useful for creating objects that inherit from other objects, without associated classes.
... var { mix } = require('sdk/core/heritage'); var object = mix({ a: 1, b: 1 }, { b: 2 }, { c: 3 }); json.stringify(object) // => { "a": 1, "b": 2, "c": 3 } obscure module exports obscure utility function that is useful for defining non-enumerable properties.
event/target - Archive of obsolete content
worker.on('message', function (data) { console.log('data received: ' + data) }); parameters type : string the type of event.
... parameters type : string the type of event.
... parameters type : string the type of event.
stylesheet/utils - Archive of obsolete content
parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
... parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
... parameters type : string the type of the sheet.
Developing for Firefox Mobile - Archive of obsolete content
then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started.
...for example, on mac os x or linux you can use a command like the one below to filter only the lines of console output: adb logcat | grep console you can experiment with different filter strings on adb logcat to focus in on the lines relevant to you.
... supported clipboard not supported context-menu not supported hotkeys supported indexed-db supported l10n supported notifications supported page-mod supported page-worker supported panel not supported passwords supported private-browsing not supported querystring supported request supported selection not supported self supported simple-prefs supported simple-storage supported system supported tabs supported timers supported ui not supported url supported widget not supported windows supported low-level a...
Unit Testing - Archive of obsolete content
in its place create a file called test-base64.js with the following contents: var base64 = require("../base64"); exports["test atob"] = function(assert) { assert.ok(base64.atob("agvsbg8=") == "hello", "atob works"); } exports["test btoa"] = function(assert) { assert.ok(base64.btoa("hello") == "agvsbg8=", "btoa works"); } exports["test empty string"] = function(assert) { assert.throws(function() { base64.atob(); }, "empty string check works"); } require("sdk/test").run(exports); note that with jpm we must give the exact relative path to the base64.js module.
... the second function tests the module's error-handling code by passing an empty string into atob() and using assert.throws() to check that the expected exception is raised.
...you should see something like this: console.info: jpm-utest: executing './test/test-base64.test atob' console.info: jpm-utest: pass: atob works console.info: jpm-utest: executing './test/test-base64.test btoa' console.info: jpm-utest: pass: btoa works console.info: jpm-utest: executing './test/test-base64.test empty string' console.info: jpm-utest: pass: empty string check works 3 of 3 tests passed.
Toolbar - Archive of obsolete content
* * @param {string} toolbarid the id of the toolbar to install to.
... * @param {string} id the id of the button to install.
... * @param {string} afterid the id of the element to insert after.
xml:base support in old browsers - Archive of obsolete content
heme)) { // only check for xml base if there is no protocol // tests for 'scheme' per http://www.ietf.org/rfc/rfc2396.txt' xmlbase = getxmlbase (thisitem); if (!xmlbase.match(/\/$/) && !xlink.match(/\/$/)) { // if no preceding slash on xlink or trailing slash on xml:base, add one in between xmlbase += '/'; } else if (xmlbase.match(/\/$/) && xlink.match(/\/$/)) { xmlbase = xmlbase.substring(0, xmlbase.length-2); // strip off last slash to join with xlink path with slash } // alert(xmlbase + '::' + xlink); } var link = xmlbase + xlink; if (!link.match(scheme)) { // if there is no domain, we'll need to use the current domain var loc = window.location; if (link.indexof('/') === 0 ) { // if link is an absolute url, it should be from the host only link...
... = loc.protocol + '//' + loc.host + link; } else { // if link is relative, it should be from full path, minus the file var dirpath = loc.pathname.substring(0, loc.pathname.lastindexof('/')-1); if (link.lastindexof('/') !== link.length-1) { link += '/'; } link = loc.protocol + '//' + loc.host + dirpath + link; } } return link; } function getxmlbase (thisitem) { // fix: need to keep going up the chain if still a relative url!!!!!
...3 : 2; // if the file protocol has an extra slashe, prepare to also skip it in the separator search var att2 = att.indexof('/', protocolpos+skipfile); // find first path separator ('/') after protocol if (att2 !== -1) { att = att.substring(0, att2 - 1); // don't want any trailing slash, as the absolute path to be added already has one } } else if (!att.match(/\/$/)) { // if no trailing slash, add one, since it is being attached to a relative path att += '/'; } xmlbase = att + xmlbase; // if previous path was not absolute, resolve against the full uri here' break; } else if (att.indexof('/') === 0...
Enhanced Extension Installation - Archive of obsolete content
tracking install locations since there is now only a single datasource, install location information is tracked for every item in the single datasource in the form of a string <em:installlocation> property on each item.
...log strings are written to the application's error console (in anticipation of that api automatically logging to a file) and to the terminal window.
... the nsiextensionmanager interface now has a single, unified set of installation/enabling interfaces: void installitemfromfile(in nsifile file, in string locationkey); void uninstallitem(in string id); void enableitem(in string id); void disableitem(in string id); uninstall logs are no longer written, since the item folder is removed completely on uninstall.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
web script example <script type="application/javascript"> <!-- function install (aevent) { for (var a = aevent.target; a.href === undefined;) a = a.parentnode; var params = { "foo": { url: aevent.target.href, iconurl: aevent.target.getattribute("iconurl"), hash: aevent.target.getattribute("hash"), tostring: function () { return this.url; } } }; installtrigger.install(params); return false; } //--> </script> <a href="http://www.example.com/foo.xpi" iconurl="http://www.example.com/foo.png" hash="sha1:28857e60d043447c5f4550853f2d40770b326a13" onclick="return install(event);">install extension!</a> let's go through this piece by piece.
... the install first creates a parameter block: var params = { "foo": { url: aevent.target.href, iconurl: aevent.target.getattribute("iconurl"), hash: aevent.target.getattribute("hash"), tostring: function () { return this.url; } }; this specifies the display name (foo) for use in the confirmation dialog, the url to the extension (which is the link href, recall), the icon url to display in the confirmation dialog, a hash of the xpi file contents (to protect against corrupted downloads), and a tostring function which will allow this code to work with versions of firefox 0.8 and earlier.
... tostring() the tostring() property should return the xpi url, for compatibility with firefox browsers older than version 1.0, and other applications such as seamonkey.
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
enter the names of the other attributes whose values you want to store as a space-delimited ascii string into the value for persist; the next time that xul document is opened, the saved values will automatically be restored4.
...the labels for these buttons are set using the buttonlabelextra1 and buttonlabelextra2 attributes on the root element, which take arbitrary strings as their values.
...if you want to insert long strings that automatically wrap to the window’s width, you can use the flex attribute as shown in listing 14, which will automatically expand it; in this case you don't set the value using the value attribute, instead you should place it in the contents of the element.
Connecting to Remote Content - Archive of obsolete content
since eval executes any code contained in the string, workarounds had to be devised in order to close security holes.
... request.onload = function(aevent) { let text = aevent.target.responsetext; let jsobject = json.parse(text); window.alert(jsobject.shops[1].name); // => "orange" window.alert(jsobject.total); // => 2; }; the javascript object can also be serialized back with the stringify method.
... let string = json.stringify(jsobject); xml content xml is possibly the most popular data interchange format.
Introduction - Archive of obsolete content
you can identify the level of compatibility of web standards in gecko-based browsers looking at their user agent string, which should include the gecko version.
...the user agent string for firefox at the time of this writing (in us english, mac os x) is: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:25.0.1) gecko/20100101 firefox/25.0.1 the highlighted section is the gecko version: 25.0.1.
... you can read and copy the user agent string of any firefox window, choosing "help > troubleshooting information" from the main menu.
Supporting search suggestions in search plugins - Archive of obsolete content
your server should then decide upon the suggestions to offer using whatever means it sees fit, and return a json array of results: query string the first element in the array is the original query string.
... for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, leaving out the optional elements.
... your completion list can include as many suggestions as you like, although it should be kept manageable, given that the display will be updating live while the user is typing their search string.
CSS3 - Archive of obsolete content
selectors level 3 recommendation since september 29th, 2011 adds: substring matching attribute selectors, e[attribute^="value"], e[attribute$="value"], e[attribute*="value"] .
... at risk: due to insufficient browser support, the 2-value syntax of this property as well as the support for <string> values may be postponed to the next iteration of this module.
... the css text-align property with a <string> value to align on that character.
Creating a status bar extension - Archive of obsolete content
this sample will add a static text string to the status bar at the bottom of firefox browser windows.
...in this sample, these fields are: property name description id a unique identification string.
...starting with firefox 1.5, however, you should use a string in the form extension-name@creator-domain.
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
example: [hkey_local_machine\\software\\mozilla\\compuserve 7.0] look at the geckover string value found there, and ascertain its value, e.g.
...the geckover string value deterimines what milestone of mozilla the browser is built against.
...under hkey_local_machine\software\mozilla\compuserve 7.0 you'll find: "plugins folders"="c:\\program files\\common files\\csshare\\plugins0942" "product"="compuserve" "version"="7.0" "displayname"="compuserve 7.0" the product, version, and displayname string values are currently only written by compuserve 7.0, and they are written alongside the geckover string value.
Using XML Data Islands in Mozilla - Archive of obsolete content
<price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> the xml source text can then be retrieved like this: var ordersource = document.getelementbyid("purchase-order").textcontent; the xml source text can be parsed into a dom tree using the domparser api: var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); the html5 data block-based way shown here works in firefox, opera, webkit-based browsers such as chrome and safari, and ie9 while ie's xml data islands work only in ie.
...s="http://example.mozilla.org/purchaseorderml"> <lineitem> <name>line item 1</name> <price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> <script> function rundemo() { var ordersource = document.getelementbyid("purchase-order").textcontent; var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); var lineitems = doc.getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "lineitem"); var firstprice = lineitems[0].getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "price")[0].textcontent; document.body.textcontent = "the purchase order contains " + lineitems.length + " line items.
... the price of the first line item is " + firstprice + "."; } </script> </head> <body onload="rundemo()";> demo did not run </body> </html> the xml source text can be parsed into a dom tree using the domparser api: var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); the html5 data block-based way shown here works in firefox, opera, webkit-based browsers such as chrome and safari, and ie9 while ie's xml data islands work only in ie.
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
the handler receives the assert string, and sequentially attempts to match each word in the string (left to right) to registry dword names from hklm\software\mozilla.org\windbgdlg and hkcu\software\mozilla.org\windbgdlg.
...note that double quotes which delimit an item (") are ignored in value names and the assertion string, so "silly" and silly will both be matched by a value named silly.
... "silly", will only be matched by a value named "silly", since the quotes are internal to the string.
Code snippets - Archive of obsolete content
envelope.payload = json.stringify(payload); r.put(json.stringify(envelope)); generate new keys // clients always wipe the server when they generate new keys.
...components.utils.import("resource://services-sync/engines.js"); components.utils.import("resource://services-sync/engines/bookmarks.js"); let bme = weave.service.enginemanager.get("bookmarks"); let ids = object.keys(bme._store.getallids()); for each (let id in ids) { let record = bme._store.createrecord(id, "bookmarks"); let len = record.tostring().length; if (len > 1000) { console.log("id: " + id + ", len = " + len + ", " + record.title); } } print an alphabetically sorted list of members of a collection components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); let ids = json.parse(new resource(weave.service.storageurl + "bookmarks").get()); for each (let id in...
... let coll = new collection(weave.service.storageurl + collection, recordtype); coll.full = true; coll.limit = null; coll.recordhandler = function(item) { item.collection = collection; item.decrypt(); if (item.deleted) { deleted++; } else { items[item.type] = 1 + (items[item.type] || 0); } }; coll.get(); console.log("deleted: " + deleted + ", " + json.stringify(items)); get a log from xul fennec view about:sync-log.
Creating a Help Content Pack - Archive of obsolete content
the attribute is a space-separated list of platform strings.
... strings recognized from 1.8 onward are win, mac, os2, and unix; more will be added as required.
... unrecognized strings are ignored during parsing.
generateCRMFRequest() - Archive of obsolete content
keysizen the size in bits of the nth key to generate "keyparamsn" this string is an optional algorithm dependent parameter value.
...the string found by accessing crmfobject.request is the base-64 encoded crmf message to be sent to the ca/ra, or an error string.
... the possible error strings are: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value.
Tabs - Archive of obsolete content
ArchiveMozillaJetpackUITabs
blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded.
...methods open(urlstring)opens a new tab in your browser with a defined url.
... urlurl to be openedstring jetpack.tabs.open("http://www.example.com/"); blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded.
Safely loading URIs - Archive of obsolete content
in general, the following guidelines apply for gecko 1.8: if you plan pass a uri string to nsiwebnavigation.loaduri (which can happen indirectly, e.g.
... by passing the string to something that loads it in a <browser> or <iframe>), you must call checkloaduristr to be secure.
... if you're doing anything else (passing a uri string to some other api like window.open or <img src="">, passing a uri object to an api that loads uri objects, etc.) use whichever method best fits the data you can get your hands on.
Windows stub installer - Archive of obsolete content
note that there are several macro strings--a macro name wrapped in dollar ($) signs--which may be used in the .jsts, including: $version$ which is replaced at packages time with the browser version.
... other macro strings listed in makejs.pl can be found by searching for "version", which is one of the macro strings, until you find the line $line =~ s/\$version\$/$inversion/i; other macro strings are grouped in this section.
... as with "version", the macro name will be the first string in the substitution statement on each line.
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.
... filename a string representing the name of the file to be installed.
... aliasname a string representing the name of the alias itself.
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.
...once you have this object, you can call its methods to retrieve strings from the file or to add strings to the file.
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.
... version an installversion object or a string representing the version of the package being installed.
... when version is a string it should be up to four integer values delimited by periods, such as "1.17.1999.1517".
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.
... returns a javascript object whose property names are the keys from that file and whose values are the strings.
...this method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file.
getValue - Archive of obsolete content
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".
...use this method if the value you want is not a string.
... if the value is a string, the getvaluestring method is more convenient.
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".
... value a number representing the new string value.
...if the value is not a number, use the setvalue or setvaluestring methods instead.
A XUL Bestiary - Archive of obsolete content
by contrast, the skin is just the css and referenced graphics for a xul file, the localization strings are just a dtd, and the content is just the xul.
...like a chrome, that chunk usually contains xul content, css and graphic skin information, localization strings, and maybe some platform-specific code.
...the attribute has a value associated with it (such as the string "file" for the id attribute in the example above).
Introduction to XUL - Archive of obsolete content
xuldocument xuldocument extends document in a fashion similar to htmldocument's extension interface xuldocument : document { element getelementbyid(in domstring id); nodelist getelementsbyattribute(in domstring name, in domstring value); }; getelementbyid works like html's getelementbyid.
... interface xulelement : element { nodelist getelementsbyattribute(in domstring name, in domstring value); }; getelementsbyattribute functions as does its namesake in xuldocument, though this version returns only those elements which match the criteria and are descendants (in css selector terminology) of the given element.
...that is, a separate file of localized strings.
appendNotification - Archive of obsolete content
this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well.
... type - a string.
...this function receives as its only parameter a string indicating what event occurred.
caption - Archive of obsolete content
label type: string the label that will appear on the element.
... crop type: string gets and sets the value of the crop attribute.
... label type: string gets and sets the value of the label attribute.
checkbox - Archive of obsolete content
label type: string the label that will appear on the element.
... crop type: string gets and sets the value of the crop attribute.
... label type: string gets and sets the value of the label attribute.
description - Archive of obsolete content
value type: string the string attribute allows you to associate a data value with an element.
... crop type: string gets and sets the value of the crop attribute.
... value type: string gets and sets the value of the value attribute.
listbox - Archive of obsolete content
value type: string the string attribute allows you to associate a data value with an element.
... seltype type: string gets and sets the value of the seltype attribute.
... value type: string gets and sets the value of the value attribute.
richlistbox - Archive of obsolete content
value type: string the string attribute allows you to associate a data value with an element.
... seltype type: string gets and sets the value of the seltype attribute.
... value type: string gets and sets the value of the value attribute.
where - Archive of obsolete content
ArchiveMozillaXULwhere
otherwise, the entire value string is compared.
... less the numeric value of the subject must be less than the value greater the numeric value of the subject must be greater than the value before the string value of subject must come before value alphabetically after the string value of subject must come after value alphabetically startswith the value of subject must start with the value endswith the value of subject must end with the value contains the value of subject must contain the value as a substring subject type: string the variable or string to compare.
... value type: string the value to compare.
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 nsisupports aextra, in nsiprincipal arequestprincipal); constants content types constant value description type_other 1 ...
... short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal ); parameters acontenttype the type of content being tested.
... short shouldprocess( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra, in nsiprincipal arequestprincipal ); parameters acontenttype the type of content being tested.
Archived Mozilla and build documentation - Archive of obsolete content
creating regular expressions for a microsummary generator a regular expression is a special kind of string (i.e.
... a sequence of characters) that matches patterns of characters in other strings.
... the life of an html http request the new nsstring class implementation (1999) this document is intended to briefly describe the new nsstring class architecture, and discuss the implications on memory management, optimizations, internationalization and usage patterns.
Extentsions FAQ - Archive of obsolete content
you can use nsisecretdecoderring.encryptstring() and nsisecretdecoderring.decryptstring().
... how to attach information using the stringproperties of an imap message with out changing the properties?
... string properties are implemented as imap user flags.
-ms-filter - Archive of obsolete content
syntax the -ms-filter property is specified as a string that contains a list of one or more items, separated by spaces, of the following types: filters transitions procedural surfaces formal syntax filter: <-ms-filter-function>+ -ms-filter: [ "'" <-ms-filter-function># "'" ] | [ '"' <-ms-filter-function># '"' ] where <-ms-filter-function> = <-ms-filter-function-progid> | <-ms-filter-function-legacy> where <-ms-filter-function-progid> = 'prog...
...id:' [ <ident-token> '.' ]* [ <ident-token> | <function-token> <any-value> ')' ] <-ms-filter-function-legacy> = <ident-token> | <function-token> <any-value> ')' the <string> contains the list of filters, transitions, and procedural surfaces.
... initial value"" (the empty string)applies toall elementsinheritednocomputed valueas specifiedanimation typediscrete remarks the following table lists the most popular dx filters and their standards-based alternatives: dx filter standards-based alternative alpha opacity alphaimageloader <img> or background-image and related properties gradient background-image: linear-gradient...
Debug - Archive of obsolete content
in windows 8.x store apps, the write and writeln functions of the debug object display strings in the visual studio output window at run time.
... debug.write sends strings to the script debugger.
... debug.writeln sends strings to the script debugger, followed by a newline character.
New in JavaScript 1.1 - Archive of obsolete content
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.
... tostring(): added radix parameter, which specifies the base to use for representing numeric values.
... isnan() now works on every platform (not only unix anymore) parsefloat() and parseint() now return nan on all platforms, if the first character of the specified string cannot be converted to a number; in previous releases, it returned nan on solaris and irix and zero on all other platforms.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
in_safe_integer (firefox 31) number.issafeinteger() (firefox 32) additions to the object object object.prototype.__proto__ has been standardized object.is() (firefox 22) object.setprototypeof() (firefox 31) object.assign() (firefox 34) object.getownpropertysymbols() (firefox 33) additions to the date object date.prototype is an ordinary object (firefox 41) generic date.prototype.tostring (firefox 41) date.prototype[@@toprimitive] (firefox 44) new promise object promise (firefox 24, enabled by default in firefox 29) new proxy object proxy (firefox 18) preventextensions() trap (firefox 22) isextensible() trap (firefox 31) getprototypeof() and setprototypeof() traps (firefox 49) new reflect object reflect (firefox 42) additions to the regexp object regexp sti...
...cky (y) flag (firefox 38) regexp unicode (u) flag (firefox 46) generic regexp.prototype.tostring (firefox 39) regexp.prototype[@@match]() (firefox 49) regexp.prototype[@@replace]() (firefox 49) regexp.prototype[@@search]() (firefox 49) regexp.prototype[@@split]() (firefox 49) get regexp[@@species] (firefox 49) additions to the string object string.fromcodepoint() (firefox 29) string.prototype.codepointat() (firefox 29) string.prototype.startswith(), string.prototype.endswith() (firefox 17) string.prototype.includes() (firefox 40) (formerly string.prototype.contains() (firefox 17)) string.prototype.repeat() (firefox 24) string.prototype.normalize() (firefox 31) string.raw() (firefox 34) \u{xxxxxx} unicode code point escapes (firefox 40) new symbol object symbol (firefox 36...
...parameters (firefox 15) parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox 41) arrow functions (firefox 22) generator function (firefox 26) yield (firefox 26) yield* (firefox 27) arguments[@@iterator] (firefox 46) other features binary and 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) ...
Implementing controls using the Gamepad API - Game development
gamepad object there's lots of useful information contained in the gamepad object, with the states of buttons and axes being the most important: id: a string containing information about the controller.
... mapping standard the mapping type is now an enumerable object instead of a string: enum gamepadmappingtype { "", "standard" }; this enum defines the set of known mappings for a gamepad.
...if the layout is unknown, it is set to an empty string.
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
the content attribute is always a string even when the expected value should be an integer.
...however, the type idl attribute will return the string "text".
... idl attributes are not always strings; for example, input.maxlength is a number (a signed long).
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
there are 6 primitive data types: string, number, bigint, boolean, undefined, and symbol.
... 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(); ...
... primitive wrapper objects in javascript except for null and undefined, all primitive values have object equivalents that wrap around the primitive values: string for the string primitive.
Type coercion - MDN Web Docs Glossary: Definitions of Web-related terms
type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers).
... examples const value1 = '5'; const value2 = 9; let sum = value1 + value2; console.log(sum); in the above example, javascript has coerced the 9 from a number into a string and then concatenated the two values together, resulting in a string of 59.
... javascript had a choice between a string or a number and decided to use a string.
Sending forms through JavaScript - Learn web development
for( name in data ) { urlencodeddatapairs.push( encodeuricomponent( name ) + '=' + encodeuricomponent( data[name] ) ); } // combine the pairs into a single string and replace all %-encoded spaces to // the '+' character; matches the behaviour of browser form submissions.
... if( file.dom.files[0] ) { reader.readasbinarystring( file.dom.files[0] ); } // if not, read the file once the user selects it.
... file.dom.addeventlistener( "change", function () { if( reader.readystate === filereader.loading ) { reader.abort(); } reader.readasbinarystring( file.dom.files[0] ); } ); // senddata is our main function function senddata() { // if there is a selected file, wait it is read // if there is not, delay the execution of the function if( !file.binary && file.dom.files.length > 0 ) { settimeout( senddata, 10 ); return; } // to construct our multipart form data request, // we need an xmlhttprequest instance const xhr = new xmlhttprequest(); // we need a separator to define each part of the request const boundary = "blob"; // store our body request in a string.
Using data attributes - Learn web development
you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a dataset property.
... const article = document.queryselector('#electric-cars'); article.dataset.columns // "3" article.dataset.indexnumber // "12314" article.dataset.parent // "cars" each property is a string and can be read and written.
... data values are strings.
Advanced text formatting - Learn web development
bbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.on...
...bbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.on...
...bbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.on...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
the following function creates a new date() object, extracts a time string out of it using tolocaletimestring(), and then displays it in the ui.
... it then runs the function once per second using setinterval(), creating the effect of a digital clock that updates once per second (see this live, and also see the source): function displaytime() { let date = new date(); let time = date.tolocaletimestring(); document.getelementbyid('demo').textcontent = time; } const createclock = setinterval(displaytime, 1000); just like settimeout(), setinterval() returns an identifying value you can use later when you need to clear the interval.
... you also want to calculate the number of hours, minutes, and seconds as separate values, and then show them together in a string after each loop iteration.
Manipulating documents - Learn web development
text node: a node containing a text string.
...you just have to make sure your data is in the right format; javascript makes it easier than many other languages, being weakly typed — for example numbers will convert to strings automatically when you want to print them to the screen.
... next, empty the input element by setting its value to an empty string — ''.
Third-party APIs - Learn web development
you can adjust the position by specifying an options object as a parameter for the control containing a position property, the value of which is a string specifying a position for the control.
...next, we use some string manipulation to assemble the full url that we will make the request to.
... find the string enter-api-key-here in the source code, and replace it with your api key.
Test your skills: Arrays - Learn web development
here you are provided with a string to work with.
... we'd like you to: convert the string into an array, removing the + characters in the process.
... finally, join the array items together in a single string called mystring, with a separator of " - ".
Website security - Learn web development
note: the sql statement treats the ' character as the beginning and end of a string literal.
... by putting a backslash in front of this character (\'), we escape the symbol, and tell sql to instead treat it as a character (just a part of the string).
...the sql will now interpret the name as the whole string in bold (which is a very odd name indeed, but not harmful).
Rendering a list of Vue components - Learn web development
to make sure that vue can accurately compare the key attributes, they need to be string or numeric values.
... make it required, and make its type a string.
... the <script> contents in your todoitem component should now look something like this: export default { props: { label: {required: true, type: string}, done: {default: false, type: boolean}, id: {required: true, type: string} }, data() { return { isdone : this.done, } }, } now, over in your app.vue component, pass item.id as a prop to the todoitem component.
Accessibility/LiveRegionDevGuide
in at-spi, this is accomplished by appending ":add" or ":remove" to the event string.
...in this case, the root event string is object:text-changed with ":delete" and ":insert" being appended to complete the event type.
...the event.any_data field holds the entire text string while event.detail1 is the start index while event.detail2 is the text string length.
Embedding API for Accessibility
be aware that in debug builds, this can cause a great number of assertions (bug 71598) to use prefs in embedding, use something like the following code: #include "nsipref.h"; nsresult rv; nscomptr<nsipref> prefs(do_getservice(ns_pref_contractid, &rv)); prefs->setboolpref("bool.pref.name", pr_true /* or pr_false */); prefs->setintpref("int.pref.name", newvalue); prefs->setcharpref("string.pref.name", newcharstarvalue); to manually add a pref to your settings, add a line like the following to your prefs.js: user_pref("accessibility.browsewithcaret", true); accessibility prefs reference the following is a description of what accessibility prefs give us (or will give us), for accessibility: functionality implementation works as of ...
... setcharpref("browser.visited_color", "#abcdef" /* hex color value */); setboolpref("browser.underline_anchors", boolunderlinelinks); moz 0.8 focus appearance setboolpref("browser.display.use_focus_colors", usefocuscolors); setcharpref("browser.display.focus_background_color", colorstring); setcharpref("browser.display.focus_text_color", colorstring); setcharpref("browser.display.focus_ring_width", numpixels); /* 0-4 */ moz 0.9.2 text selection appearance setcharpref("browser.selection.background_color", colorstring); setcharpref("browser.sele...
...ction.foreground_color", colorstring); setcharpref("browser.selection.border", cssborderstylestring); /* is a selection border hard to implement?
Choosing the right memory allocator
see the xpcom string guide for additional information.
... allocating strings in xpcom code see "callee-allocated parameters" in the xpcom strings guide; use tonewcstring() or tonewunicode() to allocate strings that will be passed out.
... these methods convert ns*string to nsimemory allocated, unowned [pruni]char* buffers.
Communicating with frame scripts
after the name, you can pass detailed data as a string or a json-serializable object, and after that you can pass any objects it wants to pass to content as cpows.
... the message passed to the listener is an object containing the following properties: name string containing the message name.
... after the message name, you can pass detailed data as a string or a json-serializable object: // chrome script messagemanager.sendasyncmessage("my-addon@me.org:message-from-chrome", { details : "some more details" }); to receive a message from chrome, a frame script uses the global addmessagelistener() function.
mozbrowsercaretstatechanged
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... canselectall: a boolean indicating whether the selectall command is available (true) or not (false.) cancut: a boolean indicating whether the cut command is available (true) or not (false.) cancopy: a boolean indicating whether the copy command is available (true) or not (false.) canpaste: a boolean indicating whether the paste command is available (true) or not (false.) reason a domstring that defines the reason for the state being changed.
...hether the current selection is collapsed (true) or not (false.) caretvisible a boolean indicating whether the caret is currently visible (true) or not (false.) selectionvisible a boolean indicating whether the current selection is visible (true) or not (false.) selectioneditable a boolean indicating whether the current selection is editable (true) or not (false.) selectedtextcontext a domstring containing the currently-selected text content.
mozbrowseropensearch
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: title a domstring representing the title of the search engine.
... href a domstring representing url of the search engine.
mozbrowserusernameandpasswordrequired
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following members: host a domstring representing the host requesting the http authentification.
... realm a domstring representing the value of the realm http header.
Embedding Tips
the simplepersist() function takes a string url and a string file path.
... at startup use the category manager to register properties of the global object in javascript like this: nscomptr<nsicategorymanager> catman = do_getservice(ns_categorymanager_contractid); if (!catman) return ns_error_failure; nsxpidlcstring previous; catman->addcategoryentry(javascript_global_property_category, "my_prop_name", "my_prop_contract_id", pr_true, pr_true, getter_copies(previous)); this will cause a component with the contract id my_prop_contract_id to be lazily created when the my_prop_name is resolved in any javascript window scope.
... how do i change the user agent string?
API-provided widgets
type a string indicating the type of widget.
... tooltiptext string to use for the tooltip of the widget label string to use for the label of the widget removable whether the widget is removable (optional, default: true).
...this is only used to display the shortcut as part of the tooltip for builtin widgets (which have strings inside customizablewidgets.properties).
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(nsifile file, int modeflags); void clo...
... nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
... nsifile getdir( string key, array patharray, bool shouldcreate, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
FxAccountsProfileClient.jsm
token string bearer token.
...fxaccountsprofileclient fxaccountsprofileclient( object options string serverurl, string token ); parameters serverurl - firefox profile server url.
...fxaccountsprofileclienterror attributes name string name of the error fxaccountsprofileclienterror code number status code of the request errno number error number error string error description message string error message ...
Sqlite.jsm
if no schema version has been set, this will return the string "0".
... these functions receive the following arguments: sql (required) string sql statement to execute.
...result is a numeric error code and message is a string description of the problem.
WebChannel.jsm
components.utils.import("resource://gre/modules/webchannel.jsm"); constructor webchannel(string webchannelid, nsiuri originorpermission); 2nd argument is a valid origin that should be part of requests for this channel.
... webchannel(string webchannelid, string originorpermission); 2nd argument is a permission for which the permission manager will be checked to determine if the request is allowed.
... 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.
Localization sign-off reviews
here is some of the criteria we use to perform sign-off reviews: increased amount of untranslated strings we look for previously translated strings changing to untranslated strings in the new revision.
... newly translated strings that shouldn't have been translated self-explanatory enough, right?
...to put it simply, when we receive your request, we expect that you have spent time testing your work and making sure all strings have been localized and that your changes are relatively functional.
PR_LogPrint
syntax #include <prlog.h> void pr_logprint(const char *fmt, ...); parameters the function has this parameter: fmt the string that is used as the formatting specification.
... returns nothing description this function unconditionally writes a message to the log using the specified format string.
... for a description of formatting and format strings, see "formatted printing".
Certificate functions
er cert_decodedercrlwithflags mxr 3.6 and later cert_decodegeneralname mxr 3.4 and later cert_decodenameconstraintsextension mxr 3.10 and later cert_decodeocspresponse mxr 3.6 and later cert_decodeoidsequence mxr 3.2 and later cert_decodeprivkeyusageperiodextension mxr 3.10 and later cert_decodetruststring mxr 3.4 and later cert_decodeusernotice mxr 3.2 and later cert_dernametoascii mxr 3.4 and later cert_destroycertarray mxr 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destro...
...ess mxr 3.7 and later cert_getlocalityname mxr 3.2 and later cert_getnextemailaddress mxr 3.7 and later cert_getnextgeneralname mxr 3.10 and later cert_getnextnameconstraint mxr 3.10 and later cert_getocspresponsestatus mxr 3.6 and later cert_getocspstatusforcertid mxr 3.6 and later cert_getoidstring mxr 3.9 and later cert_getorgname mxr 3.2 and later cert_getorgunitname mxr 3.2 and later cert_getocspauthorityinfoaccesslocation mxr 3.4 and later cert_getpkixverifynistrevocationpolicy mxr 3.12 and later cert_getprevgeneralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later ...
... and later cert_isusercert mxr 3.6 and later cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsl...
NSS 3.12.5 release_notes
these are mostly strings used to internationalize softoken.
... memory for the strings are owned by the caller, who is free to free them once nss_contextinit returns.
... if the string parameter is null (as opposed to empty, zero length), then the softoken default is used.
NSS_3.12_release_notes.html
ug 324744: add generation of policy extensions to certutil bug 390973: add long option names to secu_parsecommandline bug 161326: need api to convert dotted oid format to/from octet representation bug 376737: cert_importcerts routinely sets valid_peer or valid_ca override trust flags bug 390381: libpkix rejects cert chain when root ca cert has no basic constraints bug 391183: rename libpkix error string number type to pkix error number types bug 397122: nss 3.12 alpha treats a key3.db with no global salt as having no password bug 405966: unknown signature oid 1.3.14.3.2.29 causes sec_error_bad_signature, 3.11 ignores it bug 413010: cert_comparerdn may return a false match bug 417664: false positive crl revocation test on ppc/ppc64 nss_enable_pkix_verify=1 bug 404526: glibc detected free(): inval...
...al apis in the crl cache for libpkix bug 335039: nssckfwcryptooperation_updatecombo is not declared bug 340917: crlutil should init nss read-only for some options bug 350948: freebl macro change can give 1% improvement in rsa performance on amd64 bug 352439: reference leaks in modutil bug 369144: certutil needs option to generate subjectkeyid extension bug 391771: pk11_config_name and pk11_config_strings leaked on shutdown bug 401194: crash in lg_findobjects on win64 bug 405652: in the tls clienthello message the gmt_unix_time is incorrect bug 424917: performance regression with studio 12 compiler bug 391770: ocsp_global.monitor is leaked on shutdown bug 403687: move pkix functions to certvfypkix.c, turn off ev_test_hack bug 428105: cert_setocsptimeout is not defined in any public header file bu...
...g 213359: enhance pk12util to extract certs from p12 file bug 329067: nss encodes cert distinguished name attributes with wrong string type bug 339906: sec_pkcs12_install_bags passes uninitialized variables to functions bug 396484: certutil doesn't truncate existing temporary files when writing them bug 251594: certificate from pkcs#12 file with colon in friendlyname not selectable for signing/encryption bug 321584: nss pkcs12 decoder fails to import bags without nicknames bug 332633: remove duplicate header files in nss/cmd/sslsample bug 335019: pk12util takes friendly name from key, not cert bug 339173: mem leak whenever secmod_handle_string_arg called in loop bug 353904: klocwork null ptr deref in secasn1d.c bug 366390: correct misleading function names in fipstest bug 370536: memory leaks in...
Utilities for nss samples
actual * password or the file to read it from */ } secupwdata; /* * printasascii */ extern void printasascii(prfiledesc* out, const unsigned char *data, unsigned int len); /* * printashex */ extern void printashex(prfiledesc* out, const unsigned char *data, unsigned int len); /* * getdigit */ extern int getdigit(char c); /* * hextobuf */ extern int hextobuf(unsigned char *instring, secitem *outbuf, prbool ishexdata); /* * filetoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * checkpassword */ extern prbool checkpassword(char *cp); /* * getpassword */ extern char * getpassword(file *input, file *output, char *prompt, prbool (*ok)(char *)); /* * filepasswd extracts the password from a text file * ...
...column != level) { newline(out); } } /* * getdigit */ int getdigit(char c) { if (c == 0) { return -1; } if (c <= '9' && c >= '0') { return c - '0'; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } return -1; } /* * hextobuf */ int hextobuf(unsigned char *instring, secitem *outbuf, prbool ishexdata) { int len = strlen((const char *)instring); int outlen = len+1/2; int truelen = 0; int digit1, digit2; outbuf->data = ishexdata ?
... port_alloc(outlen) : port_alloc(len); if (!outbuf->data) { return -1; } if (ishexdata) { while (*instring) { if ((*instring == '\n') || (*instring == ':')) { instring++; continue; } digit1 = getdigit(*instring++); digit2 = getdigit(*instring++); if ((digit1 == -1) || (digit2 == -1)) { port_free(outbuf->data); outbuf->data = null; return -1; } outbuf->data[truelen++] = digit1 << 4 | digit2; } } else { while (*instring) { if (*instring == '\n') { instring++; continue; } outbuf->data[truelen++] = *instr...
sslcrt.html
description the comparison performed by cert_verifycertname is not a simple string comparison.
...matches one character \ escapes a special character $ matches the end of the string [abc] matches one occurrence of a, b, or c.
... [a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression removes any pattern matching the shell expression from the match list (foo|bar) matches either the substring foo or the substring bar.
Necko Architecture
given a string representation of a url, you can ask the nsiioservice for a url instance representing that string.
... once you have a url interface in hand (nsiurl), you have a completely parsed representation of the original url string, and you can query for the various parts of the url.
...there is a 1-to-1 relationship between uris and channels (if you go so far as to create a channel from a uri, which is not required if all you need is a parsed representation of a uri string).
Rhino JavaScript compiler
the class must have a method matching public static void main(script sc, string[] args).
...the string packagename must be composed of valid identifier characters optionally separated by periods.
...the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160, or 170.
GCIntegration - SpiderMonkey Redirect 1
at least initially, only jsstrings and jsobjects without finalizers will be allocated in the nursery, and so only they will be subject to moving.
...we will need to handle pointers to array slots and string characters specially, since those may actually be pointers into the middle of gc things (inline slots or inline chars).
... only strings and objects without finalizers will be stored in the nursery, at least initially.
JS::Compile
chars const char16_t * string containing the script to compile.
... bytes const char * string containing the script to compile.
...srcbuf, chars, bytes is the string containing the text of the script.
JS::Evaluate
chars const char16_t * string containing the script to compile and execute.
... bytes const char * string containing the script to compile and execute.
... srcbuf, chars and bytes are the string containing the text of the script.
JS::PropertySpecNameIsSymbol
this article covers features introduced in spidermonkey 38 determine if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string.
... syntax bool js::propertyspecnameissymbol(const char *name); name type description name const char * the pointer of the name, actually the uintptr_t type, and not a pointer to any string.
... description js::propertyspecnameissymbol determines if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string, and returns true if so.
JSVAL_LOCK
v is a js object, string, or double value.
... jsval_lock determines if v is an object, string, or double value, and if it is, it locks the value.
... if locking is successful, or v already cannot be garbage collected because it is not an object, string, or double value, jsval_lock evaluates to true.
JSVAL_UNLOCK
v is a js object, string, or double value.
... jsval_unlock determines if v is an object, string, or double value, and if it is, it unlocks the value.
... if unlocking is successful, or v not affected by garbage collection because it is not an object, string, or double value, jsval_unlock evaluates to true.
JSVersion
the functions js_getversion, js_setversion, js_stringtoversion, and js_versiontostring use these values.
...each version has a name, which is a string used by js_stringtoversion and js_versiontostring.
...on_ecma_5 185 ecma 262 edition 5 "ecmav5" jsversion_default 0 latest javascript version, but omitting web-incompatible extensions "default" jsversion_unknown -1 unknown javascript version null jsversion_latest jsversion_ecma_5 latest javascript version null see also mxr id search for jsversion js_getversion js_setversion js_stringtoversion js_versiontostring bug 824312 ...
JS_ConvertArguments
(the purpose is to ensure gc safety.) format const char * null-terminated string describing the types of the out parameters and how to convert the values in argv.
... format is a null-terminated c string.
... c type description b bool boolean c uint16_t ecma uint16_t, unicode character i int32_t ecma int32_t j int32_t ecma int32_t (used to be different, behaves like i now) obsolete since jsapi 28 u uint32_t ecma uint32_t d double ieee double i double integral ieee double s char * (c string) bug 607292 s jsstring * unicode string, accessed by a jsstring pointer w char16_t * unicode character vector, 0-terminated (w for wide) o jsobject * object reference f jsfunction * the argument is converted to a function as though by a call to js_valuetofunction.
JS_DecompileScript
syntax jsstring * js_decompilescript(jscontext *cx, js::handle<jsscript*> script); name type description cx jscontext * the context to use to decompile the script.
... if successful, js_decompilescript returns a string containing the source code of the script.
... otherwise, it returns a string containing "[no source]".
JS_DefineElement
s, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, ...
... value js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double or jsval initial value to assign to the property.
...value is one of js::value, jsobject, jsstring, int32_t, uint32_t, or double that defines the property's initial value.
JS_EnterLocalRootScope
by contrast, local root scopes protect newly-created objects, doubles, and strings.
...calling js_enterlocalrootscope and js_leavelocalrootscope around the body of the native hook protects each object, double, and string created using the same jscontext from gc.
... for example: jsbool my_getproperty(jscontext *cx, jsobject *obj, jsval id, jsval *vp) { jsbool ok; if (!js_enterlocalrootscope(cx)) return js_false; // this function doesn't need to bother rooting any new objects, // strings, or doubles it creates using cx.
JS_ExecuteRegExp
execute a new regexp object to given input string.
... chars const char16_t * a pointer to the string contains a input string.
... description js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the specified input string, chars, from *indexp index.
JS_ParseJSON
this article covers features introduced in spidermonkey 1.8.6 parse a string using the json syntax described in ecmascript 5 and return the corresponding value.
... chars const jschar * the characters of the string.
... len uint32 the length of the string.
JS_ReportError
format const char * format string to convert into an error message using js_vsmprintf.
... error message variables to insert into the format string.
...first it builds an error message from the given sprintf-style format string and any additional arguments passed after it.
JS_SetRegExpInput
syntax bool js_setregexpinput(jscontext *cx, js::handleobject obj, js::handlestring input, bool multiline); name type description cx jscontext * the context.
... input js::handlestring a pointer to the input string.
... description js_setregexpinput sets the pending input string of the built-in regexp object to the specified input string.
JS_THREADSAFE
js_threadsafe was a compile-time option that enables support for running multiple threads of javascript code concurrently as long as no objects or strings are shared between them.
...bunny's guide to activex even in js_threadsafe builds, threads cannot safely share objects or strings.
...then use js_readstructuredclone on the other side to turn the serialized data back into javascript objects, strings, and so on.
JS_ValueToNumber
if v is a string, conversion proceeds as specified in ecma 262-3 §9.3.1.
...if the string is not a numeric string, *dp is set to nan.
... otherwise, the resulting object's tostring method, if any, is called.
SpiderMonkey 24
these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.).
... deleted apis js_get_class (use js_getclass instead) js_enumerateresolvedstandardclasses js_getglobalobject js_setcstringsareutf8 ...list other deleted apis...
... js_getprototype, takes context as first argument js_encodestringtobuffer takes add context as first argument, js_newruntime adds a js_[use|no]_helper_threads flag delete property in jsclass definitions now use js_deletepropertystub garbage collection functions now take runtime argument most garbage collection functions now take a runtime argument instead of a context.
SpiderMonkey 45
each (bug 1159469) js::exceptionstackornull (bug 814497) js::copyasyncstack (bug 1160307) js::getsavedframesource (bug 1216819) js::getsavedframeline (bug 1216819) js::getsavedframecolumn (bug 1216819) js::getsavedframefunctiondisplayname (bug 1216819) js::getsavedframeasynccause (bug 1216819) js::getsavedframeasyncparent (bug 1216819) js::getsavedframeparent (bug 1216819) js::buildstackstring (bug 1133191) js::flushperformancemonitoring (bug 1181175) js::resetperformancemonitoring (bug 1181175) js::disposeperformancemonitoring (bug 1208747) js::setstopwatchismonitoringcpow (bug 1156264) js::getstopwatchismonitoringcpow (bug 1156264) js::setstopwatchismonitoringjank (bug 1156264) js::getstopwatchismonitoringjank (bug 1156264) js::isstopwatchactive (bug 674779) js::getperfmonit...
...oringtestcpurescheduling (bug 1181175) js::addcpowperformancedelta (bug 1181175) js::setstopwatchstartcallback (bug 1208747) js::setstopwatchcommitcallback (bug 1208747) js::setgetperformancegroupscallback (bug 1208747) js_stringhasbeeninterned renamed to js_stringhasbeenpinned (bug 1178581) js_internjsstring renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_internucstringn renamed to js_atomizeandpinucstringn (bug 1178581) js_internucstring renamed to js_atomizeandpinucstring (bug 1178581) deleted apis js_getcompartmentstats js_seticumemoryfunctions js_isgcmarkingtracer js_ismarkinggray js_idarraylength js_idarrayget js_destroyidarray js_defa...
...ultvalue js_getparent js_setparent js::parsepropertydescriptorobject js_deleteproperty2 js_deletepropertybyid2 js_deleteucproperty2 js_deleteelement2 js_newfunctionbyid js_bindcallable js_decompilefunctionbody js_getlatin1internedstringchars js_gettwobyteinternedstringchars js_newdateobjectmsec js_cleardatecaches changed apis js_init has moved from jsapi.h to js/initialization.h js_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 met...
Using the Places annotation service
from c++ you must use the setter for the explicit data type being saved: setpageannotationstring(auri, aname, avalue, aflags, aexpiration); setpageannotationint32(auri, aname, avalue, aflags, aexpiration); setpageannotationint64(auri, aname, avalue, aflags, aexpiration); setpageannotationdouble(auri, aname, avalue, aflags, aexpiration); setpageannotationbinary(auri, aname, adata, adatalen, aflags, aexpiration); and likewise for items in the places database: setitemannotationstring(a...
...getservice(components.interfaces.nsiioservice); var uri = ioservice.newuri("http://www.mozilla.org/", null, null); annotationservice.setpageannotation(uri, "my_extension/some_annotation", "this is the annotation value", 0, 0); retrieving annotations there are corresponding getters for the setters above (see nsiannotationservice.idl for the exact declarations): from c++: getpageannotationstring(auri, aname); getpageannotationint32(auri, aname); getpageannotationint64(auri, aname); getpageannotationdouble(auri, aname); getpageannotationbinary(auri, aname, adata, adatalen, amimetype); getitemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, ...
...ame, aflags, aexpiration, amimetype, atype) getitemannotationinfo(aitemid, aname, aflags, aexpiration, amimetype, atype) getpageannotationtype(auri, aname); getitemannotationtype(aitemid, aname); the returned type will be one of the value_type constants in mozistoragevaluearray.idl: after bug 377066 the value_type_* type handling was changed to this: type_int32 = 1 type_double = 2 type_string = 3 type_binary = 4 type_int64 = 5 try { var value = annotationservice.getpageannotation(uri, "my_extension/some_annotation"); } catch(e) { // annotation does not exist } other functions getpageswithannotation(aname, resultcount, results); getitemswithannotation(aname, resultcount, results); retrieves a list of all pages/items with the given annotation.
Using the Places history service
nsinavhistoryservice.queriestoquerystring: returns a serialized version of the queries as a "place:" uri.
... you should not count on this format, always use this function instead of hard-coding your own query strings.
... nsinavhistoryservice.querystringtoqueries: converts a serialized query ("place:" uri) back to the actual query objects and options.
Using the Places keywords API
it has the following properties: keyword: string representing the keyword url: either a url or spec represeting the url to associate to postdata: optional post data string.
... 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({ 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.
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.
... name readonly attribute astring the name of the application.
... version readonly attribute astring the version number of the application.
extIExtension
method overview fixme: attributes attribute type description id readonly attribute astring the id of the extension.
... name readonly attribute astring the name of the extension.
... version readonly attribute astring the version number of the extension.
Creating a Python XPCOM component
defining the interface make a file named "nsipysimple.idl" to define the interface: #include "nsisupports.idl" [scriptable, uuid(2b324e9d-a322-44a7-bd6e-0d8c83d94883)] interface nsipysimple : nsisupports { attribute string yourname; void write( ); void change(in string avalue); }; this is the same as the nsisimple interface used here.
...note: there are exceptions; see this discussion for information on the use of string and wstring for unicode transfer.
... # _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.
How to build an XPCOM component in JavaScript
implementation this example component will expose a single method, which returns the string "hello world!".
...here's the xpidl definition for our helloworld component: helloworld.idl #include "nsisupports.idl" [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsihelloworld : nsisupports { string hello(); }; note that you must generate a new uuid for each xpcom component that you create.
...when set to true, and only if 'value' is not // specified, the concatenation of the string "service," and the object's contractid // is passed as avalue parameter of addcategoryentry.
How to build a binary XPCOM component using Visual Studio
let’s specify a simple interface: #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); }; remember to generate your own guid.
...they could look like this: h file: #ifndef __specialthing_impl_h__ #define __specialthing_impl_h__ #include "comp.h" #include "nsstringapi.h" #define specialthing_contractid "@starkravingfinkle.org/specialthing;1" #define specialthing_classname "specialthing" #define specialthing_cid { 0x245626, 0x5cc1, 0x11db, { 0x96, 0x73, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } } class cspecialthing : public ispecialthing { public: ns_decl_isupports ns_decl_ispecialthing cspecialthing(); private: ~cspecialthing(); protected: /* additiona...
...l 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
syntax var func = [ new ] components.constructor(contractid [, interfacename [, initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of xpcom components.
...for example: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsisupports]" try { // someinputstream is an existing nsiinputstream // throws because bis hasn't been qi'd to nsibinaryinputstream bis.setinputstream(someinputstream); } catch (e) { bis.queryinterface(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // succeeds now } if two arguments are given, the created instance will be ...
...nsisupports.queryinterface()'d to the xpcom interface whose name is the second argument: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1", "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.
XPCshell Test Manifest Expressions
operators in order of decreasing precedence: () == != && || literal values booleans: the literal strings true and false.
... strings: any series of characters enclosed in double quotes " or single quotes '.
... comments if an expression contains a # (pound/hash) character outside of a string, the character and the rest of the line will be treated as a comment.
NS_NewLocalFile
#include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newlocalfile( const nsastring& apath, prbool afollowlinks, nsilocalfile** aresult ); parameters apath [in] a utf-16 string object that specifies an absolute filesystem path.
... example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
...nsembedstring is used to convert the ucs-2 character array to an object that can be passed as a const nsastring& parameter.
NS_NewNativeLocalFile
#include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newnativelocalfile( const nsacstring& apath, prbool afollowlinks, nsilocalfile** aresult ); parameters apath [in] a string object that specifies an absolute filesystem path.
... this string should be encoded using ascii or the multibyte character coding corresponding to the native filesystem.
... example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newnativelocalfile(nsembedcstring("c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; here, nsembedcstring is used to convert the ascii string literal to an object that can be passed as a const nsacstring& parameter.
operator=
self_type& operator=( const self_type& astring ); parameters astring [in] a nsacstring to append to this string.
... self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator=( char_type achar ); parameters achar [in] a character to append to this string.
operator+=
self_type& operator+=( const self_type& astring ); parameters astring [in] a nsacstring to append to this string.
... self_type& operator+=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator+=( char_type achar ); parameters achar [in] a character to append to this string.
operator=
self_type& operator+=( const self_type& astring ); parameters astring [in] a nsastring to append to this string.
... self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string.
... self_type& operator=( char_type achar ); parameters achar [in] a character to append to this string.
IAccessibleAction
if it lies outside the valid range an empty string is returned.
... description the returned value is a localized string of the specified action.
...the returned strings are the localized human readable key sequences to be used to activate each action, e.g.
IAccessibleHyperlink
1.0 66 introduced gecko 1.9 inherits from: iaccessibleaction last changed in gecko 1.9 (firefox 3) this interface represents a hyperlink associated with a single substring of text or single non-text object.
...this interface could also be applied to other kinds of objects with multiple actions such as "smart tags" which are objects, typically strings, which have multiple actions such as "activate uri", "bookmark uri", end so on.
...for example, for a text link this method could return the substring of the containing string where the substring is overridden with link behavior, and for an image link this method could return an iunknown variant for iaccessibleimage.
IAccessibleTable
this object attribute is obtained by parsing the attribute string returned by iaccessible2.attributes().
...typically this is the value returned from iaccessible2.indexinparent(), but in the case where the table cells are not direct children of the table this is the cell index specified by the "table-cell-index" object attribute obtained from parsing the attributes string returned by calling iaccessible2.attributes() on the cell object.
...typically this is the value returned from iaccessible2.indexinparent(), but in the case where the table cells are not direct children of the table this is the cell index specified by the "table-cell-index" object attribute obtained from parsing the attributes string returned by calling iaccessible2.attributes() on the cell object.
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 ...
...boolean installaddonsfromwebpage( in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, in amiinstallcallback acallback, optional in pruint32 ainstallcount optional ); parameters amimetype the mimetype for the add-ons.
...boolean isinstallenabled( in astring amimetype, in nsiuri areferer ); parameters amimetype the mime type for the add-on to be installed.
jsdIStackFrame
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.
... functionname autf8string function name executing in this stack frame.
...boolean eval( in astring bytes, in autf8string filename, in unsigned long line, out jsdivalue result ); parameters bytes script to be evaluated.
GetKeyBindings
« nsiaccessible page summary this method provides array of localized string of global keyboard accelerator for the given action index supported by accessible.
... nsidomdomstringlist getkeybindings( in pruint8 aactionindex ); parameters aactionindex[in] index of the given action.
... return values returns array of localized string of global keyboard accelerator.
nsIAccessible
layout oriented methods nsiaccessible.getchildatpoint() to get child accessible from point nsiaccessible.getaccessibletoleft(), nsiaccessible.getaccessibletoright(), nsiaccessible.getaccessibleabove() or nsiaccessible.getaccessiblebelow() to get left, right, top or below placed accessible methods getkeybindings provides array of localized string of global keyboard accelerator for the given action index supported by accessible.
... keyboardshortcut provides localized string of accesskey name, such as alt+d.
... defaultkeybinding provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file.
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 void settextcontents(in astring text); attributes attribute type description associatededitor nsieditor returns an editor associated with the accessible.
... void inserttext( in astring text, in long position ); parameters text text to be inserted.
... void settextcontents( in astring text ); parameters text the text that will replace the old text.
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, [op...
... void showalertnotification( in astring imageurl, in astring title, in astring text, 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, optional ); parameters imageurl a url identifying the image to display in the notification alert.
... void closealert( in astring name, optional in nsiprincipal principal optional ); parameters name the name of the notification to close.
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 nsiupdatechecker the update checker being used for background update checking.
... astring downloadupdate( in nsiupdate update, in boolean background ); parameters update an nsiupdate object indicating the update to download.
... return value a string indicating the status of the update upon return: "downloading" the update is being downloaded.
nsIAutoCompleteItem
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description classname string class name used to define some style through css like the colors, an icon url, and so on.
... comment wstring an extra comment that will be displayed next to the value but that will not be part of the value itself.
... value astring the result value using astring to avoid excess allocations.
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 propertyname return value removeproperty() void removeproperty( in wstring propertyname ); pa...
...rameters propertyname setproperty() void setproperty( in wstring propertyname, in wstring propertyvalue ); parameters propertyname propertyvalue setpropertyassupports() void setpropertyassupports( in wstring propertyname, in nsisupports value ); parameters propertyname value ...
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...
...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 ); parameters data length uri type dosilentdownload crlkey reschedulecrlautoupdate() this would reschedule the autoupdate of crls with auto update enable.
...boolean updatecrlfromurl( in wstring url, in wstring key ); parameters url key return value ...
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.
... deviceid string get the id for the device that stores this cache entry.
... key acstring get the key identifying the cache entry.
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 gecko 1.8 void visitentries(in nsicachevisitor vi...
... nsicachesession createsession( in string clientid, in nscachestoragepolicy storagepolicy, in boolean streambased ); parameters clientid specifies the name of the client using the cache.
... acstring createtemporaryclientid( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy.
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.
... boolean visitdevice( in string deviceid, in nsicachedeviceinfo deviceinfo ); parameters deviceid specifies the device being visited.
...boolean visitentry( in string deviceid, in nsicacheentryinfo entryinfo ); parameters deviceid specifies the device being visited.
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.
... void loadframescript( in astring aurl, in boolean aallowdelayedload ); parameters aurl the url of the script to load into the frame; this must be an absolute url, but data: urls are supported.
...void removedelayedframescript( in astring aurl ); parameters aurl the url of the script to remove from the list of scripts supporting delayed load.
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.
... void docommandwithparams( in string command, in nsicommandparams acommandparams ); parameters command the command to execute.
... getcommandstatewithparams() void getcommandstatewithparams( in string command, in nsicommandparams acommandparams ); parameters command the command whose state is to be determined.
nsIComponentManager
d 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 removebootstrappedmanifestlocation(in nsi...
... void createinstancebycontractid( in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the object instance that is being requested.
... void getclassobjectbycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the factory that is being requested.
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.
... void oncontentprefremoved( in astring agroup, in astring aname ); parameters agroup the group to which the removed preference belonged; this may be the uri of a web site.
... void oncontentprefset( in astring agroup, in astring aname, in nsivariant avalue ); parameters agroup the group to which the preference belongs; this may be the uri of a web site.
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.
...acstring getmimetypefromcontent( in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength ); parameters arequest the request where this data came from.
... let charset = "iso-8859-1"; try { // this pref has been removed, see bug 910192 charset = services.prefs.getcomplexvalue("intl.charset.default", ci.nsipreflocalizedstring).data; } catch (e) { } let conv = cc["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(ci.nsiscriptableunicodeconverter); conv.charset = charset; try { let str = conv.convertfrombytearray(adata, alength); if (str.substring(0, 5) == "%pdf-") return "application/pdf"; // we detected a pdf file ...
nsIConverterInputStream
this allows reading unicode strings from a stream, automatically converting the bytes from a selected character encoding.
...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.
...void init( in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar ); parameters astream the source stream which is read and converted.
nsIConverterOutputStream
xpcom/io/nsiconverteroutputstream.idlscriptable this interface allows writing strings to a stream, doing automatic character encoding conversion.
...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.
...void init( in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter ); parameters aoutstream the underlying output stream to which the converted strings will be written.
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.
... void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set.
... see nsicookiemanager2.add() for a description of acceptable host strings.
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.
... void getcookie( in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize ); parameters acookieurl url string to look up cookie with..
... void setcookie( in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize ); parameters acookieurl url string to look up cookie with..
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!
...void annotatecrashreport( in acstring key, in acstring data ); parameters key name of the data to be added.
...void appendappnotestocrashreport( in acstring data ); parameters data data to be added.
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.
...acstring finish( in prbool aascii ); parameters aascii if true then the returned value is a base-64 encoded string.
...to create the key object use for instance: var keyobject = components.classes["@mozilla.org/security/keyobjectfactory;1"] .getservice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed.
nsIDBChangeListener
away(in nsidbchangeannouncer 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.
... void onevent(in nsimsgdatabase adb, in string aevent); parameters adb the nsimsgdatabase that is changing.
... astring the type of event.
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.
... title domstring obsolete since gecko 1.9.1 windowstate unsigned short returns current window state, the value is one of state_* constants.
...void setcursor( in domstring cursor ); parameters cursor you can specify same values of css cursor property (including -moz- prefixed values).
nsIDOMHTMLSourceElement
attributes attribute type description src domstring the src attribute gives the address of the media resource.
... type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it.
... media unimplemented domstring the media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it.
nsIDOMStorageManager
o 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.
...nsidomstorage getlocalstorageforprincipal( nsiprincipal aprincipal, domstring adocumenturi ); parameters aprincipal the principal for which to return the local storage object.
...long getusage( astring aownerdomain ); parameters aownerdomain the domain to check.
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 sizetocontent(); attributes attribute type description applicationcache nsidomoffli...
... name domstring get or set the name of this window.
... nsidomcssstyledeclaration getcomputedstyle( in nsidomelement elt, in domstring pseudoelt optional ); parameters elt pseudoelt optional return value getselection() returns the nsiselection object indicating what if any content is currently selected in the window.
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 an nsidomxpathexpression which can then be used for (repeated) evaluat...
... nsidomxpathexpression createexpression( in domstring expression, in nsidomxpathnsresolver resolver ); parameters expression a string representing the xpath to be created.
...nsisupports evaluate( in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result ); parameters expression a string representing the xpath to be evaluated.
nsIDOMXULSelectControlItemElement
inherits from: nsidomxulelement last changed in gecko 1.7 attributes attribute type description accesskey domstring command domstring control nsidomxulselectcontrolelement read only.
... crop domstring disabled boolean image domstring label domstring selected boolean read only.
... value domstring ...
nsIDataSignatureVerifier
security/manager/ssl/public/nsidatasignatureverifier.idlscriptable an interface for verifying that a given string of data was signed by the private key matching the given public key.
... 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.
... boolean verifydata( in acstring adata, in acstring asignature, in acstring apublickey ); parameters adata the data to be tested.
nsIDirIndex
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description contenttype string the content type; may be null if it is unknown.
... description wstring a description for the filename, which should be displayed by a viewer.
... location string the fully qualified filename, expressed as a uri.
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.
... nsifile getfile( in string prop, out prbool persistent ); parameters prop the symbolic name of the file.
...example this code creates a global, read-only string called currdir with the value of the current working directory.
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 cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 void flush(); obsolete since gecko 1.8 ...
... 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 ); parameters adownloadtype the download type for the transfer.
...may be an empty string.
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.
... astring droplink( in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit ); parameters aevent a drop event.
... aname the link title if it exists, or an empty string otherwise.
nsIDroppedLinkItem
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description url domstring url of the dropped link.
... name domstring name of the dropped link.
... type domstring mime-type of the dropped link.
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 from the specified encoding type before being saved or delivered to h...
...boolean applydecodingforextension( in autf8string aextension, in acstring aencodingtype ); parameters aextension the filename extension to check.
...nsistreamlistener docontent( in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave ); parameters amimecontenttype the content type of the incoming data.
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.
... void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client.
... msg a string holding response of the last command which had been sent.
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.
...void oncomplete( in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype ); parameters auri receives the "favicon uri" (not the "favicon link uri") associated to the requested page.
... amimetype mime type of the icon, or an empty string if adatalen is 0.
nsIFeedContainer
id astring a string that identifies the feed or entry.
... updated astring a string containing the date the feed or entry was last updated, in rfc822 form.
... this string is parsable by javascript and mail code.
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.
... parsefromstring() parses a feed from an astring.
... void parsefromstring( in astring str, in nsiuri uri ); parameters str the string to parse as a feed.
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.
... version astring the version of the feed; null if a non-feed is processed.
... void registerextensionprefix( in astring anamespace, in astring aprefix ); parameters anamespace the namespace for the extension.
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.
... parameters name type description aurl string url for the script to load.
... parameters name type description aurl string url for the script to remove.
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.
... void addpage( in string aurl ); parameters aurl the url to the page.
...boolean isvisited( in string aurl ); parameters aurl the url to the page.
nsIHTTPHeaderListener
method overview void newresponseheader(in string headername, in string headervalue); void statusline(in string line); methods newresponseheader() called for each http response header.
...void newresponseheader( in string headername, in string headervalue ); parameters headername headervalue statusline() called once for the http response status line.
...void statusline( in string line ); parameters line ...
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.
...the title of of the list is passed through the optional string parameter of addbuildlist.
...boolean addlisttobuild( in short acattype, in nsiarray items, optional in astring catname optional ); parameters acattype the type of list to add.
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.
...void addheader( in string name, in string value ); parameters name name of the header.
... example var postdata = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); ...
nsIMarkupDocumentViewer
defaultcharacterset acstring forcecharacterset acstring fullzoom float the amount by which to scale all lengths.
... hintcharacterset acstring hintcharactersetsource print32 minfontsize long the minimum font size to allow.
... prevdoccharacterset acstring textzoom float the amount by which to scale all text.
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.
... name autf8string an arbitrary descriptive name for this microsummary generator.
...astring generatemicrosummary( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized.
nsIMsgAccountManagerExtension
inherits from: nsisupports method overview boolean showpanel(in nsimsgincomingserver server); attributes attribute type description name acstring name of the account manager extension.
... it has to be unique and defines the file name of the property file and the xul page as well as the name of the localized string contained in the property file.
... chromepackagename acstring chrome package, where the files for the new panel are located.
nsIMsgFilter
throws an exception if the action is not move to folder attribute acstring targetfolderuri; label // target label.
... throws an exception 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 ns...
...msgsearchopvalue op, in nsimsgsearchvalue value, out boolean booleanand, out acstring arbitraryheader ) appendterm() void nsimsgfilter::appendterm (in nsimsgsearchterm term) createterm() nsimsgsearchterm nsimsgfilter::createterm ( ) matchhdr() void nsimsgfilter::matchhdr ( in nsimsgdbhdr msghdr, in nsimsgfolder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, out boolean result ) logrulehit() void nsimsgfilter::logrulehit ( in nsimsgruleaction afilteraction, in nsimsgdbhdr aheader ) createaction() nsimsgruleaction nsimsgfilter::createaction ( ) getactionat() nsimsgruleaction nsimsgfilter::getactionat (in long aindex) appendaction...
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.
... mailcharacterset acstring this is used to track the character set of the currently displayed message.
...void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); parameters title not used.
nsIMsgWindowCommands
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.
...void selectfolder( in acstring folderuri ); parameters folderuri the uri of the folder to select.
...void selectmessage( in acstring messageuri ); parameters messageuri the uri of the message to open.
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.
... for example: let ppmm = services.ppmm.getchildat(1); ppmm.loadprocessscript('data:,dump("foo\n");', true); parameters name type description aurl string url for the script to load.
... parameters name type description aurl string url for the script to remove.
nsIProgressEventSink
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.
...void onstatus( in nsirequest arequest, in nsisupports acontext, in nsresult astatus, in wstring astatusarg ); parameters arequest the request being observed (may qi to nsichannel).
... astatusarg status code argument to be used with the string bundle service to convert the status message into localized, human readable text.
nsIPropertyElement
xpcom/ds/nsipersistentproperties2.idlscriptable this interface provides access to individual entries within a stringbundle.
... inherits from: nsisupports last changed in gecko 1.0 attributes attribute type description key autf8string the key used to refer to this property.
... value astring the string value stored for this property.
nsIProtocolProxyService
ses["@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, in nsresult areason); void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); void unregisterfilter(in nsiprotocolproxyfilter afilt...
... nsiproxyinfo newproxyinfo( in acstring atype, in autf8string ahost, in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy ); parameters atype the proxy type is a string value that identifies the proxy type.
...other string values may be possible, and new types may be defined by a future version of this interface.
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 service given the classid of the service.
... void getservicebycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the service that is being requested.
... boolean isserviceinstantiatedbycontractid( in string acontractid, in nsiidref aiid ); parameters acontractid the contractid of the service that is being tested.
nsISocketTransportService
nsisockettransport createtransport(in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxyinfo); void init(); obsolete since gecko 1.8 void notifywhencanattachsocket(in nsirunnable aevent); native code only!
... nsisockettransport createtransport( in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxyinfo ); parameters asockettypes array of socket type strings.
...you do not need to specify the strings "socks" or "socks4", use the aproxyinfo instead.
nsIStreamConverter
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() method from one type to another, pushing the converted...
...void asyncconvertdata( in string afromtype, in string atotype, in nsistreamlistener alistener, in nsisupports actxt ); parameters afromtype the mime type of the original/raw data.
...nsiinputstream convert( in nsiinputstream afromstream, in string afromtype, in string atotype, in nsisupports actxt ); parameters afromstream the stream representing the original/raw data.
nsISupportsPrimitive
type_cstring 2 corresponding to nsisupportscstring.
... type_string 3 corresponding to nsisupportsstring.
...see also nsisupportscstring nsisupportschar nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid ...
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.
... return value a string valued representation of the object.
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 objects, [optional] in nsip...
...parameters name type description messagename string the name of the message.
...parameters name type description messagename string the name of the message.
nsITextInputProcessorNotification
attributes attribute type description type acstring the type of request or notification to ime.
...however, gecko will commit the composition with the last composing string internally.
...however, gecko will cancel the composition with empty string internally.
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 number of user profiles currently in existence.
...nsitoolkitprofile createprofile( in nsilocalfile arootdir, in autf8string aname ); parameters arootdir the profile directory.
...nsitoolkitprofile getprofilebyname( in autf8string aname ); parameters aname the profile name to find.
nsITreeBoxObject
oid invalidaterow(in long index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long startindex, in long endindex); void invalidatecolumnrange(in long startindex, in long endindex, in nsitreecolumn col); long getrowat(in long x, in long y); void getcellat(in long x, in long y, out long row, out nsitreecolumn col, out acstring childelt); void getcoordsforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); boolean iscellcropped(in long row, in nsitreecolumn col); void rowcountchanged(in long index, in long count); void beginupdatebatch(); void endupdatebatch(); void clearstyleandimagecaches(); ...
... void getcellat(in long x, in long y, out long row, out nsitreecolumn col, out acstring childelt); parameters x the x coordinate y the y coordinate returns row the row index at the coordinates col the nsitreecolumn hit.
... void getcoordsforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); parameters row the index of the row col the nsitreecolumn element the pseudoelement.
nsITreeColumn
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void getidconst([shared] out wstring idconst); native code only!
... id astring the id attribute of the nsitreecolumn.
... methods native code only!getidconst void getidconst( [shared] out wstring idconst ); parameters idconst getnext() get the next column in the nsitreecolumns.
nsIURIFixupInfo
keywordprovidername astring the keyword search provider name expected to provide a keyword search; empty string if no keyword search is performed.
... keywordassent astring the keyword used for the search (post trimming etc.); empty string if no keyword search is performed.
... originalinput autf8string the original input.
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.
...void setstatus( in unsigned long statustype, in wstring status ); parameters statustype indicates what is setting the text.
... status status string.
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.
...void setstatuswithcontext( in unsigned long statustype, in astring statustext, in nsisupports statuscontext ); parameters statustype indicates what is setting the text.
... statustext status string.
nsIWebBrowserFind
searchstring wstring the string to search for.
... methods findnext() finds, highlights, and scrolls into view the next occurrence of the search string, using the current search settings.
... fails if the search string is empty.
nsIWebProgressListener
talprogress, in long amaxtotalprogress); void onsecuritychange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astate); void onstatechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage); constants state transition flags these flags indicate the various states that requests may transition through as they are being loaded.
... void onstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage ); parameters awebprogress the nsiwebprogress instance that fired the notification.
... cu.reporterror("saw: " + data.name + " -- passing: " + json.stringify(data)); }); /** * below is the contents of example-framescript.js */ const {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/xpcomutils.jsm"); var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, areq...
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.
... void installapplication( in wstring title, in wstring uri, in wstring iconuri, in wstring icondata ); parameters title the user-friendly name of the application.
...boolean isapplicationinstalled( in wstring uri ); parameters uri the uri of the web application.
nsIWinTaskbar
ts.interfaces.nsiwintaskbar); method overview nsijumplistbuilder createjumplistbuilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller controller); nsitaskbarprogress gettaskbarprogress(in nsidocshell shell); nsitaskbarwindowpreview gettaskbarwindowpreview(in nsidocshell shell); void setgroupidforwindow(in nsidomwindow aparent, in astring aidentifier); attributes attribute type description available boolean returns true if the operating system supports windows 7 or later taskbar features; you can use this instead of in-place operating system version checking.
... defaultgroupid astring the default application user model id the application registers with the system.
...void setgroupidforwindow( in nsidomwindow aparent, in astring aidentifier ); parameters aparent the parent nsidomwindow.
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.
...string getregistryentry( in long ahkeyconstant, in string asubkeyname, in string avaluename ); parameters ahkeyconstant the starting key, using the constants defined above.
...the empty string returns the default value of the sub key.
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.
... origin domstring the event's origin.
... void initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters atypearg the event type.
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.
... void deleteproperty( in astring name ); parameters name property to delete.
...void setproperty( in astring name, in nsivariant value ); parameters name property to set the value of.
nsIXULRuntime
os autf8string a string tag identifying the current operating system.
... widgettoolkit autf8string a string tag identifying the target widget toolkit in use.
... xpcomabi autf8string a string tag identifying the binary abi of the current processor and compiler vtable.
nsIXULSortService
obsolete since gecko 1.9 void sort(in nsidomnode anode, in astring asortkey, in astring asorthints); constants constant value description sort_comparecase 0x0001 sort_integer 0x0100 methods native code only!insertcontainernode obsolete since gecko 1.9 (firefox 3)this feature is obsolete.
...void sort( in nsidomnode anode, in astring asortkey, in astring asorthints ); parameters anode a node in the xul widget whose children are to be sorted.
...asorthints one or more hints as to how to sort: ascending: sort the contents in ascending order descending: sort the contents in descending order comparecase: perform case sensitive comparisons integer: treat values as integers, non-integers are compared as strings twostate: do not allow the natural (unordered state) see also nsixultemplatequeryprocessor ...
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.
... faultstring string read only.
... methods init() void getdata( in print32 faultcode, in string faultstring ); parameters faultcode tostring() string tostring(); ...
XPCOM reference
if you're working on a module in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using.
... see the xpcom internal string guide for documentation of the internal string api used within the mozilla codebase.
...all xpcom primitives are scriptable, and they all implement an xpcom interface from the table below.xpcom string functionsxpcom provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
XPIDL Syntax
MozillaTechXPIDLSyntax
literal = octal_literal / decimal_literal / hex_literal / floating_literal literal /= string_literal / char_literal literal /= "true" / "false" ; in regex: /"[^"\n]*["\n]/.
... string_literal = 1*(%x22 *(any char except %x22 or %x0a) (%x22 / %x0a)) ; same as above, but s/"/'/g char_literal = 1*(%x27 *(any char except %x27 or %x0a) (%x27 / %x0a)) type_spec = "float" / "double" / "string" / "wstring" type_spec /= ["unsigned"] ("short" / "long" / "long" "long") type_spec /= "char" / "wchar" / "boolean" / "octet" type_spec /= scoped_name prop_list = "[" *(property ",") property "]" property = ident [parens] raise_list = "raises" "(" *(scoped_name) ",") scoped_name ")" scoped_name = *(ident "::") ident / "::" ident ; in regex: [a-za-z_][a-za-z0-9_]*; identifiers beginning with _ cause warnings ident = (%x41-5a / %x61-7a / "_") *(%x41-5a / %x61-7a / %x30-39 / "_") parens = "(" 1*(any char except ")") ")" functionality not used in...
...the following is a list of potential features which are parseable but may not result in expected code: struct, union, and enumerated types array declarators (appears to be supported in xpidl_header.c but not xpidl_typelib.c) exception declarations module declarations variable arguments (that makes the abnf get more wonky) sequence types max-length strings fixed-point numbers "any" and "long double" types.
Address Book examples
formulate a boolean search string (see nsiabcard for built-in property names): var searchquery = "(or(primaryemail,bw,@v)(nickname,bw,@v)(and(ismaillist,=,true)(notes,bw,@v)))"; searchquery = searchquery.replace(/@v/g, encodeuricomponent("mystr") the search queries use lisp syntax with operators enumerated in nsabquerystringtoexpression.cpp.
... */ photo handlers are registered within the context of the contact editor dialog using the registerphotohandler function, as follows: registerphotohandler(atype, aphotohandler) ...where atype is a string with a unique identifier for that particular photo type.
... in order for a photo handler to be used for a contact, the phototype property of the contact must return a string equal to atype.
Building a Thunderbird extension 6: Adding JavaScript
window.addeventlistener("load", function(e) { startup(); }, false); window.setinterval( function() { startup(); }, 60000); //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + datestring; } the first part registers a new event listener that will be executed automatically when thunderbird loads.
...it then uses javascript's date class to get the current date, which it converts into a string that has the format of yyyy.mm.dd.
...finally the label of our panel is set to "date: " and concatenated with the date string that contains the formatted date.
customDBHeaders Preference
this is the superfluous.js file referenced from within the superfluous_overlay.xul file: dump(" ~ ~ ~ ~ superfluous ~ ~ ~ ~ \n"); var columnhandler = { getcelltext: function(row, col) { //get the messages header so that we can extract the 'x-superfluous' field var key = gdbview.getkeyat(row); var hdr = gdbview.db.getmsghdrforkey(key); var retval = hdr.getstringproperty("x-superfluous"); dump("x-superfluous: " + retval + "\n"); return retval; }, getsortstringforrow: function(hdr) { return hdr.getstringproperty("x-superfluous"); }, isstring: function() {return true;}, getcellproperties: function(row, col, props){}, getimagesrc: function(row, col) {return null;}, getsortlongforrow: function(hdr) {ret...
...erver(createdbobserver, "msgcreatedbview", false); window.document.getelementbyid('foldertree').addeventlistener("select",addcustomcolumnhandler,false); } window.addeventlistener("load",doonceloaded,false); dump(" ~ ~ ~ ~ end superfluous ~ ~ ~ ~ \n"); important be aware that only messages that are added to the .msf database after the customdbheaders pref is set will have the corresponding string property set on the msghdr.
... if the .msf file is rebuilt, all the msghdrs should have the string property set correctly.
Working with windows in chrome code
alternatively, the opener window can pass a callback function to the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ...
... application.storage.set(keyname, data); var data = application.storage.get(keyname, default); where: keyname is a string used to identify the data data is the data default is the data value to return if keyname does not exists pros: its the "right way".
... storing shared data in preferences if you just need to store a string or a number, writing a whole xpcom component may be an unnecessary complication.
Standard OS Libraries
gdkwindow.ptr, // window gint.ptr, // x gint.ptr, // y gdkmodifiertype.ptr // mask ); var winroot_gdkwindowptr = gdk_get_default_root_window(); console.info('winroot_gdkwindowptr:', winroot_gdkwindowptr, winroot_gdkwindowptr.tostring()); // gdk2 var x = gint(); var y = gint(); var mask = gdkmodifiertype(); var win_undermouse = gdk_window_get_pointer( winroot_gdkwindowptr, x.address(), y.address(), mask.address() ); console.info('win_undermouse:', win_undermouse, win_undermouse.tostring()); console.info('x:', x, x.tostring()); console.info('y:', y, y.tostring()); console.info('mask:', mask, mask.tostring()); ...
...r = gdk_display_get_device_manager(displayptr); var deviceptr = gdk_device_manager_get_client_pointer(device_managerptr); var x = gint(); var y = gint(); var mask = gdkmodifiertype(); var win_undermouse = gdk_window_get_device_position( winroot_gdkwindowptr, deviceptr, x.address(), y.address(), mask.address() ); console.info('win_undermouse:', win_undermouse, win_undermouse.tostring()); console.info('x:', x, x.tostring()); console.info('y:', y, y.tostring()); console.info('mask:', mask, mask.tostring()); gdk.close(); gdk3.close(); gtk+ the gtk+ toolkit can also be used.
...the release, string, etc.
FunctionType
property type description name string the type's name.
...for structure and opaque pointer types, this is simply the string that was passed to the constructor.
... method overview methods inherited from ctype ctype array([n]) string tosource() string tostring() functiontype cdata functiontype cdata cannot be constructed.
Debugger.Frame - Firefox Developer Tools
accessor properties of the debugger.frame prototype object a debugger.frame instance inherits the following accessor properties from its prototype: type a string describing what sort of frame this is: "call": a frame running a function call.
... implementation a string describing which tier of the javascript engine this frame is executing in: "interpreter": a frame running in the interpreter.
... eval(code, [options]) evaluatecode in the execution context of this frame, and return a completion value describing how it completed.code is a string.
Debugger - Firefox Developer Tools
arguments an array of strings, representing the arguments substituted into the error message.
... the query object may have the following properties: class if present, only return objects whose internal [[class]]’s name matches the given string.
... iscompilableunit(source) given a string of source code, designated bysource, return false if the string might become a valid javascript statement with the addition of more lines.
Console messages - Firefox Developer Tools
filtering by text to see only messages that contain a specific string, type in the text box labeled "filter output".
... for example, if you entered the string img into the text box, you would have a list something like this: a small "x" icon appears at the right end of the text box when you have entered a string on which to filter the output.
...for example, -img shows only items that do not contain the string img.
AddressErrors.addressLine - Web APIs
an object based on addresserrors includes an addressline property when validation of the address finds one or more errors in the array of strings in the address's addressline.
... the returned string explains the error and should offer suggestions for how to correct it.
... syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AddressErrors.languageCode - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... this validation might be as simple as ensuring the text of the string is compliant with the syntax defined in bcp-47, or as detailed as actually verifying that the specified string matches a value from a database.
AddressErrors.organization - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var organizationerror = addresserrors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
... for example, if validation simply ensures that only permitted characters are included in the organization's name, this might return a string such as "the organization name may only contain the letters a-z, digits, spaces, and commas." if the organization value was validated successfully, this property is not included in the addresserrors object.
AnimationEvent - Web APIs
animationevent.animationname read only is a domstring containing the value of the animation-name that generated the animation.
... animationevent.pseudoelement read only is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
... if the animation doesn't run on a pseudo-element but on the element, an empty string: ''.
AudioTrack.label - Web APIs
WebAPIAudioTracklabel
the read-only audiotrack property label returns a string specifying the audio track's human-readable label, if one is available; otherwise, it returns an empty string.
... syntax var audiotracklabel = audiotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata.
... otherwise, an empty string ("") is returned.
Background Tasks API - Web APIs
function logtaskhandler(data) { log("<strong>running task #" + currenttasknumber + "</strong>"); for (i=0; i<data.count; i+=1) { log((i+1).tostring() + ".
... min = math.ceil(min); max = math.floor(max); return math.floor(math.random() * (max - min + 1)) + min; } function decodetechnostuff() { totaltaskcount = 0; currenttasknumber = 0; updatedisplay(); let n = getrandomintinclusive(100, 200); for (i=0; i<n; i++) { let taskdata = { count: getrandomintinclusive(75, 150), text: "this text is from task number " + (i+1).tostring() + " of " + n }; enqueuetask(logtaskhandler, taskdata); } } document.getelementbyid("startbutton").addeventlistener("click", decodetechnostuff, false); decodetechnostuff() starts by zeroing the values of totaltaskcount (the number of tasks added to the queue so far) and currenttasknumber (the task currently being run), and then calls updatedisplay() to reset the display to its "noth...
...for each task, we create an object, taskdata, which includes two properties: count is the number of strings to output into the log from the task.
BasicCardRequest - Web APIs
properties basiccardrequest.supportednetworks optional secure context an optional array of domstrings representing the card networks that the retailer supports (e.g.
... basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g.
... card network identifiers the w3c maintains an official list of approved card network identifier strings, which may be used in the supportednetworks list.
BluetoothDevice - Web APIs
"1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">bluetoothdevice</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} interface interface bluetoothdevice { readonly attribute domstring id; readonly attribute domstring?
...ute frozenarray uuids; promise watchadvertisements(); void unwatchadvertisements(); readonly attribute boolean watchingadvertisements; }; bluetoothdevice implements eventtarget; bluetoothdevice implements bluetoothdeviceeventhandlers; bluetoothdevice implements characteristiceventhandlers; bluetoothdevice implements serviceeventhandlers; properties bluetoothdevice.id read only a domstring that uniquely identifies a device.
... bluetoothdevice.name read only a domstring that provices a human-readable name for the device.
Body.text() - Web APIs
WebAPIBodytext
it returns a promise that resolves with a usvstring object (text).
... return value a promise that resolves with a usvstring.
...when the fetch is successful, we read a usvstring (text) object out of the response using text(), then set the innerhtml of the <article> element equal to the text 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.
... syntax escapedstr = css.escape(str); parameters str the cssomstring to be escaped.
... 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 definiti...
CSS.registerProperty() - Web APIs
syntax css.registerproperty(propertydefinition); parameters a propertydefinition dictionary object, which can contain the following members: name a domstring indicating the name of the property being defined.
... syntax optional a domstring representing the expected syntax of the defined property.
... initialvalue optional a domstring representing the initial value of the defined property.
CSS.supports() - Web APIs
WebAPICSSsupports
the first one allows to test the support of a pair property-value: propertyname a domstring containing the name of the css property to check.
... value a domstring containing the value of the css property to check.
... the second syntax takes one parameter matching the condition of @supports: supportcondition a domstring containing the condition to check.
CSSKeyframesRule - Web APIs
the parameter is a domstring containing a keyframe in the same format as an entry of a @keyframes at-rule.
...the parameter is the index of the keyframe to be deleted, expressed as a domstring resolving as a number between 0% and 100%.
...the key is a domstring containing an index of the keyframe to be returned, resolving to a percentage between 0% and 100%.
CSSNamespaceRule - Web APIs
interface cssnamespacerule : cssrule { readonly attribute domstring namespaceuri; readonly attribute domstring?
...it has some specific properties: cssnamespacerule.namespaceuri returns a domstring containing the text of the uri of the given namespace.
... cssnamespacerule.prefix returns a domstring with the name of the prefix associated to this namespace.
Using the CSS Painting API - Web APIs
employ the css paint() function like we would any other <image> type, using the same string identifier we used in the paintworklet's registerpaint() function.
... paint(ctx, size, props, args) { // use our custom arguments const hasstroke = args[0].tostring(); // if stroke arg is 'stroke', don't fill if (hasstroke === 'stroke') { ctx.fillstyle = 'transparent'; ctx.strokestyle = colour; } ...
...e element // args -> list of arguments set when calling the paint() function in the css // where to start the highlight & dimensions const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; // the values passed in the paint() function in the css const colour = props.get( '--boxcolor' ); const stroketype = args[0].tostring(); const strokewidth = parseint(args[1]); // set the stroke width if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } // set the fill type if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = colour; } else if ( stroketype === 'filled' ) { ctx.fillstyle = colour; ctx.strokestyle = colour; } else { ...
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.
... to draw the outlines of the characters in a string, call the context's stroketext() method.
... syntax canvasrenderingcontext2d.filltext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context.
Client - Web APIs
WebAPIClient
properties client.id read only the universally unique identifier of the client as a string.
... client.type read only the client's type as a string.
... client.url read only the url of the client as a string.
Clipboard.writeText() - Web APIs
the clipboard interface's writetext() property writes the specified text string to the system clipboard.
... syntax var promise = navigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard.
... example this example sets the clipboard's contents to the string "<empty clipboard>".
ClipboardEvent() - Web APIs
type is a domstring representing the name of the type of the clipboardevent.
... datatype : a domstring containing the mime-type of the data contained in the data argument.
... data : a domstring containing the data concerned by the clipboard event.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
... dataarg a domstring representing the value of the data attribute.
... localearg a domstring representing the value of the locale attribute.
Console.error() - Web APIs
WebAPIConsoleerror
the string representations of each of these objects are appended together in the order listed and output.
... msg a javascript string containing zero or more substitution strings.
...substn javascript objects with which to replace substitution strings within msg.
Console.info() - Web APIs
WebAPIConsoleinfo
the string representations of each of these objects are appended together in the order listed and output.
... msg a javascript string containing zero or more substitution strings.
...substn javascript objects with which to replace substitution strings within msg.
Console.warn() - Web APIs
WebAPIConsolewarn
the string representations of each of these objects are appended together in the order listed and output.
... msg a javascript string containing zero or more substitution strings.
...substn javascript objects with which to replace substitution strings within msg.
CredentialsContainer.get() - Web APIs
the available options are: providers: an array of domstring instances of identity providers to search for.
... protocols an array of domstring instances of federation protocols to search for.
... mediation: a string indicating whether the user will be required to log on for every visit to the website.
DOMImplementation.createDocumentType() - Web APIs
syntax var doctype = document.implementation.createdocumenttype(qualifiednamestr, publicid, systemid); parameters qualifiednamestr is a domstring containing the qualified name, like svg:svg.
... publicid is a domstring containing the public identifier.
... systemid is a domstring containing the system identifiers.
DataTransfer.clearData() - Web APIs
if this method is called with no arguments or the format is an empty string, the data of all types will be removed.
... syntax datatransfer.cleardata([format]); parameters format optional a string which specifies the type of data to remove.
... if this parameter is an empty string or is not provided, the data for all types is removed.
DataTransfer.mozTypesAt() - Web APIs
if the index is not in the range from 0 to the number of items minus one, an empty string list is returned.
... return value nsivariant a list of data formats (which are strings).
... if the index is not in the range from 0 to the number of items minus one, an empty string list is returned.
DataTransfer - Web APIs
datatransfer.types read only an array of strings giving the formats that were set in the dragstart event.
... datatransfer.getdata() retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data.
...if the index is not in the range from 0 to the number of items minus one, an empty string list is returned.
DataTransferItem.kind - Web APIs
syntax var itemkind = datatransferitem.kind; return value a domstring representing the drag data item's kind.
... 'string' if the kind of drag data item is a plain unicode string.
... function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("...
DirectoryEntrySync - Web APIs
var direntry = fs.root.getdirectory('superseekrit', {create: true}); method overview directoryreadersync createreader () raises (fileexception); fileentrysync getfile (in domstring path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in domstring path, in optional flags options) raises (fileexception); void removerecursively () raises (fileexception); methods createreader() creates a new directoryreadersync to read entries from this directory.
... void getfile ( in domstring path, in optional flags options ) raises (fileexception); parameter path either an absolute path or a relative path from the directory to the file to be looked up or created.
... void getdirectory ( in domstring path, in optional flags options ) raises (fileexception); parameter path either an absolute path or a relative path from the directory to the file to be looked up or created.
Document.createElementNS() - Web APIs
syntax var element = document.createelementns(namespaceuri, qualifiedname[, options]); parameters namespaceuri a string that specifies the namespace uri to associate with the element.
... qualifiedname a string that specifies the type of element to be created.
...for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
syntax var xpathresult = document.evaluate( xpathexpression, contextnode, namespaceresolver, resulttype, result ); xpathexpression is a string representing the xpath to be evaluated.
... namespaceresolver is a function that will be passed any namespace prefixes and should return a string representing the namespace uri associated with that prefix.
... string_type 2 a result set containing a single string.
Document.location - Web APIs
WebAPIDocumentlocation
though document.location is a read-only location object, you can also assign a domstring to it.
... this means that you can work with document.location as if it were a string in most cases: document.location = 'http://www.example.com' is a synonym of document.location.href = 'http://www.example.com'.
... to retrieve just the url as a string, the read-only document.url property can also be used.
Document.mozSetImageElement() - Web APIs
syntax document.mozsetimageelement(imageelementid, imageelement); parameters imageelementid is a string indicating the name of an element that has been specified as a background image using the -moz-element css function.
... imageelement is the new element to use as the background corresponding to that image element string.
... var c = 0x00; function clicked() { var canvas = document.createelement("canvas"); canvas.setattribute("width", 100); canvas.setattribute("height", 100); var ctx = canvas.getcontext('2d'); ctx.fillstyle = "#" + c.tostring(16) + "0000"; ctx.fillrect(25, 25, 75, 75); c += 0x11; if (c > 0xff) { c = 0x00; } document.mozsetimageelement("canvasbg", canvas); } the code here is called each time the user clicks the <div> element.
Element.classList - Web APIs
WebAPIElementclassList
using classlist is a convenient alternative to accessing an element's list of classes as a space-delimited string via element.classname.
...string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.domexception) (domexception = function(reason){this.message = reason}).prototype = new error; var wsre = /[\11\12\14\15\40]/, wsindex = 0, checkifvalidclasslistentry = function(o, v) { if (v...
... (function(window){ var document = window.document, object = window.object, hasownprop = object.prototype.hasownproperty; var defineproperty = object.defineproperty, allowtokenlistconstruction = 0, skippropchange = 0; function domtokenlist(){ if (!allowtokenlistconstruction) throw typeerror("illegal constructor"); // internally let it through } domtokenlist.prototype.tostring = domtokenlist.prototype.tolocalestring = function(){return this.value}; domtokenlist.prototype.add = function(){ a: for(var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v!==arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("add", val); for (var i=0, len=proto.length, resstr=val; i !== len; ++i) if (t...
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.
... syntax var closestelement = targetelement.closest(selectors); parameters selectors is a domstring containing a selector list.
... exceptions syntaxerror is thrown if the selectors is not a valid selector list string.
Element.insertAdjacentText() - Web APIs
syntax element.insertadjacenttext(position, element); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself.
... element a domstring representing the text to be inserted into the tree.
... 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 ) } specification specification status comment domthe definition of 'insertadjacenttext()' in that specification.
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.
... syntax var result = element.matches(selectorstring); parameters selectorstring is a string representing the selector to test.
... exceptions syntax_err the specified selector string is invalid.
Element.setAttributeNS() - Web APIs
syntax element.setattributens(namespace, name, value) namespace is a string specifying the namespace of the attribute.
... name is a string identifying the attribute by its qualified name; that is, a namespace prefix followed by a colon followed by a local name.
... value is the desired string value of the new attribute.
ElementCSSInlineStyle.style - Web APIs
setting styles styles should not be set by assigning a string directly to the style property (as in elt.style = "color: blue;"), since it is considered read-only, as the style attribute returns a cssstyledeclaration object which is also read-only.
... a style declaration is reset by setting it to null or an empty string, e.g., elt.style.color = null.
... internet explorer requires setting it to an empty string, and does not do anything when setting it to null.
EventTarget.addEventListener() - Web APIs
syntax target.addeventlistener(type, listener [, options]); target.addeventlistener(type, listener [, usecapture]); target.addeventlistener(type, listener [, usecapture, wantsuntrusted ]); // gecko/mozilla only parameters type a case-sensitive string representing the event type to listen for.
... const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function () { console.log(this); // expected value: 'data' }.bind(somestring)); this method is suitable when you don't need to know which html element the event listener fired on programmatically from within the event listener.
... const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function() { console.log(somestring); // expected value: 'data' somestring = 'data again'; }); console.log(somestring); // expected value: 'data' (will never output 'data again') note: although inner scopes have access to const, let variables from outer scopes, you cannot expect any changes to these variables to be accessible after the even...
ExtendableMessageEvent() - Web APIs
syntax var extendablemessageevent = new extendablemessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... origin: a domstring that defines the origin of the corresponding service worker's environment settings object.
... lasteventid: a domstring that defines the last event id of the event source.
FetchEvent() - Web APIs
syntax var fetchevent = new fetchevent(type, init); parameters type a domstring object specifying which event the object represents.
... replacesclientid read only a domstring which identifies the client which is being replaced by resultingclientid.
... resultingclientid read only a domstring containing the new clientid if the client changes as a result of the page load.
FetchEvent.replacesClientId - Web APIs
it can be an empty string when navigating from about:blank to another page, as about:blank's client will be reused, rather than be replaced.
... additionally, if the fetch isn't a navigation, replacesclientid will be an empty string.
... syntax var myreplacedclientid = fetchevent.replacesclientid; value a domstring.
File.getAsBinary() - Web APIs
WebAPIFilegetAsBinary
note: this method is obsolete; you should use the filereader method readasbinarystring() or readasarraybuffer() instead.
... syntax var binary = instanceoffile.getasbinary(); returns a string.
...= 0; i < 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.
FileReader.readAsDataURL() - Web APIs
at that time, the result attribute contains the data as a data: url representing the file's data as a base64 encoded string.
...to retrieve only the base64 encoded string, first remove data:*/*;base64, from the result.
... example html <input type="file" onchange="previewfile()"><br> <img src="" height="200" alt="image preview..."> javascript function previewfile() { const preview = document.queryselector('img'); const file = document.queryselector('input[type=file]').files[0]; const reader = new filereader(); reader.addeventlistener("load", function () { // convert image file to base64 string preview.src = reader.result; }, false); if (file) { reader.readasdataurl(file); } } live result example reading multiple files html <input id="browse" type="file" onchange="previewfiles()" multiple> <div id="preview"></div> javascript function previewfiles() { var preview = document.queryselector('#preview'); var files = document.queryselector('input[type=file]').fil...
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.
... syntax filesystementry.tourl([mimetype]); parameters mimetype optional an optional string specifying the mime type to use when interpreting the file.
... return value a domstring containing a url that can then be used as a document reference in html content, or an empty string if the url can't be generated (such as if the file system implementation doesn't support tourl()).
Gamepad.id - Web APIs
WebAPIGamepadid
the gamepad.id property of the gamepad interface returns a string containing some information about the controller.
... the exact syntax is not strictly specified, but in firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller the name of the controller as provided by the driver.
... syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a string.
Gamepad.mapping - Web APIs
WebAPIGamepadmapping
the gamepad.mapping property of the gamepad interface returns a string indicating whether the browser has remapped the controls on the device to a known layout.
...if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard.
... syntax readonly attribute domstring mapping; example var gp = navigator.getgamepads()[0]; console.log(gp.mapping); value a string.
GlobalEventHandlers.onerror - Web APIs
}; function parameters: message: error message (string).
... source: url of the script where the error was raised (string) lineno: line number where error was raised (number) colno: column number for the line where the error occurred (number) error: error object (object) when the function returns true, this prevents the firing of the default event handler.
... window.onerror = function (msg, url, lineno, columnno, error) { var string = msg.tolowercase(); var substring = "script error"; if (string.indexof(substring) > -1){ alert('script error: see browser console for detail'); } else { var message = [ 'message: ' + msg, 'url: ' + url, 'line: ' + lineno, 'column: ' + columnno, 'error object: ' + json.stringify(error) ].join(' - '); alert(message); } return false; }; whe...
HTMLBaseFontElement - Web APIs
htmlbasefontelement.color is a domstring representing the text color using either a named color or a color specified in the hexadecimal #rrggbb format.
... htmlbasefontelement.face is a domstring representing a list of one or more font names.
... htmlbasefontelement.size is a domstring representing the font size as either a numeric or relative value.
HTMLCanvasElement.toBlob() - Web APIs
mimetype optional a domstring indicating the image format.
...o(d, d); ctx.lineto(0, d); ctx.closepath(); ctx.fillstyle = 'yellow'; ctx.fill(); function blobcallback(iconname) { return function(b) { var a = document.createelement('a'); a.textcontent = 'download'; document.body.appendchild(a); a.style.display = 'block'; a.download = iconname + '.ico'; a.href = window.url.createobjecturl(b); } } canvas.toblob(blobcallback('passthisstring'), 'image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); save toblob to disk with os.file (chrome/add-on context only) this technique saves it to the desktop and is only useful in firefox chrome context or add-on code as os apis are not present on web sites.
... '.ico'); var promise = os.file.writeatomic(writepath, new uint8array(r.result), {tmppath:writepath + '.tmp'}); promise.then( function() { console.log('successfully wrote file'); }, function() { console.log('failure writing file') } ); }; r.readasarraybuffer(b); } } canvas.toblob(blobcallback('passthisstring'), 'image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); specifications specification status comment html living standardthe definition of 'htmlcanvaselement.toblob' in that specification.
HTMLCanvasElement.toDataURL() - Web APIs
if the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned.
... syntax canvas.todataurl(type, encoderoptions); parameters type optional a domstring indicating the image format.
... return value a domstring containing the requested data uri.
HTMLFontElement - Web APIs
htmlfontelement.color is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format.
... htmlfontelement.face is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names.
... htmlfontelement.size is a domstring that reflects the size html attribute, containing either a font size number ranging from 1 to 7 or a relative size to the size attribute of the <basefont> element, for example -2 or +1.
HTMLHyperlinkElementUtils.hash - Web APIs
the htmlhyperlinkelementutils.hash property returns a usvstring containing a '#' followed by the fragment identifier of the url.
...if the url does not have a fragment identifier, this property contains an empty string, "".
... syntax string = object.hash; object.hash = string; examples <a id="myanchor" href="/docs/htmlhyperlinkelementutils.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.hash' in that specification.
HTMLHyperlinkElementUtils.search - Web APIs
the htmlhyperlinkelementutils.search property is a search string, also called a query string, that is usvstring containing a '?' followed by the parameters of the url.
... modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring.
... syntax string = object.search; object.search = string; examples // let an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.search' in that specification.
HTMLImageElement.crossOrigin - Web APIs
the htmlimageelement interface's crossorigin attribute is a string which specifies the cross-origin resource sharing (cors) setting to use when retrieving the image.
... syntax htmlimageelement.crossorigin = crossoriginmode; let crossoriginmode = htmlimageelement.crossorigin; value a domstring of a keyword specifying the cors mode to use when fetching the image resource.
... if crossorigin is an empty string (""), the anonymous mode is selected.
HTMLInputElement.setRangeText() - Web APIs
the htmlinputelement.setrangetext() method replaces a range of text in an <input> or <textarea> element with a new string.
... syntax element.setrangetext(replacement); element.setrangetext(replacement, start, end [, selectmode]); parameters replacement the string to insert.
... selectmode optional a string defining how the selection should be set after the text has been replaced.
HTMLObjectElement.validationMessage - Web APIs
the validationmessage read-only property of the htmlobjectelement interface returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
... syntax var string = htmlobjectelement.validationmessage; value a domstring.
Option() - Web APIs
syntax var optionelementreference = new option(text, value, defaultselected, selected); parameters text optional a domstring representing the content of the element, i.e.
...if this is not specified, a default value of "" (empty string) is used.
... value optional a domstring representing the value of the htmloptionelement, i.e.
HTMLOptionElement - Web APIs
htmloptionelement.label read only is a domstring that reflects the value of the label html attribute, which provides a label for the option.
... htmloptionelement.text is a domstring that contains the text content of the element.
... htmloptionelement.value is a domstring that reflects the value of the value html attribute, if it exists; otherwise reflects value of the node.textcontent property.
HTMLScriptElement.referrerPolicy - Web APIs
syntax refstr = scriptelem.referrerpolicy; scriptelem.referrerpolicy = refstr; value a domstring; one of the following: no-referrer the referer header will be omitted entirely.
... note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported.
...if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade.
HTMLVideoElement - Web APIs
htmlvideoelement.height is a domstring that reflects the height html attribute, which specifies the height of the display area, in css pixels.
... htmlvideoelement.poster is a domstring that reflects the poster html attribute, which specifies an image to show while no video data is available.
... htmlvideoelement.width is a domstring that reflects the width html attribute, which specifies the width of the display area, in css pixels.
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.
... returns a bytestring sequence representing the values of the retrieved header or null if this header is not set.
...example creating an empty headers object is simple: var myheaders = new headers(); // currently empty myheaders.get('not-set'); // returns null you could add a header to this using headers.append, then retrieve it using get(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns "image/jpeg" if the header has multiple values associated with it, the byte string will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns "deflate,gzip" note: headers.getall used to have this functionality, with headers.get returning only the first value added to the headers object.
IDBDatabase - Web APIs
<rect x="151" y="1" width="110" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="206" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbdatabase</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties idbdatabase.name read only a domstring that contains the name of the connected database.
...when a database is first created, this attribute is an empty string.
... idbdatabase.objectstorenames read only a domstringlist that contains a list of the names of the object stores currently in the connected database.
IDBFactorySync - Web APIs
method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database.
... idbdatabasesync open ( in domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database.
...a valid name is any string including the empty string.
IDBIndexSync - Web APIs
dbdatabaseexception); void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this index.
... name readonly domstring the name of this index.
... storename readonly domstring this index's referenced object store.
InputEvent.data - Web APIs
WebAPIInputEventdata
the data read-only property of the inputevent interface returns a domstring with the inserted characters.
... this may be an empty string if the change doesn't insert text (such as when deleting characters, for example).
... syntax var astring = inputevent.data; value a domstring.
InterventionReportBody - Web APIs
properties id a string representing the intervention that generated the report.
... message a string containing a human-readable description of the intervention, including information such how the intervention could be avoided.
... sourcefile a string containing the path to the source file where the intervention occurred, if known, or null otherwise.
KeyboardEvent() - Web APIs
syntax event = new keyboardevent(typearg, keyboardeventinit); values typearg is a domstring representing the name of the event.
... keyboardeventinitoptional is a keyboardeventinit dictionary, having the following fields: "key", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.key.
... "code", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.code.
Location: hash - Web APIs
WebAPILocationhash
the hash property of the location interface returns a usvstring containing a '#' followed by the fragment identifier of the url.
...if the url does not have a fragment identifier, this property contains an empty string, "".
... syntax string = object.hash; object.hash = string; examples <a id="myanchor" href="/docs/location.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html living standardthe definition of 'hash' in that specification.
Location: search - Web APIs
WebAPILocationsearch
the search property of the location interface is a search string, also called a query string; that is, a usvstring containing a '?' followed by the parameters of the url.
... modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring.
... syntax string = object.search; object.search = string; examples // let an <a id="myanchor" href="https://developer.mozilla.org/docs/location.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html living standardthe definition of 'search' in that specification.
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.
... encoding optional a string indicating the encoding to use for the returned data.
...in case of success, the request's result is a string representing the data that have been read.
MediaDeviceInfo.label - Web APIs
the label readonlyinline property of the mediadeviceinfo interface returns a domstring, that is a label describing this device (for example "external usb webcam").
... syntax var label = mediadeviceinfo.label; value a domstring which describes the media device.
... for security reasons, the label is always an empty string ("") if the user has not obtained permission to use at least one media device, either by starting a stream from the microphone or camera, or by persistent permissions being granted.
MediaDeviceInfo - Web APIs
properties mediadeviceinfo.deviceidread only returns a domstring that is an identifier for the represented device that is persisted across sessions.
... mediadeviceinfo.groupidread only returns a domstring that is a group identifier.
... mediadeviceinfo.labelread only returns a domstring that is a label describing this device (for example "external usb webcam").
MediaError.message - Web APIs
the read-only property mediaerror.message returns a domstring which contains a human-readable string offering specific diagnostic details related to the error described by the mediaerror object, or an empty string ("") if no diagnostic information can be determined or provided.
... syntax var errormessage = mediaerror.message; value a domstring providing a detailed, specific explanation of what went wrong and possibly how it might be fixed.
...if no specific details are available, this string is empty.
MediaSession.setActionHandler() - Web APIs
syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for.
... media session actions a media session action's type is specified using a string from the mediasessionaction enumerated type.
...the following strings identify the currently available types of media session action: nexttrack advances playback to the next track.
Media Session action types - Web APIs
the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type.
... syntax a media session action's type is specified using a string from the mediasessionaction enumerated type.
...the following strings identify the currently available types of media session action: nexttrack advances playback to the next track.
MediaSessionActionDetails - Web APIs
properties action a media session action type string taken from the mediasessionaction enumerated type, indicating which type of action needs to be performed.
... media action types a media session action's type is specified using a string from the mediasessionaction enumerated type.
...the following strings identify the currently available types of media session action: nexttrack advances playback to the next track.
MediaStream.getTrackById() - Web APIs
the mediastream.gettrackbyid() method returns a mediastreamtrack object representing the track with the specified id string.
... syntax var track = mediastream.gettrackbyid(id); parameters id a domstring which identifies the track to be returned.
... return value if a track is found for which mediastreamtrack.id matches the specified id string, that mediastreamtrack object is returned.
MediaTrackConstraints.facingMode - Web APIs
the mediatrackconstraints dictionary's facingmode property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the facingmode constrainable property.
... syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track.
... the following strings are permitted values for the facing mode.
MediaTrackSettings.deviceId - Web APIs
the mediatracksettings dictionary's deviceid property is a domstring which uniquely identifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session.
... syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source.
... the actual value of the string, however, is determined by the source of the track, and there is no guarantee what form it will take, although the specification does recommend it be a guid.
MediaTrackSettings.facingMode - Web APIs
the mediatracksettings dictionary's facingmode property is a domstring indicating the direction in which the camera producing the video track represented by the mediastreamtrack is currently facing.
... syntax var facingmode = mediatracksettings.facingmode; value a domstring whose value is one of the strings in videofacingmodeenum.
... videofacingmodeenum the following strings are permitted values for the facing mode.
MediaTrackSettings.groupId - Web APIs
the mediatracksettings dictionary's groupid property is a browsing-session unique domstring which identifies the group of devices which includes the source for the mediastreamtrack.
... syntax var groupid = mediatracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents.
... the actual value of the string, however, is determined by the source of the track, and there is no guarantee what form it will take, although the specification does recommend it be a guid.
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.
... merchantvalidationevent.validationurl secure context a usvstring specifying a url from which the site or app can fetch payment handler specific validation information.
Microdata DOM API - Web APIs
the document.getitems(typenames) method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types.
... when called, the method must return a live nodelist object containing all the elements in the document, in tree order, that are each top-level microdata items whose types include all the types specified in the method's argument, having obtained the types by splitting the string on spaces.
...nameditem(domstring name); // shadows inherited nameditem() readonly attribute domstring[] names; }; typedef sequence<any> propertyvaluearray; interface propertynodelist : nodelist { propertyvaluearray getvalues(); }; collection .
MimeType - Web APIs
WebAPIMimeType
mimetype.description returns a description of the associated plugin or an empty string if there is none.
... mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module.
...it might therefore return an empty string.
Navigator.oscpu - Web APIs
WebAPINavigatoroscpu
the navigator.oscpu property returns a string that identifies the current operating system.
... syntax oscpuinfo = navigator.oscpu value a domstring providing a string which identifies the operating system on which the browser is running.
... operating system oscpuinfo string format os/2 os/2 warp x (either 3, 4 or 4.5) windows ce windowsce x.y1 windows 64-bit (64-bit build) windows nt x.y; win64; x64 windows 64-bit (32-bit build) windows nt x.y; wow64 windows 32-bit windows nt x.y mac os x (ppc build) powerpc mac os x version x.y mac os x (i386/x64 build) intel mac os x or macos version x.y linux 64-bit (32-bit build) output of uname -s plus "i686 on x86_64" linux output of uname -sm x.y refers to the version of the operating system example function osinfo() { alert(window.navigator.oscpu); } osinfo(); // alerts "windows nt 6.0" for example usage notes unless your code is privileged (chrome or a...
Navigator.registerContentHandler() - Web APIs
syntax navigator.registercontenthandler(mimetype, uri, title); mimetype is the desired mime type as a string.
... uri is the uri to the handler as a string.
... title is the title of the handler presented to the user as a string.
Navigator.registerProtocolHandler() - Web APIs
parameters scheme a string containing the protocol the site wishes to handle.
... url a string containing the url of the handler.
... title a human-readable title string for the handler.
Navigator.share() - Web APIs
WebAPINavigatorshare
available options are: url: a usvstring representing a url to be shared.
... text: a usvstring representing text to be shared.
... title: a usvstring representing the title to be shared.
NavigatorID.appVersion - Web APIs
returns either "4.0" or a string representing version information about the browser.
... syntax window.navigator.appversion value either "4.0" or a string representing version information about the browser.
... example alert('your browser version is reported as ' + navigator.appversion); notes the window.navigator.useragent property may also contain the version number (for example "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape 6/6.1"), but you should be aware of how easy it is to change the user agent string and "spoof" other browsers, platforms, or user agents, and also how cavalier the browser vendor themselves are with these properties.
NavigatorID - Web APIs
navigatorid.appversion read only returns either "4.0" or a string representing version information about the browser.
... navigatorid.platform read only returns either the empty string or a string representing the platform the browser is running on.
... navigatorid.useragent read only returns the user-agent string for the current browser.
NavigatorLanguage.language - Web APIs
the navigatorlanguage.language read-only property returns a string representing the preferred language of the user, usually the language of the browser ui.
... syntax const lang = navigator.language value a domstring.
... lang stores a string representing the language version as defined in bcp 47.
Node.isSupported() - Web APIs
WebAPINodeisSupported
syntax boolvalue = element.issupported(feature, version) parameters feature is a domstring containing the name of the feature to test.
... version is a domstring containing the version number of the feature to test.
... in dom level 2, version 1, this is the string 2.0.
NotificationEvent.action - Web APIs
returns the string id of the notification button the user clicked.
... this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button.
... returns a domstring object.
PayerErrors.name - Web APIs
WebAPIPayerErrorsname
the value is a string explaining the problem.
... syntax payername = payererrors.name; value if this property is present in the payererrors object, the payer's name couldn't be successfully validated, and the name property's value is a domstring explaining the error.
... this string will be displayed to the user by the user agent's payment handling user interface.
PayerErrors.phone - Web APIs
WebAPIPayerErrorsphone
the value of this property is a string explaining the problem.
... syntax payerphone = payererrors.phone; value if this property is present in the payererrors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the error.
... this string will be displayed to the user by the user agent's payment handling user interface as appropriate.
PaymentAddress.dependentLocality - Web APIs
the read-only dependentlocality property of the paymentaddress interface is a string containing a sublocality designation within a city, such as a neighborhood, borough, district, or, in the united kingdom, a dependent locality.
... syntax var paymentdependentlocality = paymentaddress.dependentlocality; value a domstring indicating the sublocality portion of the address.
... this may be an empty string if no sublocality is available or required.
PaymentAddress.phone - Web APIs
the read-only phone property of the paymentaddress interface returns a string containing the telephone number of the recipient or contact person.
... syntax var paymentphone = paymentaddress.phone; value a domstring containing the telephone number for the recipient of the shipment or of the responsible party for payment.
... if no phone number is available, this value is an empty string.
PaymentAddress.postalCode - Web APIs
the postalcode read-only property of the paymentaddress interface returns a string containing a code used by a jurisdiction for mail routing, for example, the zip code in the united states or the postal index number (pin code) in india.
... syntax var paymentpostalcode = paymentaddress.postalcode; value a domstring which contains the postal code portion of the address.
... a postal code is a string (either numeric or alphanumeric) which is used by a postal service to optimize mail routing and delivery.
PaymentAddress.recipient - Web APIs
the read-only recipient property of the paymentaddress interface returns a string containing the name of the recipient, purchaser, or contact person at the payment address.
... syntax var paymentrecipient = paymentaddress.recipient; value a domstring giving the name of the person receiving or paying for the purchase, or the name of a contact person in other contexts.
... if no name is available, this string is empty.
PaymentAddress.region - Web APIs
the read-only region property of the paymentaddress interface returns a string containing the top-level administrative subdivision of the country in which the address is located.
... syntax var paymentregion = paymentaddress.region; value a domstring specifying the top-level administrative subdivision within the country in which the address is located.
...in such cases, the browser returns an empty string as the value of region.
PaymentMethodChangeEvent - Web APIs
syntax paymentmethodchangeevent = new paymentmethodchangeevent(type, options); parameters type a domstring which must contain the string paymentmethodchange, the name of the only type of event which uses the paymentmethodchangeevent interface.
... options optional an optional paymentmethodchangeeventinit dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used.
... this is an empty string by default.
PaymentMethodChangeEvent - Web APIs
methodname read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method.
... this identifier is usually a url used during the payment process, but may be a standardized non-url string as well, such as basic-card.
... the default value is the empty string, "".
PaymentResponse.complete() - Web APIs
syntax completepromise = paymentrequest.complete(result); parameters result optional a domstring indicating the state of the payment operation upon completion.
... note: in older versions of the specification, an empty string, "", was used instead of unknown to indicate a completion without a known result state.
...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.complete("fail"); }); }).catch(function(err) { console.er...
performance.measure() - Web APIs
syntax performance.measure(name); performance.measure(name, startmark); performance.measure(name, startmark, endmark); performance.measure(name, undefined, endmark); arguments name a domstring representing the name of the measure.
... startmark optional a domstring representing the name of the measure's starting mark.
... endmark optional a domstring representing the name of the measure's ending mark.
PerformanceObserver.observe() - Web APIs
the performance entry types are specified as an array of domstring objects, each naming one entry type; the type names are documented in performance entry type names in performanceentry.entrytype.
... syntax observer.observe(options); parameters options a performanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one performance entry type to observe.
... type: a single domstring specifying exactly one performance entry type to observe.
PerformanceResourceTiming - Web APIs
performanceresourcetiming.initiatortyperead only a string representing the type of resource that initiated the performance entry, as specified in performanceresourcetiming.initiatortype.
... performanceresourcetiming.nexthopprotocolread only a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301).
... methods performanceresourcetiming.tojson() returns a domstring that is the json representation of the performanceresourcetiming object.
PerformanceServerTiming - Web APIs
properties performanceservertiming.descriptionread only a domstring value of the server-specified metric description, or an empty string.
... performanceservertiming.nameread only a domstring value of the server-specified metric name.
... methods performanceservertiming.tojson() returns a domstring that is the json representation of the performanceservertiming object.
PromiseRejectionEvent() - Web APIs
type a string representing the name of the type of the promiserejectionevent.
...this can be anything from a numeric error code to an error domstring to an object which contains detailed information describing the situation resulting in the promise being rejected.
... examples this example creates a new unhandledrejection event for the promise mypromise with the reason being the string "my house is on fire".
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
syntax excludecredentials = publickeycredentialcreationoptions.excludecredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
... transports optional an array of strings describing the possible transports between the client and the authenticator.
... the value of the strings may be: "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed).
PublicKeyCredentialCreationOptions.rp - Web APIs
syntax relyingpartyobj = publickeycredentialcreationoptions.rp properties icon optional an url as a usvstring value which points to an image resource which can be the logo/icon of the relying party.
... id a domstring uniquely identifying a relying party.
... name a domstring giving a human-readable name for the relying party.
PublicKeyCredentialCreationOptions.user - Web APIs
syntax useraccount = publickeycredentialcreationoptions.user properties displayname a domstring which is human readable and intended for display.
... icon optional an url as a usvstring value which points to an image resource which can be the avatar image for the user.
... name a domstring giving a human-readable name for the user's identifier (e.g.
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
syntax allowcredentials = publickeycredentialrequestoptions.allowcredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
... transports optional an array of strings describing the possible transports between the client and the authenticator.
... the value of the strings may be: "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client device (cannot be removed).
RTCConfiguration.bundlePolicy - Web APIs
the rtcconfiguration dictionary's bundlepolicy property is a string value indicating which sdp bundling policy, if any, to use for the underlying rtp streams used by an rtcpeerconnection.
... syntax let rtcconfiguration = { bundlepolicy: policy }; rtcconfiguration.bundlepolicy = policy; value a domstring identifying the sdp bundling policy to use for the rtp streams used by the rtcpeerconnection.
... this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable.
RTCDTMFSender - Web APIs
"151" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="216" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcdtmfsender</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties rtcdtmfsender.tonebuffer read only a domstring which contains the list of dtmf tones currently in the queue to be transmitted (tones which have already been played are no longer included in the string).
... 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.
...you can abort sending queued tones by specifying an empty string ("") as the set of tones to play.
RTCDataChannel: error event - Web APIs
examples // strings for each of the sctp cause codes found in rfc // 4960, section 3.3.10: // https://tools.ietf.org/html/rfc4960#section-3.3.10 const sctpcausecodes = [ "no sctp error", "invalid stream identifier", "missing mandatory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unreco...
...the error's name is rtcerror and the message is an error string specified by the webrtc layer.
...the message string is always output, as is information about the source file's name, line number, and column number at which the error occurred.
RTCDataChannel.send() - Web APIs
this may be a usvstring, a blob, an arraybuffer, or an arraybufferview.
... example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp.
... var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.send()' in that specification.
RTCErrorEvent.error - Web APIs
additional properties defined by rtcerror are: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred.
...only valid if the errordetail string is dtls-failure.
...let errline = error.sdplinenumber; let errmessage = error.message; let alertmessage = `a syntax error occurred interpreting line ${errline} of the sdp: ${errmessage}`; showmyalertmessage("data channel error", alertmessage); } else { terminatemyconnection(); } }); if the error is an sdp syntax error—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message and the line number within the sdp at which the error occurred.
RTCIceCandidate.address - Web APIs
the rtcicecandidate interface's read-only address property is a string providing the address of the device which is the source of the candidate.
... syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes.
... usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the fifth field, "192.168.0.56" is the ip address in this candidate's a-line string.
RTCIceCandidate.port - Web APIs
as is the case with most of rtcicecandidate's properties, the value of port is extracted from the candidate a-line string specified when creating the rtcicecandidate.
... the a-line string is obtained either from the rtcicecandidateinit property candidate or from a-line string passed into the constructor upon using new rtcicecandidate().
... port is initialized to null if it is not specified in the candidate, or if the candidate string can't be parsed propertly.
RTCIceCandidate.sdpMid - Web APIs
the read-only property sdpmid on the rtcicecandidate interface returns a domstring specifying the media stream identification tag of the media component with which the candidate is associated.
...if you call the constructor with an m-line string instead of an rtcicecandidateinit object, the value of sdpmid is extracted from the specified candidate m-line string.
... syntax var sdpmid = rtcicecandidate.sdpmid; value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate.
RTCIceCandidate. toJSON() - Web APIs
you can then get a stringified version of the object by calling stringify() on the returned object.
... example this simple example obtains a json string representing an rtcicecandidate found in the variable candidate.
... var jsonstring = candidate.tojson().stringify(); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.tojson()' in that specification.
RTCIceCandidateInit.usernameFragment - Web APIs
value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server.
... the string may be up to 256 characters long, and has no default value.
...another example: it might take a user-defined string and append three 8-bit random bytes to the end.
RTCIceCandidatePairStats - Web APIs
localcandidateid optional the unique id string corresponding to the rtcicecandidate from the data included in the rtcicecandidatestats object providing statistics for the candidate pair's local candidate.
... remotecandidateid optional the unique id string corresponding to the remote candidate from which data was taken to construct the rtcicecandidatestats object describing the remote end of the connection.
... transportid optional a domstring that uniquely identifies the rtcicetransport that was inspected to obtain the transport-related statistics (as found in rtctransportstats) used in generating this object.
RTCIdentityErrorEvent - Web APIs
rtcidentityerrorevent.idp read only is a domstring describing the domain name of the identity provider (idp) generating the error response.
... rtcidentityerrorevent.loginurl read only is a domstring giving the url where the user can complete the authentication.
... rtcidentityerrorevent.protocol read only is a domstring describing the idp protocol in use.
RTCInboundRtpStreamStats.perDscpPacketsReceived - Web APIs
the perdscppacketsreceived property of the rtcinboundrtpstreamstats dictionary is a record comprised of key/value pairs in which each key is a string representation of a differentiated services code point and the value is the number of packets received for that dcsp.
... syntax var perdscppacketsreceived = rtcinboundrtpstreamstats.perdscppacketsreceived; value a record comprised of string/value pairs.
... each key is the string representation of a single differentiated services code point (dscp)'s id number.
RTCOutboundRtpStreamStats.perDscpPacketsSent - Web APIs
the perdscppacketssent property of the rtcoutboundrtpstreamstats dictionary is a record comprised of key/value pairs in which each key is a string representation of a differentiated services code point and the value is the number of packets sent for that dcsp.
... syntax var perdscppacketssent = rtcoutboundrtpstreamstats.perdscppacketssent; value a record comprised of string/value pairs.
... each key is the string representation of a single differentiated services code point (dscp)'s id number.
RTCPeerConnection.addIceCandidate() - Web APIs
the same is the case if the value of the specified object's candidate is either missing or an empty string (""), it signals that all remote candidates have been delivered.
... one or more of the values in the candidate string are invalid or could not be parsed.
... // this example assumes that the other peer is using a signaling channel as follows: // // pc.onicecandidate = event => { // if (event.candidate) { // signalingchannel.send(json.stringify({ice: event.candidate})); // "ice" is arbitrary // } else { // // all ice candidates have been sent // } // } signalingchannel.onmessage = receivedstring => { const message = json.parse(receivedstring); if (message.ice) { // a typical value of ice here might look something like this: // // {candidate: "candidate:0 1 udp 2122154243 192.168.1.9 53421 typ host", sdpmid: "0", ...} // // pass the whole thing to ad...
RTCPeerConnection.addTransceiver() - Web APIs
syntax rtptransceiver = rtcpeerconnection.addtransceiver(trackorkind, init); parameters trackorkind a mediastreamtrack to associate with the transceiver, or a domstring which is used as the kind of the receiver's track, and by extension of the rtcrtpreceiver itself.
... exceptions typeerror a string was specified as trackorkind which is not valid.
... the string must be either "audio" or "video".
RTCPeerConnection.iceConnectionState - Web APIs
the value is one of the strings in the rtciceconnectionstate enum.
... rtciceconnectionstate enum the rtciceconnectionstate enum defines the string constants used to describe the current state of the ice agent and its connection to the ice server (that is, the stun or turn server).
...this is a less stringent test than "failed" and may trigger intermittently and resolve just as spontaneously on less reliable networks, or during temporary disconnections.
RTCPeerConnection: icecandidate event - Web APIs
rtcpeerconnection.onicecandidate = (event) => { if (event.candidate) { sendcandidatetoremotepeer(event.candidate) } else { /* there are no more candidates coming during this negotiation */ } } the remote peer, upon receiving the candidate, will add the candidate to its candidate pool by calling addicecandidate(), passing in the candidate string you have passed along using the signaling server.
...that this has occurred is indicated by an icecandidate event whose candidate string is empty ("").
...as you see in the code in the previous section, every candidate is sent to the other peer, including any that might have an empty candidate string.
RTCPeerConnection.setIdentityProvider() - Web APIs
parameters domainname is a domstring is the domain name where the idp is.
... protocol optional is a domstring representing the protocol used to communicate with the idp.
... username optional is a domstring representing the username associated with the idp.
RTCRtpSendParameters - Web APIs
degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced.
... priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority.
... transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCRtpSender.setParameters() - Web APIs
the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced.
... priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority.
... transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCRtpStreamStats.kind - Web APIs
the kind property of the rtcrtpstreamstats dictionary is a string indicating whether the described rtp stream contains audio or video media.
... syntax mediakind = rtcrtpstreamstats.kind; value a domstring whose value is "audio" if the track whose statistics are given by the rtcrtpstreamstats object contains audio, or "video" if the track contains video media.
... this string will always be the same as the one provided by the associated mediastreamtrack object's kind property.
RTCSessionDescription() - Web APIs
a string which is a member of the rtcsdptype enum; it must have one of the following values: this enum defines strings that describe the current state of the session description, as used in the type property.
... sdp a string containing a sdp message describing the session.
... this value is an empty string ("") by default and may not be null.
RTCStats.id - Web APIs
WebAPIRTCStatsid
the id property of the rtcstats dictionary is a string which uniquely identifies the object for which this rtcstats object provides statistics.
... syntax var id = rtcstats.id; value a domstring which uniquely identifies the object for which this rtcstats-based object provides statistics.
... the format of the id string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type.
RTCStatsReport - Web APIs
this statistics report contains a mapping of statistic category string names to objects containing the corresponding statistics data.
... properties common to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which provides the most fundamental information: the timestamp, the statistic type string, and an id uniquely identifying the source of the data: id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype.
RadioNodeList.value - Web APIs
on retrieving the value property, the value of the currently checked radio button is returned as a string.
... if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned.
... syntax value = radionodelist.value; radionodelist.value = string; example html <form> <label><input type="radio" name="color" value="blue">blue</label> <label><input type="radio" name="color" value="red">red</label> </form> javascript // get the form const form = document.forms[0]; // get the form's radio buttons const radios = form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html living standardthe definition of 'radionodelist.value' in that specification.
ReadableStreamDefaultController.close() - Web APIs
the start() function generates a random string of text every second and enqueues it into the stream.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) },...
... pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'close()' in that specification.
ReadableStreamDefaultController.enqueue() - Web APIs
the start() function generates a random string of text every second and enqueues it into the stream — see controller.enqueue(string).
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) },...
... pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'enqueue()' in that specification.
ReadableStreamDefaultController - Web APIs
the start() function generates a random string of text every second and enqueues it into the stream.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) },...
... pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamsthe definition of 'readablestreamdefaultcontroller' in that specification.
SVGAltGlyphElement - Web APIs
musical symbols) or even alternate glyphs such as asian text strings it is required that a different set of glyphs be used than the normal given character data.
...it's data type is 'string'.
...it's data type is 'string'.
SVGStyleElement - Web APIs
svgstyleelement.type a domstring corresponding to the type attribute of the given element.
... svgstyleelement.media a domstring corresponding to the media attribute of the given element.
... svgstyleelement.title a domstring corresponding to the title attribute of the given element.
SVGTests - Web APIs
WebAPISVGTests
properties svgtests.requiredfeatures read only an svgstringlist corresponding to the requiredfeatures attribute of the given element.
... svgtests.requiredextensions read only an svgstringlist corresponding to the requiredextensions attribute of the given element.
... svgtests.systemlanguage read only an svgstringlist corresponding to the systemlanguage attribute of the given element.
SVGTextContentElement - Web APIs
svgtextcontentelement.getsubstringlength() returns a float representing the computed length of the formatted text advance distance for a substring of text within the element.
... 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.
...because the relationship between characters and glyphs is not one-to-one, only the first character of the relevant typographic character is returned svgtextcontentelement.selectsubstring() selects text within the element.
SVGViewElement - Web APIs
svgviewelement.viewtarget an svgstringlist corresponding to the viewtarget attribute of the given <view> element.
... a list of domstring values which contain the names listed in the viewtarget attribute.
... each of the domstring values can be associated with the corresponding element using the getelementbyid() method call.
Selection - Web APIs
WebAPISelection
selection.typeread only returns a domstring describing the type of the current selection.
... selection.tostring() returns a string currently being represented by the selection object, i.e.
... 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.
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
syntax var myswme = new serviceworkermessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... origin: a domstring that defines the origin of the corresponding service worker's environment settings object.
... lasteventid: a domstring that defines the last event id of the event source.
SpeechGrammar.src - Web APIs
WebAPISpeechGrammarsrc
the src property of the speechgrammar interface sets and returns a string containing the grammar from within in the speechgrammar object.
... syntax var mygrammar = speechgrammarinstance.src; value a domstring representing the grammar.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechGrammarList - Web APIs
speechgrammarlist.addfromstring() takes a grammar present in a specific domstring within the code base (e.g.
... 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.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'speechgrammarlist()' in that specification.
StyleSheet - Web APIs
stylesheet.href read only returns a domstring representing the location of the stylesheet.
... stylesheet.title read only returns a domstring representing the advisory title of the current style sheet.
... stylesheet.typeread only returns a domstring representing the style sheet language for this style sheet.
SubtleCrypto.unwrapKey() - Web APIs
syntax const result = crypto.subtle.unwrapkey( format, wrappedkey, unwrappingkey, unwrapalgo, unwrappedkeyalgo, extractable, keyusages ); parameters format is a string describing the data format of the key to unwrap.
... to use aes-kw, pass the string "aes-kw" or an object of the form { "name": "aes-kw }.
... for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm.
SubtleCrypto.verify() - Web APIs
syntax const result = crypto.subtle.verify(algorithm, key, signature, data); parameters algorithm is a domstring or object defining the algorithm to use, and for some algorithm choices, some extra parameters.
... to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the form { "name": "rsassa-pkcs1-v1_5" }.
... to use hmac, pass the string "hmac" or an object of the form { "name": "hmac" }.
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.
... syntax b1 = encoder.encode(string); parameters string is a usvstring containing the text to encode.
... examples <p class="source">this is a sample paragraph.</p> <p class="result">encoded result: </p> const sourcepara = document.queryselector('.source'); const resultpara = document.queryselector('.result'); const string = sourcepara.textcontent; const textencoder = new textencoder(); let encoded = textencoder.encode(string); resultpara.textcontent += encoded; specifications specification status comment encodingthe definition of 'textencoder.prototype.encode()' in that specification.
TransitionEvent - Web APIs
transitionevent.propertyname read only is a domstring containing the name css property associated with the transition.
... transitionevent.pseudoelement read only is a domstring, starting with ::, containing the name of the pseudo-element the animation runs on.
... if the transition doesn't run on a pseudo-element but on the element, an empty string: ''.
URL() - Web APIs
WebAPIURLURL
syntax const url = new url(url [, base]) parameters url a usvstring representing an absolute or relative url.
... base optional a usvstring representing the base url to use in case url is a relative url.
... note: you can still use an existing url object for the base, which stringifies itself to the object's href property.
URL.hash - Web APIs
WebAPIURLhash
the hash property of the url interface is a usvstring containing a '#' followed by the fragment identifier of the url.
...if the url does not have a fragment identifier, this property contains an empty string — "".
... syntax const string = url.hash url.hash = newhash value a usvstring.
URL.search - Web APIs
WebAPIURLsearch
the search property of the url interface is a search string, also called a query string, that is a usvstring containing a '?' followed by the parameters of the url.
... modern browsers provide the url.searchparams property to make it easy to parse out the parameters from the query string.
... syntax const searchparams = object.search url.search = newsearchparams value a usvstring.
URL.search - Web APIs
WebAPIURLsearch?q=123
the search property of the url interface is a search string, also called a query string, that is a usvstring containing a '?' followed by the parameters of the url.
... modern browsers provide the url.searchparams property to make it easy to parse out the parameters from the query string.
... syntax const searchparams = object.search url.search = newsearchparams value a usvstring.
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().
... syntax const href = url.tojson() return value a usvstring.
... examples const url = new url("/docs/web/api/url/tostring"); url.tojson(); // should return the url as a string specifications specification status comment urlthe definition of 'tojson()' in that specification.
VTTCue - Web APIs
WebAPIVTTCue
this can be the string auto or a number whose interpretation depends on the value of vttcue.snaptolines.
...this can be the string auto or a number representing the percentage of the vttcue.region, or the video size if vttcue.region is null.
... vttcue.text returns a domstring with the contents of the cue.
ValidityState.typeMismatch - Web APIs
if the type attribute expects specific strings, such as the email and url types and the value don't doesn't conform to the constraints set by the type, the typemismatch property will be true.
...if the value of the email input is not an empty string, a single valid e-mail address, or one or more comma separated email address if the multiple attribute is present, there is a typemismatch.
...if the value of the url input is not an empty string, a single valid url, or one or more comma separated urls if the multiple attribute is present, there is a typemismatch.
VideoTrack.label - Web APIs
WebAPIVideoTracklabel
the read-only videotrack property label returns a string specifying the video track's human-readable label, if one is available; otherwise, it returns an empty string.
... syntax var videotracklabel = videotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata.
... otherwise, an empty string ("") is returned.
WebGLRenderingContext.getShaderSource() - Web APIs
the webglrenderingcontext.getshadersource() method of the webgl api returns the source code of a webglshader as a domstring.
... syntax domstring gl.getshadersource(shader); parameters shader a webglshader object to get the source code from.
... return value a domstring containing the source code of the shader.
WebSocket() - Web APIs
protocols optional either a single protocol string or an array of protocol strings.
... these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol).
... if you don't specify a protocol string, an empty string is assumed.
WebSocket.close() - Web APIs
WebAPIWebSocketclose
reason optional a human-readable string explaining why the connection is closing.
... this string must be no longer than 123 bytes of utf-8 text (not characters).
... syntax_err the reason string is too long or contains unpaired surrogates.
WebSocket.send() - Web APIs
WebAPIWebSocketsend
it may be one of the following types: usvstring a text string.
... the string is added to the buffer in utf-8 format, and the value of bufferedamount is increased by the number of bytes required to represent the utf-8 string.
... syntax_err the data is a string that has unpaired surrogates.
Writing WebSocket servers - Web APIs
to get it, concatenate the client's sec-websocket-key and the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" together (it's a "magic string"), take the sha-1 hash of the result, and return the base64 encoding of that hash.
... tip: to avoid name conflict, it's recommended to make your subprotocol name part of a domain string.
...note that this isn't required, it's just an optional convention, and you can use any string you wish.
Writing a WebSocket server in Java - Web APIs
nto parts: import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.net.serversocket; import java.net.socket; import java.security.messagedigest; import java.security.nosuchalgorithmexception; import java.util.base64; import java.util.scanner; import java.util.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.
... try { string data = s.usedelimiter("\\r\\n\\r\\n").next(); matcher get = pattern.compile("^get").matcher(data); creating the response is easier than understanding why you must do it in this way.
... if (get.find()) { matcher match = pattern.compile("sec-websocket-key: (.*)").matcher(data); match.find(); byte[] response = ("http/1.1 101 switching protocols\r\n" + "connection: upgrade\r\n" + "upgrade: websocket\r\n" + "sec-websocket-accept: " + base64.getencoder().encodetostring(messagedigest.getinstance("sha-1").digest((match.group(1) + "258eafa5-e914-47da-95ca-c5ab0dc85b11").getbytes("utf-8"))) + "\r\n\r\n").getbytes("utf-8"); out.write(response, 0, response.length); decoding messages after a successful handshake, client can send messages to the server, but now these are encoded.
Using the Web Storage API - Web APIs
the keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings).
...e (see events.js) the only javascript is as follows: window.addeventlistener('storage', function(e) { document.queryselector('.my-key').textcontent = e.key; document.queryselector('.my-old').textcontent = e.oldvalue; document.queryselector('.my-new').textcontent = e.newvalue; document.queryselector('.my-url').textcontent = e.url; document.queryselector('.my-storage').textcontent = json.stringify(e.storagearea); }); here we add an event listener to the window object that fires when the storage object associated with the current origin is changed.
... as you can see above, the event object associated with this event has a number of properties containing useful information — the key of the data that changed, the old value before the change, the new value after that change, the url of the document that changed the storage, and the storage object itself (which we've stringified so you can see its content).
Window.devicePixelRatio - Web APIs
ctx.scale(scale, scale); ctx.fillstyle = "#bada55"; ctx.fillrect(10, 10, 300, 300); ctx.fillstyle = "#ffffff"; ctx.font = '18px arial'; ctx.textalign = 'center'; ctx.textbaseline = 'middle'; var x = size / 2; var y = size / 2; var textstring = "i love mdn"; ctx.filltext(textstring, x, y); monitoring screen resolution or zoom level changes in this example, we'll set up a media query and watch it to see when the device resolution changes, so that we can check the value of devicepixelratio to handle any updates we need to.
... let pixelratiobox = document.queryselector(".pixel-ratio"); let mqstring = `(resolution: ${window.devicepixelratio}dppx)`; const updatepixelratio = () => { let pr = window.devicepixelratio; let prstring = (pr * 100).tofixed(0); pixelratiobox.innertext = `${prstring}% (${pr.tofixed(2)})`; } updatepixelratio(); matchmedia(mqstring).addlistener(updatepixelratio); the string mqstring is set up to be the media query itself.
... the updatepixelratio() function fetches the current value of devicepixelratio, then sets the innertext of the element pixelratiobox to a string which displays the ratio both as a percentage and as a raw decimal value with up to two decimal places.
window.location - Web APIs
WebAPIWindowlocation
though window.location is a read-only location object, you can also assign a domstring to it.
... this means that you can work with location as if it were a string in most cases: location = 'http://www.example.com' is a synonym of location.href = 'http://www.example.com'.
...g: function showloc() { var olocation = location, alog = ["property (typeof): value", "location (" + (typeof olocation) + "): " + olocation ]; for (var sprop in olocation){ alog.push(sprop + " (" + (typeof olocation[sprop]) + "): " + (olocation[sprop] || "n/a")); } alert(alog.join("\n")); } // in html: <button onclick="showloc();">show location properties</button> example #5: send a string of data to the server by modifying the search property: function senddata (sdata) { location.search = sdata; } // in html: <button onclick="senddata('some data');">send data</button> the current url with "?some%20data" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string).
Window: popstate event - Web APIs
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.
... examples a page at http://example.com/example.html running the following code will generate logs as indicated: window.addeventlistener('popstate', (event) => { console.log("location: " + document.location + ", state: " + json.stringify(event.state)); }); history.pushstate({page: 1}, "title 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // logs "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // logs "location: http://example.com/example.html, state: null" history.go(2); // logs "location: http://e...
...xample.com/example.html?page=3, state: {"page":3}" the same example using the onpopstate event handler property: window.onpopstate = function(event) { console.log("location: " + document.location + ", state: " + json.stringify(event.state)); }; history.pushstate({page: 1}, "title 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // logs "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // logs "location: http://example.com/example.html, state: null" history.go(2); // logs "location: http://example.com/example.html?page=3, state: {"page":3}" note that even though the original history entry (for http://example.com/example.html) has no state object associated with it,...
WindowOrWorkerGlobalScope.origin - Web APIs
the origin read-only property of the windoworworkerglobalscope interface returns the origin of the global scope, serialized as a string.
... syntax var myorigin = self.origin; // or just origin value a usvstring.
...via file:// url), origin will return the string "null".
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
code an alternative syntax that allows you to include a string instead of a function, which is compiled and executed when the timer expires.
... passing string literals passing a string instead of a function to settimeout() has the same associated problems as using eval.
... // recommended window.settimeout(function() { alert('hello world!'); }, 500); // not recommended window.settimeout("alert('hello world!');", 500); a string passed to settimeout is evaluated in the global context, so local symbols in the context where settimeout() was called will not be available when the string is evaluated as code.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.origin read only returns the origin of the global scope, serialized as a string.
... windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
... windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data.
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.origin read only returns the global object's origin, serialized as a string.
... methods implemented from elsewhere windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
... windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data.
WritableStream.WritableStream() - Web APIs
the reason parameter contains a domstring describing why the stream was aborted.
...it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
Sending and Receiving Binary Data - Web APIs
possible values are the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
... the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string.
...req.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property.
XMLHttpRequest.responseText - Web APIs
syntax var resulttext = xmlhttprequest.responsetext; value a domstring which contains either the textual data received using the xmlhttprequest or null if the request failed or "" if the request has not yet been sent by calling send().
... exceptions invalidstateerror the xmlhttprequest.responsetype is not set to either the empty string or "text".
... example var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); // if specified, responsetype must be empty string or "text" xhr.responsetype = 'text'; xhr.onload = function () { if (xhr.readystate === xhr.done) { if (xhr.status === 200) { console.log(xhr.response); console.log(xhr.responsetext); } } }; xhr.send(null); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XMLHttpRequestResponseType - Web APIs
the xmlhttprequestresponsetype type is an enumerated set of strings which are used to specify the type of data contained in the response of an xmlhttprequest.
... values "" an empty responsetype string is treated the same as "text", the default type.
... text the response is a text in a domstring object.
XRInputSource - Web APIs
handednessread only a domstring that indicates which hand the device represented by this xrinputsource is being used in, if any.
... profilesread only an array of domstring objects, each specifying the name of an input profile describing the preferred visual representation and behavior of this input source.
... targetraymoderead only a domstring indicating the methodology used to produce the target ray: gaze, tracked-pointer, or screen.
XRPermissionStatus.granted - Web APIs
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.
... syntax grantedfeatures = xrpermissionstatus.granted; value an array of domstring objects, each identifying a single webxr feature which the app or site has been granted permission to use.
... currently, all of these strings come from the xrreferencespacetype enumerated type.
XRSystem: isSessionSupported() - Web APIs
syntax var issupportedpromise = xr.issessionsupported(xrsessionmode) parameters xrsessionmode a domstring specifying the webxr session mode for which support is to be checked.
... this string must be one of inline (to present the webxr content inline within the context of an html document) or immersive-vr for a fully-immersive virtual experience.
... exceptions rather than throwing true exceptions, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings.
suffix - CSS: Cascading Style Sheets
it may be a <string>, <image>, or <custom-ident>.
..." (full stop followed by a space)computed valueas specified formal syntax <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
@counter-style - CSS: Cascading Style Sheets
a @counter-style rule defines how to convert a counter value into a string representation.
... system specifies the algorithm to be used for converting the integer value of a counter to a string representation.
...symbols can contain string, images or custom identifiers.
@import - CSS: Cascading Style Sheets
WebCSS@import
syntax @import url; @import url list-of-media-queries; @import url supports( supports-query ); @import url supports( supports-query ) list-of-media-queries; where: url is a <string> or a <url> representing the location of the resource to import.
... formal syntax @import [ <string> | <url> ] [ <media-query-list> ]?;where <media-query-list> = <media-query>#where <media-query> = <media-condition> | [ not | only ]?
... recommendation added support for <string> to denote the url of a stylesheet, and requirement to insert the @import rule at the beginning of the css document.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
in the live example below for instance i have two paragraph elements that contain a string of text.
...this then, is the min-content size of that string.
... essentially, the longest word in the string is dictating the size.
OpenType font features guide - CSS: Cascading Style Sheets
the issue with simply using font-feature-settings for everything is that every time you want to change one of the individual features, you have to redefine the entire string (similar to manipulating variable fonts with font-variation-settings).
...the example below shows a string of glyphs with only the opentype set 'jis78' enabled.
...this gives a lot of control, but has some disadvantages in how it impacts inheritance and — as mentioned above — if you wish to change one setting, you have to redeclare the entire string (unless you're using css custom properties to set the values).
<basic-shape> - CSS: Cascading Style Sheets
<string>) the optional <fill-rule> represents the filling rule used to determine the interior of the path.
... the required <string> is an svg path string encompassed in quotes the arguments not defined above are defined as follows: <shape-arg> = <length> | <percentage> <shape-radius> = <length> | <percentage> | closest-side | farthest-side defines a radius for a circle or ellipse.
... if both shapes are of type path(), both paths strings have the same number and types of path data commands in the same order, interpolate each path data command as real numbers.
counter() - CSS: Cascading Style Sheets
WebCSScounter
the counter() css function returns a string representing the current value of the named counter, if there is one.
... it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported.
...the counter() function (and counters() function) is what makes it useful by returning developer defined strings (or images).
grid-template-areas - CSS: Cascading Style Sheets
syntax /* keyword value */ grid-template-areas: none; /* <string> values */ grid-template-areas: "a b"; grid-template-areas: "a b b" "a c d"; /* global values */ grid-template-areas: inherit; grid-template-areas: initial; grid-template-areas: unset; values none the grid container doesn’t define any named grid areas.
... <string>+ a row is created for every separate string listed, and a column is created for each cell in the string.
... formal definition initial valuenoneapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <string>+ examples specifying named grid areas html <section id="page"> <header>header</header> <nav>navigation</nav> <main>main area</main> <footer>footer</footer> </section> css #page { display: grid; width: 100%; height: 250px; grid-template-areas: "head head" "nav main" "nav foot"; grid-template-rows: 50px 1fr 30px; grid-template-columns: 150px 1fr; } #page > header { grid-area: head; ...
grid-template - CSS: Cascading Style Sheets
<string> <track-size>?
... sets grid-template-areas to the strings listed, grid-template-rows to the track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the track listing specified after the slash (or none, if not specified).
...<string> <track-size>?
ident - CSS: Cascading Style Sheets
WebCSSident
the <ident> css data type denotes an arbitrary string used as an identifier.
...'bilibob' this would be a <string>.
... "bilibob" this would be a <string>.
quotes - CSS: Cascading Style Sheets
WebCSSquotes
syntax /* keyword value */ quotes: none; quotes: auto; /* <string> values */ quotes: "«" "»"; /* set open-quote and close-quote to the french quotation marks */ quotes: "«" "»" "‹" "›"; /* set two levels of quotation marks */ /* global values */ quotes: inherit; quotes: initial; quotes: unset; values none the open-quote and close-quote values of the content property produce no quotation marks.
... [<string> <string>]+ one or more pairs of <string> values for open-quote and close-quote.
... formal definition initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be.
url() - CSS: Cascading Style Sheets
WebCSSurl()
syntax values <string> <url> a url, which is a relative or absolute address, or pointer, to the web resource to be included, or a data uri, optionally in single or double quotes.
... <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification.
... formal syntax url( <string> <url-modifier>* ) examples content property html <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> css li::after { content: ' - ' url(https://mdn.mozillademos.org/files/16761/star.gif); } result data-uri html <div class="background"></div> css .background { height: 100vh; } .background { background: yellow; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='90' height='45'%3e%3cpath d='m10 10h60' stroke='%2300f' stroke-width='5'/%3e%3cpath d='m10 20h60' stroke='%230f0' stroke-width='5'/%3e%3cpath d='m10 30h60' stroke='red' stroke-width='5'/%3e%3c/svg%3e"); } specifications specification status comment css values and units module level 4the definition of 'url...
EXSLT
upon the capabilities of xslt.math (math)the exslt math package provides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings.
... functions set:difference() set:distinct() set:intersection() set:has-same-node() set:leading() set:trailing() strings the exslt strings package provides functions that allow the manipulation of strings.
... the namespace for the strings package is http://exslt.org/strings.
Ajax - Developer guides
WebGuideAJAX
possible values are the empty string (default), arraybuffer, blob, document, json, and text.
... the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string.
... parsing and serializing xml how to parse an xml document from a string, a file or via javascript and how to serialize xml documents to strings, javascript object trees (jxon) or files.
Cross-browser audio basics - Developer guides
} canplaytype() returns one of three values: probably maybe "" (an empty string) in practice, we usually check if the result is true or false.
... non-empty strings are true.
... note: a very early spec specified that the browser should return no instead of an empty string, but thankfully the number of people using older browsers that implement this version of the spec are few and far between.
DOM onevent handlers - Developer guides
let logelement = document.queryselector('div'); let el = document.queryselector("a"); function log(msg) { logelement.innerhtml += `${msg}<br>` }; function anchoronclick(event) { log("changed onclick handler") }; // original handler log(`element's onclick as a javascript property: <code> ${el.onclick.tostring()} </code>`); //changing handler 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 h...
...andler 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.
...note that the event parameter actually contains the error message as a string.
Overview of events and handlers - Developer guides
the pattern starts with an agreement over a kind of event and: the name string used for the event, the type of the data structure used to represent the key properties of that event, and the javascript object which will 'emit' that event.
... the pattern is implemented by defining a javascript function which takes as an argument the data structure which was agreed upon, and registering the function using the name string with the object which will emit the event.
...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.
Mobile Web Development - Developer guides
WebGuideMobile
but sometimes this is impractical, and web sites resort to parsing the browser's user agent string to try to distinguish between desktops, tablets, and phones, to serve different content to each type of device.
... if you do this, make sure your algorithm is correct, and you aren't serving the wrong type of content to a device because you don't understand a particular browser's user agent string.
... see this guide to using the user agent string to determine device type.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
headers this attribute contains a list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element.
... axis this attribute contains a list of space-separated strings.
... each string is the id of a group of cells that this header applies to.
MIME types (IANA media types) - HTTP
structure of a mime type the simplest mime type consists of a type and a subtype; these are each strings which, when concatenated with a slash (/) between them, comprise a mime type.
... as a multipart document format, it consists of different parts, delimited by a boundary (a string starting with a double dash --).
... content-type: multipart/form-data; 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"></la...
Content negotiation - HTTP
this string may contain a space-separated list of product tokens and comments.
...a comment is a free string delimited by parentheses.
... obviously parentheses cannot be used in that string.
Content-Disposition - HTTP
additional parameters are case-insensitive and have arguments that use quoted-string syntax after the '=' sign.
... content-disposition: form-data content-disposition: form-data; name="fieldname" content-disposition: form-data; name="fieldname"; filename="filename.jpg" directives name is followed by a string containing the name of the html field in the form that the content of this subpart refers to.
... filename is followed by a string containing the original name of the file transmitted.
CSP: script-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
... <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.
Index - HTTP
WebHTTPHeadersIndex
110 user-agent http, reference, header the user-agent request header contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent.
... 111 firefox user agent string reference compatibility, firefox, firefox 4, gecko, gecko 2.0, guide this document describes the user agent string used in firefox 4 and later and applications based on gecko 2.0 and later.
... for a breakdown of changes to the string in gecko 2.0, see final user agent string for firefox 4 (blog post).
HTTP headers - HTTP
WebHTTPHeaders
etag a unique string identifying the version of the resource.
... user-agent contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent.
... see also the firefox user agent string reference.
HTTP Messages - HTTP
WebHTTPMessages
it can be an absolute path, ultimately followed by a '?' and query string.
... headers http headers from a request follow the same basic structure of an http header: a case-insensitive string followed by a colon (':') and a value whose structure depends upon the header.
... headers http headers for responses follow the same structure as any other header: a case-insensitive string followed by a colon (':') and a value whose structure depends upon the type of the header.
Keyed collections - JavaScript
toot'); sayings.size; // 3 sayings.get('dog'); // woof sayings.get('fox'); // undefined sayings.has('bird'); // false sayings.delete('dog'); sayings.has('dog'); // false for (let [key, value] of sayings) { console.log(key + ' goes ' + value); } // "cat goes meow" // "elephant goes toot" sayings.clear(); sayings.size; // 0 object and map compared traditionally, objects have been used to map strings to values.
... the keys of an object are strings or symbols, where they can be of any value for a map.
... use maps if there is a need to store primitive values as keys because object treats each key as a string whether it's a number value, boolean value or any other primitive value.
Quantifiers - JavaScript
notice that when matching "caaaaaaandy", the match is "aaa", even though the original string had more "a"s in it.
... by default quantifiers like * and + are "greedy", meaning that they try to match as much of the string as possible.
...for example, given a string like "some <foo> <bar> new </bar> </foo> thing": /<.*>/ will match "<foo> <bar> new </bar> </foo>" /<.*?>/ will match "<foo>" examples repeated pattern var wordendingwithas = /\w+a+\b/; var delicatemessage = "this is spartaaaaaaa"; console.table(delicatemessage.match(wordendingwithas)); // [ "spartaaaaaaa" ] counting characters var singleletterword = /\b\w\b/g; var notsolongword = /\b\w{1,6}\b/g; var loooongword = /\b\w{13,}\b/g; var sentence = "why do i have to learn multiplication table?"; console.table(sentence.match(singleletterword)); // ["i"] console.table(sentence.match(notsolongword)); // [ "...
Inheritance and the prototype chain - JavaScript
{ constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } we can add properties to the prototype of dosomething(), as shown below.
... function dosomething(){} dosomething.prototype.foo = "bar"; console.log( dosomething.prototype ); this results in: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } we can now use the new operator to create an instance of dosomething() based on this prototype.
...cing ); this results in an output similar to the following: { prop: "some value", __proto__: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } } as seen above, the __proto__ of dosomeinstancing is dosomething.prototype.
SyntaxError: invalid regular expression flag "x" - JavaScript
to match newlines (added in ecmascript 2018) u unicode; treat pattern as a sequence of unicode code points y perform a "sticky" search that matches starting at the current position in the target string.
... let obj = { url: /docs/web }; // syntaxerror: invalid regular expression flag "w" or did you mean to create a string instead?
... add single or double quotes to create a string literal.
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.
... it has a count parameter indicating the number of times to repeat the string.
RangeError: argument is not a valid code point - JavaScript
the javascript exception "invalid code point" occurs when nan values, negative integers (-1), non-integers (5.4), or values larger than 0x10ffff (1114111) are used with string.fromcodepoint().
... string.fromcodepoint() throws this error when passed nan values, negative integers (-1), non-integers (5.4), or values larger than 0x10ffff (1114111).
... examples invalid cases string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infinity); // rangeerror string.fromcodepoint(-1); // rangeerror string.fromcodepoint(3.14); // rangeerror string.fromcodepoint(3e-2); // rangeerror string.fromcodepoint(nan); // rangeerror valid cases string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404" string.fromcodepoint(0x2f804); // "\ud87e\udc04" string.fromcodepoint(194564); // "\ud87e\udc04" string.fromcodepoint(0x1d306, 0x61, 0x1d307) // "\ud834\udf06a\ud834\udf07" ...
ReferenceError: "x" is not defined - JavaScript
examples variable not declared foo.substring(1); // referenceerror: foo is not defined the "foo" variable isn't defined anywhere.
... it needs to be some string, so that the string.prototype.substring() method will work.
... var foo = 'bar'; foo.substring(1); // "ar" wrong scope a variable needs to be available in the current context of execution.
Array.from() - JavaScript
symbol.iterator : 'symbol(symbol.iterator)'; } catch { symboliterator = 'symbol(symbol.iterator)'; } var tostr = object.prototype.tostring; var iscallable = function (fn) { return ( typeof fn === 'function' || tostr.call(fn) === '[object function]' ); }; var tointeger = function (value) { var number = number(value); if (isnan(number)) return 0; if (number === 0 || !isfinite(number)) return number; return (n...
...object(new c(len)) : new array(len); return getarray( t, a, len, setgetitemhandler(isiterator, items), isiterator, mapfn ); }; })(); } examples array from a string array.from('foo'); // [ "f", "o", "o" ] array from a set const set = new set(['foo', 'bar', 'baz', 'foo']); array.from(set); // [ "foo", "bar", "baz" ] array from a map const map = new map([[1, 2], [2, 4], [4, 8]]); array.from(map); // [[1, 2], [2, 4], [4, 8]] const mapper = new map([['1', 'a'], ['2', 'b']]); array.from(mapper.values()); // ['a', 'b']; array.from(mapper.keys()); // ['1', '...
...= (start, stop, step) => array.from({ length: (stop - start) / step + 1}, (_, i) => start + (i * step)); // generate numbers range 0..4 range(0, 4, 1); // [0, 1, 2, 3, 4] // generate numbers range 1..10 with step of 2 range(1, 10, 2); // [1, 3, 5, 7, 9] // generate the alphabet using array.from making use of it being ordered as a sequence range('a'.charcodeat(0), 'z'.charcodeat(0), 1).map(x => string.fromcharcode(x)); // ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] specifications specification initial publication ecmascript (ecma-262)the definition of 'array.from' in that specification.
Array.prototype.indexOf() - JavaScript
note: for the string method, see string.prototype.indexof().
...let pk be tostring(k).
... let elementk be the result of calling the get // internal method of o with the argument tostring(k).
Array.prototype.map() - JavaScript
let pk be tostring(k).
... let numbers = [1, 4, 9] let doubles = numbers.map(function(num) { return num * 2 }) // doubles is now [2, 8, 18] // numbers is still [1, 4, 9] using map generically this example shows how to use map on a string to get an array of bytes in the ascii encoding representing the character values: let map = array.prototype.map let a = map.call('hello world', function(x) { return x.charcodeat(0) }) // a now equals [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100] using map generically queryselectorall this example shows how to iterate through a collection of objects collected by queryselectorall.
... here is a concise example of the iteration steps: // parseint(string, radix) -> map(parseint(value, index)) /* first iteration (index is 0): */ parseint("1", 0) // 1 /* second iteration (index is 1): */ parseint("2", 1) // nan /* third iteration (index is 2): */ parseint("3", 2) // nan then let's talk about solutions.
Array.prototype.slice() - JavaScript
for strings, numbers and booleans (not string, number and boolean objects), slice copies the values into the new array.
... changes to the string, number, or boolean in one array do not affect the other array.
...console.log('mycar = ' + json.stringify(mycar)) console.log('newcar = ' + json.stringify(newcar)) console.log('mycar[0].color = ' + mycar[0].color) console.log('newcar[0].color = ' + newcar[0].color) // change the color of myhonda.
Array.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the array.
... syntax arr.tosource() return value 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.
Boolean.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax booleanobj.tosource() boolean.tosource() return value a string representing the source code of the object.
... examples native function for the built-in boolean object, tosource returns the following string indicating that the source code is not available: function boolean() { [native code] } specifications not part of any standard.
Date.prototype.toJSON() - JavaScript
the tojson() method returns a string representation of the date object.
... syntax dateobj.tojson() return value a string representation of the given date.
...calling tojson() returns a string (using toisostring()) representing the date object's value.
Date.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax dateobj.tosource() date.tosource() return value a string representing the source code of the given date object.
... examples native function for the built-in date object, tosource() returns the following string indicating that the source code is not available: function date() { [native code] } specifications not part of any standard.
Error.prototype.stack - JavaScript
the stack string proceeds from the most recent calls to earlier ones, leading back to the original global scope call.
... argument values in the stack: prior to firefox 14, the function name would be followed by the argument values converted to string in parentheses immediately before the at (@) sign.
...note that if string arguments were passed in with values such as "@", "(", ")" (or if in file names), you could not easily rely on these for breaking the line into its component parts.
Function.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax function.tosource(); return value a string representing the source code of the object.
... examples native functions for the built-in function object, tosource() returns the following string indicating that the source code is not available: function function() { [native code] } custom functions for custom functions, tosource() returns the javascript source that defines the object as a string.
Intl.Collator - JavaScript
the intl.collator objects enable language sensitive string comparison.
... instance methods intl.collator.prototype.compare getter function that compares two strings according to the sort order of this intl.collator object.
... examples using collator the following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: console.log(new intl.collator().compare('a', 'c')); // → a negative value console.log(new intl.collator().compare('c', 'a')); // → a positive value console.log(new intl.collator().compare('a', 'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions.
Intl.NumberFormat() constructor - JavaScript
syntax new intl.numberformat([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings.
... "engineering" return the exponent of ten when divisible by three "compact" string representing exponent, defaults is using the "short" form.
... examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned.
Intl.NumberFormat - JavaScript
intl.numberformat.prototype.formattoparts() returns an array of objects representing the number string in parts that can be used for custom locale-aware formatting.
... examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned.
...-jp', { style: 'currency', currency: 'jpy' }).format(number)); // → ï¿¥123,457 // limit to three significant digits console.log(new intl.numberformat('en-in', { maximumsignificantdigits: 3 }).format(number)); // → 1,23,000 using style and unit console.log(new intl.numberformat("pt-pt", { style: 'unit', unit: "mile-per-hour" }).format(50)); // → 50 mi/h console.log((16).tolocalestring('en-gb', { style: "unit", unit: "liter", unitdisplay: "long" })); // → 16 litres specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat' in that specification.
Math.abs() - JavaScript
examples behavior of math.abs() passing an empty object, an array with more than one member, a non-numeric string or undefined/empty variable returns nan.
... passing null, an empty string or an empty array returns 0.
... math.abs('-1'); // 1 math.abs(-2); // 2 math.abs(null); // 0 math.abs(''); // 0 math.abs([]); // 0 math.abs([2]); // 2 math.abs([1,2]); // nan math.abs({}); // nan math.abs('string'); // nan math.abs(); // nan specifications specification ecmascript (ecma-262)the definition of 'math.abs' in that specification.
Math.ceil() - JavaScript
* * @param {string} type the type of adjustment.
... if (isnan(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return nan; } // shift value = value.tostring().split('e'); value = math[type](+(value[0] + 'e' + (value[1] ?
... (+value[1] - exp) : -exp))); // shift back value = value.tostring().split('e'); return +(value[0] + 'e' + (value[1] ?
Math.floor() - JavaScript
* * @param {string} type the type of adjustment.
... if (isnan(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return nan; } // shift value = value.tostring().split('e'); value = math[type](+(value[0] + 'e' + (value[1] ?
... (+value[1] - exp) : -exp))); // shift back value = value.tostring().split('e'); return +(value[0] + 'e' + (value[1] ?
Number.parseFloat() - JavaScript
syntax number.parsefloat(string) parameters string the value to parse.
... if this argument is not a string, then it is converted to one using the tostring abstract operation.
... return value a floating point number parsed from the given string.
Number.prototype.toPrecision() - JavaScript
the toprecision() method returns a string representing the number object to the specified precision.
... return value a string representing a number object in fixed-point or exponential notation rounded to precision significant digits.
... if the precision argument is omitted, behaves as number.prototype.tostring().
Number.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax numobj.tosource() number.tosource() return value a string representing the source code of the object.
... examples native function for the built-in number object, tosource() returns the following string indicating that the source code is not available: function number() { [native code] } for instances of number, tosource() returns a string representing the source code.
Object.prototype.constructor - JavaScript
note that the value of this property is a reference to the function itself, not a string containing the function's name.
... function type () {} let types = [ new array(), [], new boolean(), true, // remains unchanged new date(), new error(), new function(), function () {}, math, new number(), 1, // remains unchanged new object(), {}, new regexp(), /(?:)/, new string(), 'test' // remains unchanged ] for (let i = 0; i < types.length; i++) { types[i].constructor = type types[i] = [types[i].constructor, types[i] instanceof type, types[i].tostring()] } console.log(types.join('\n')) this example displays the following output (comments added for reference): function type() {},false, // new array() function t...
... // 1 function type() {},false,[object object] // new object() function type() {},false,[object object] // {} function type() {},false,/(?:)/ // new regexp() function type() {},false,/(?:)/ // /(?:)/ function type() {},false, // new string() function string() { [native code] },false,test // 'test' changing the constructor of a function mostly this property is used for defining a function as a function-constructor with further calling it with new and prototype-inherits chain.
Object.prototype.hasOwnProperty() - JavaScript
syntax obj.hasownproperty(prop) parameters prop the string name or symbol of the property to test.
...inherited properties the following example differentiates between direct properties and properties inherited through the prototype chain: o = new object(); o.prop = 'exists'; o.hasownproperty('prop'); // returns true o.hasownproperty('tostring'); // returns false o.hasownproperty('hasownproperty'); // returns false iterating over the properties of an object the following example shows how to iterate over the properties of an object without executing on inherited properties.
...value: ' + buz[name]); } else { console.log(name); // tostring or something else } } using hasownproperty as a property name javascript does not protect the property name hasownproperty; thus, if the possibility exists that an object might have a property with this name, it is necessary to use an external hasownproperty to get correct results: var foo = { hasownproperty: function() { return false; }, bar: 'here be dragons' }; foo.hasownprope...
Object.keys() - JavaScript
return value an array of strings that represent all the enumerable properties of the given object.
... description object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object.
... polyfill to add compatible object.keys support in older environments that do not natively support it, copy the following snippet: // from /docs/web/javascript/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(obj) { if (typeof obj !== 'function' && (typeof obj !== 'object' || ...
Object.setPrototypeOf() - JavaScript
does nothing if the prototype parameter isn't an object or null (i.e., number, string, boolean, or undefined).
...* **/ object.appendchain = function(ochain, oproto) { if (arguments.length < 2) { throw new typeerror('object.appendchain - not enough arguments'); } if (typeof oproto !== 'object' && typeof oproto !== 'string') { throw new typeerror('second argument to object.appendchain must be an object or a string'); } var onewproto = oproto, oreturn = o2nd = olast = ochain instanceof this ?
... ochain : new ochain.constructor(ochain); for (var o1st = this.getprototypeof(o2nd); o1st !== object.prototype && o1st !== function.prototype; o1st = this.getprototypeof(o2nd) ) { o2nd = o1st; } if (oproto.constructor === string) { onewproto = function.prototype; oreturn = function.apply(null, array.prototype.slice.call(arguments, 1)); this.setprototypeof(oreturn, olast); } this.setprototypeof(o2nd, onewproto); return oreturn; } usage first example: appending a chain to a prototype function mammal() { this.ismammal = 'yes'; } function mammalspecies(smammalspecies) { this.species = smammalspecies; } mammalspecies.prototype = new mammal(); mammalspecies.prototype.constructor = mammalspecies; var ocat = new mammalspecies('felis'); console.log(oca...
Object.prototype.valueOf() - JavaScript
an object's valueof method is usually invoked by javascript, but you can invoke it yourself as follows: mynumbertype.valueof() note: objects in string contexts convert via the tostring() method, which is different from string objects converting to string primitives using valueof.
... all objects have a string conversion, if only "[object type]".
... examples using valueof on custom types function mynumbertype(n) { this.number = n; } mynumbertype.prototype.valueof = function() { return this.number; }; var myobj = new mynumbertype(4); myobj + 3; // 7 using unary plus +"5" // 5 (string to number) +"" // 0 (string to number) +"1 + 2" // nan (doesn't evaluate) +new date() // same as (new date()).gettime() +"foo" // nan (string to number) +{} // nan +[] // 0 (tostring() returns an empty string list) +[1] // 1 +[1,2] // nan +new set([1]) // nan +bigint(1) // uncaught typeerror: cannot convert a bigint value to a number +undefined // nan +null // 0 +true // 1 +false // 0 specifications specification ecmascript (ecma-262)the definition of 'obj...
RegExp.prototype.source - JavaScript
the source property returns a string containing the source text of the regexp object, and it doesn't contain the two forward slashes on both sides and any flags.
... empty regular expressions and escaping starting with ecmascript 5, the source property no longer returns an empty string for empty regular expressions.
... instead, the string "(?:)" is returned.
RegExp.prototype.sticky - JavaScript
the sticky property reflects whether or not the search is sticky (searches in strings only from the index indicated by the lastindex property of this regular expression).
...the "y" flag indicates that it matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes).
... examples of correct behavior: var regex = /^foo/y; regex.lastindex = 2; regex.test('..foo'); // false - index 2 is not the beginning of the string var regex2 = /^foo/my; regex2.lastindex = 2; regex2.test('..foo'); // false - index 2 is not the beginning of the string or line regex2.lastindex = 2; regex2.test('.\nfoo'); // true - index 2 is the beginning of a line specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.sticky' in that specification.
RegExp.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax regexobj.tosource() return value a string representing the source code of the given regexp object.
... examples native function for the built-in regexp object, tosource() returns the following string indicating that the source code is not available: function regexp() { [native code] } for instances of regexp, tosource() returns a string representing the source code.
Symbol.prototype.description - JavaScript
the read-only description property is a string returning the optional description of symbol objects.
...it is different to symbol.prototype.tostring() as it does not contain the enclosing "symbol()" string.
... examples using description symbol('desc').tostring(); // "symbol(desc)" symbol('desc').description; // "desc" symbol('').description; // "" symbol().description; // undefined // well-known symbols symbol.iterator.tostring(); // "symbol(symbol.iterator)" symbol.iterator.description; // "symbol.iterator" // global symbols symbol.for('foo').tostring(); // "symbol(foo)" symbol.for('foo').description; // "foo" specifications specification ecmascript (ecma-262)the definition of 'get symbol.prototype.description' in that specification.
Symbol.for() - JavaScript
syntax symbol.for(key); parameters key string, required.
... global symbol registry the global symbol registry is a list with the following record structure and it is initialized empty: a record in the global symbol registry field name value [[key]] a string key used to identify a symbol.
... examples using symbol.for symbol.for('foo'); // create a new global symbol symbol.for('foo'); // retrieve the already created symbol // same global symbol, but not locally symbol.for('bar') === symbol.for('bar'); // true symbol('bar') === symbol('bar'); // false // the key is also used as the description var sym = symbol.for('mario'); sym.tostring(); // "symbol(mario)" to avoid name clashes with your global symbol keys and other (library code) global symbols, it might be a good idea to prefix your symbols: symbol.for('mdn.foo'); symbol.for('mdn.bar'); specifications specification ecmascript (ecma-262)the definition of 'symbol.for' in that specification.
Symbol.match - JavaScript
the symbol.match well-known symbol specifies the matching of a regular expression against a string.
... 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.
Symbol.toPrimitive - JavaScript
the function is called with a string argument hint, which specifies the preferred type of the result primitive value.
... the hint argument can be one of "number", "string", and "default".
...var obj2 = { [symbol.toprimitive](hint) { if (hint == 'number') { return 10; } if (hint == 'string') { return 'hello'; } return true; } }; console.log(+obj2); // 10 -- hint is "number" console.log(`${obj2}`); // "hello" -- hint is "string" console.log(obj2 + ''); // "true" -- hint is "default" specifications specification ecmascript (ecma-262)the definition of 'symbol.toprimitive' in that specification.
Symbol.prototype.toSource() - JavaScript
the tosource() method returns a string representing the source code of the object.
... syntax symbol.tosource() var sym = symbol() sym.tosource() return value a string representing the source code of the object.
... examples native function for the built-in symbol object, tosource returns the following string indicating that the source code is not available: "function symbol() { [native code] }" for instances of symbol, tosource returns a string representing the source code.
isNaN() - JavaScript
thus for non-numbers that when coerced to numeric type result in a valid non-nan numeric value (notably the empty string and boolean primitives, which when coerced give numeric values zero or one), the "false" returned value may be unexpected; the empty string, for example, is surely "not a number." the confusion stems from the fact that the term, "not a number", has a specific meaning for numbers represented as ieee-754 floating-point values.
... a polyfill for isnan would be (the polyfill leverages the unique never-equal-to-itself characteristic of nan): var isnan = function(value) { var n = number(value); return n !== n; }; examples isnan(nan); // true isnan(undefined); // true isnan({}); // true isnan(true); // false isnan(null); // false isnan(37); // false // strings isnan('37'); // false: "37" is converted to the number 37 which is not nan isnan('37.37'); // false: "37.37" is converted to the number 37.37 which is not nan isnan("37,5"); // true isnan('123abc'); // true: parseint("123abc") is 123 but number("123abc") is nan isnan(''); // false: the empty string is converted to 0 which is not nan isnan(' '); // false: a string with sp...
...aces is converted to 0 which is not nan // dates isnan(new date()); // false isnan(new date().tostring()); // true // this is a false positive and the reason why isnan is not entirely reliable isnan('blabla'); // true: "blabla" is converted to a number.
unescape() - JavaScript
… the unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.
... syntax unescape(str) parameters str a string to be decoded.
... return value a new string in which certain characters have been unescaped.
uneval() - JavaScript
the uneval() function creates a string representation of the source code of an object.
... return value a string representing the source code of object.
... examples using uneval var a = 1; uneval(a); // returns a string containing 1 var b = '1'; uneval(b); // returns a string containing "1" uneval(function foo() {}); // returns "(function foo(){})" var a = uneval(function foo() { return 'hi'; }); var foo = eval(a); foo(); // returns "hi" specifications not part of any standard.
Iteration protocols - JavaScript
}, [symbol.iterator]: function() { return this; } }; examples using the iteration protocols a string is an example of a built-in iterable object: let somestring = 'hi'; console.log(typeof somestring[symbol.iterator]); // "function" string's default iterator returns the string's code points one by one: let iterator = somestring[symbol.iterator](); console.log(iterator + ''); // "[object string iterator]" console.log(iterator.next()); // { value: "h", done: false } console.log(iterator.next()...
...); // { value: "i", done: false } console.log(iterator.next()); // { value: undefined, done: true } some built-in constructs—such as the spread syntax—use the same iteration protocol under the hood: console.log([...somestring]); // ["h", "i"] you can redefine the iteration behavior by supplying our own @@iterator: // need to construct a string object explicitly to avoid auto-boxing let somestring = new string('hi'); somestring[symbol.iterator] = function () { return { // this is the iterator object, returning a single element (the string "bye") next: function () { return this._first ?
... { value: 'bye', done: (this._first = false) } : { done: true } }, _first: true }; }; notice how redefining @@iterator affects the behavior of built-in constructs that use the iteration protocol: console.log([...somestring]); // ["bye"] console.log(somestring + ''); // "hi" iterable examples built-in iterables string, array, typedarray, map, and set are all built-in iterables, because each of their prototype objects implements an @@iterator method.
Less than (<) - JavaScript
if both values are strings, they are compared as strings, based on the values of the unicode code points they contain.
... strings are converted based on the values they contain, and are converted as nan if they do not contain numeric values.
... examples string to string comparison console.log("a" < "b"); // true console.log("a" < "a"); // false console.log("a" < "3"); // false string to number comparison console.log("5" < 3); // false console.log("3" < 3); // false console.log("3" < 5); // true console.log("hello" < 5); // false console.log(5 < "hello"); // false console.log("5" < 3n); // false console.log("3" < 5n); // true number to number comparison console.log(5 < 3); // false console.log(3 < 3); // false console.log(3 < 5); // true number to bigint comparison console.log(5n < 3); // false cons...
Object initializer - JavaScript
in json the values can only be strings, numbers, arrays, true, false, null, or another (json) object.
... objects like date will be a string after json.parse().
...the values of these keys are a string "bar", the number 42, and another object.
instanceof - JavaScript
examples demonstrating that string and date are of type object and exceptional cases the following code uses instanceof to demonstrate that string and date objects are also of type object (they are derived from object).
... let simplestr = 'this is a simple string' let mystring = new string() let newstr = new string('string created with constructor') let mydate = new date() let myobj = {} let mynonobj = object.create(null) simplestr instanceof string // returns false, string literal is not an object mystring instanceof string // returns true newstr instanceof string // returns true mystring instanceof object // returns true myobj instanceof object // returns true, every object literal has object.prototype as prototype ({}) instanceof object // returns true, same case as above mynonobj instanceof object // returns false, prototype...
... is end of prototype chain (null) mystring instanceof date // returns false mydate instanceof date // returns true mydate instanceof object // returns true mydate instanceof string // returns false demonstrating that mycar is of type car and type object the following code creates an object type car and an instance of that object type, mycar.
new operator - JavaScript
the following code adds a color property with value "original color" to all objects of type car, and then overwrites that value with the string "black" only in the instance object car1.
...then the value of mycar.make is the string "eagle", mycar.year is the integer 1993, and so on.
... car to include an owner property that takes a person object, as follows: function car(make, model, year, owner) { this.make = make; this.model = model; this.year = year; this.owner = owner; } to instantiate the new objects, you then use the following: var car1 = new car('eagle', 'talon tsi', 1993, rand); var car2 = new car('nissan', '300zx', 1992, ken); instead of passing a literal string or integer value when creating the new objects, the above statements pass the objects rand and ken as the parameters for the owners.
for...in - JavaScript
the for...in statement iterates over all enumerable properties of an object that are keyed by strings (ignoring ones keyed by symbols), including inherited enumerable properties.
...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.
... examples using for...in the for...in loop below iterates over all of the object's enumerable, non-symbol properties and logs a string of the property names and their values.
var - JavaScript
so you can just type: function foo() { string('s') // note the function `string` is implicitly visible } ...because globalthis.hasownproperty('string') // true so the global object will ultimately be searched for unqualified identifiers.
... you don't have to type globalthis.string, you can just type the unqualified string.
...e assignment statement is reached: function do_something() { console.log(bar); // undefined var bar = 111; console.log(bar); // 111 } // ...is implicitly understood as: function do_something() { var bar; console.log(bar); // undefined bar = 111; console.log(bar); // 111 } examples declaring and initializing two variables var a = 0, b = 0; assigning two variables with single string value var a = 'a'; var b = a; // ...is equivalent to: var a, b = a = 'a'; be mindful of the order: var x = y, y = 'a'; console.log(x + y); // undefineda here, x and y are declared before any code is executed, but the assignments occur later.
MathML attribute reference - MathML
actiontype <maction> a string value specifying the action happening for this element.
... close <mfenced> a string for the closing delimiter.
... open <mfenced> a string for the opening delimiter.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
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').va...
...lue; fetch('./sendnotification', { 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.
...event.data.text() : 'no payload'; event.waituntil( self.registration.shownotification('serviceworker cookbook', { body: payload, }) ); }); all it does is add a listener for the push event, create the payload variable consisting of the text taken from the data (or create a string to use if data is empty), and then wait until the notification is shown to the user.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
value type: <string> ; default value: none; animatable: no href the url or url fragment the hyperlink points to.
... value type: <string> ; default value: none; animatable: yes ping a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background).
... value type: <string> ; default value: none; animatable: yes xlink:href deprecated since svg 2 the url or url fragment that the hyperlink points to.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
ies, like it uses the href attribute instead of src and it doesn't support ecmascript modules so far (see browser compatibility below for details) html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <script> // <![cdata[ window.addeventlistener('domcontentloaded', () => { function getcolor () { const r = math.round(math.random() * 255).tostring(16).padstart(2,'0') const g = math.round(math.random() * 255).tostring(16).padstart(2,'0') const b = math.round(math.random() * 255).tostring(16).padstart(2,'0') return `#${r}${g}${b}` } document.queryselector('circle').addeventlistener('click', (e) => { e.target.style.fill = getcolor() }) }) // ]]> </script> <circle cx="5" cy="5" r="4" /> </svg> ...
... value type: <string>; default value: ?; animatable: yes href the url to the script to load.
... value type: <string>; default value: application/ecmascript; animatable: no xlink:href deprecated since svg 2 the url to the script to load.
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
value type: <string> ; default value: none; animatable: no contentscripttype deprecated since svg 2 the default scripting language used by the svg fragment.
... value type: <string> ; default value: application/ecmascript; animatable: no contentstyletype deprecated since svg 2 the default style sheet language used by the svg fragment.
... value type: <string> ; default value: text/css; animatable: no height the displayed height of the rectangular viewport.
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
177 requiredfeatures svg, svg attribute the requiredfeatures attribute takes a list of feature strings, with the individual strings separated by white space.
... 201 string deprecated, svg, svg attribute the string attribute is a hint to the user agent, and specifies a list of formats that the font referenced by the parent <font-face-uri> element supports.
... 218 text-anchor svg, svg attribute the text-anchor attribute is used to align (start-, middle- or end-alignment) a string of pre-formatted text or auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point.
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
various presentation attributes don't work (alignment-baseline, baseline-shift, dominant-baseline, kerning, letter-spacing, word-spacing, writing-mode, glyph-orientation-horizontal, glyph-orientation-vertical) recently implemented presentation attributes: direction, unicode-bidi, font-variant, text-decoration svgtextelement recently imlemented bindings: selectsubstring recently implemented attributes: textlength, lengthadjust tspan implemented.
... various presentation attributes don't work (alignment-baseline, baseline-shift, dominant-baseline, kerning, letter-spacing, word-spacing, writing-mode, glyph-orientation-horizontal, glyph-orientation-vertical) recently implemented presentation attributes: direction, unicode-bidi, font-variant, text-decoration svgtspanelement recently implemented bindings: selectsubstring recently implemented attributes: textlength, lengthadjust tref this feature, present in early draft of the spec, has been removed from it and is therefor not implemented (bug 273171).
... recently implemented bindings: selectsubstring altglyph implemented as tspans, no font features as of gecko 2.0 (bug 456286, bug 571808).
format-number - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the format-number function evaluates a number and returns a string representing the number in a given format.
... syntax format-number(number ,pattern [,decimal-format] ) arguments number the number to be formatted pattern a string in the format of the jdk 1.1 decimalformat class.
... returns a string representing the number in the new format.
number - XPath
notes strings are converted to a number by stripping the leading whitespace in the string before the number and ignoring whitespace after the number.
... if the string does not match this pattern, then the string is converted to nan.
... a node-set is first converted to a string as if by a call to the string() function and then converted in the same way as a string argument.
starts-with - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the starts-with checks whether the first string starts with the second string and returns true or false.
... syntax starts-with(haystack, needle) arguments haystack the string to look in.
... needle the string to look for.
system-property - XPath
the argument must evaluate to a string that is a qname.
...if there is no such system property, the empty string should be returned.
... notes xsl:version, a number giving the version of xslt implemented by the processor; for xslt processors implementing the version of xslt specified by this document, this is the number 1.0 xsl:vendor, a string identifying the vendor of the xslt processor xsl:vendor-url, a string containing a url identifying the vendor of the xslt processor; typically this is the host page (home page) of the vendor's web site.
unparsed-entity-url - XPath
syntax string unparsed-entity-url(string) arguments the name of the unparsed entity.
... if the argument is not a string, it is converted using the rules of the string() function.
...otherwise an empty string.
Navigator.mozNotification - Archive of obsolete content
method overview notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional url.
... notification createnotification( in domstring title, in domstring description, in domstring iconurloptional ); parameters title the notification title.
Interacting with page scripts - Archive of obsolete content
in this example a page script adds a string variable foo to the window: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> the content script can see this object if it uses unsafewindow.foo instead of window.foo: // main.js var tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var ...
...ddon-message", true, true, { hello: 'world' }); document.documentelement.dispatchevent(event); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content script "listen.js" listens for the new event and retrieves the payload from its detail attribute: window.addeventlistener("addon-message", function(event) { console.log(json.stringify(event.detail)); }, false); ...
port - Archive of obsolete content
this means that it needs to be a string, number, boolean, null, array of json-serializable values, or an object whose property values are themselves json-serializable.
... for example, to include an array of strings in the payload: // main.js var pagemods = require("sdk/page-mod"); var self = require("sdk/self"); var pagemod = pagemods.pagemod({ include: ['*'], contentscriptfile: self.data.url("content-script.js"), onattach: setuplistener }); function setuplistener(worker) { worker.port.on('loaded', function(pageinfo) { console.log(pageinfo[0]); console.log(pageinfo[1]); }); } //content-script.js self.port.emit('loaded', [ document.location.tostring(), document.title ]); ...
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.
Working with Events - Archive of obsolete content
it takes two parameters: type: the type of event we are interested in, identified by a string.
... for example, the following add-on registers a listener with the tabs module to listen for the ready event, and logs a string to the console reporting the event: var tabs = require("sdk/tabs"); tabs.on("ready", function () { console.log("tab loaded"); }); it is not possible to enumerate the set of listeners for a given event.
system - Archive of obsolete content
var desktoppath = require('sdk/system').pathfor('desk'); parameters id : string the id of the special directory.
... returns string : the path to the directory.
High-Level APIs - Archive of obsolete content
l10n localize strings appearing in the add-on's javascript code.
... private-browsing check whether a given object is private, so an add-on can respect private browsing querystring utility functions for working with query strings.
core/namespace - Archive of obsolete content
} widget.prototype = object.create(view.prototype); widget.prototype.postmessage = function postmessage(message) { let { sandbox } = sandboxes(this); sandbox.postmessage(json.stringify(json.parse(message))); ...
... let { dom } = require('./view'); widget.prototype.setinnerhtml = function setinnerhtml(html) { dom(this).element.innerhtml = string(html); }; ...
frame/utils - Archive of obsolete content
parameters document : nsidomdocument options : object optional options: name type type string string that defines access type of the document loaded into it.
...for more details and other possible values see documentation on mdn uri string uri of the document to be loaded into the new frame.
lang/functional - Archive of obsolete content
in this example, we'll fabricate a function // that takes a string of first and last names that // somehow computes the lineage of that name.
... our hash // function will just parse the last name, as our naive // implementation assumes that they will share the same lineage let getlineage = memoize(function (name) { // computes lineage return data; }, hasher); // hashing function takes a string of first and last name // and returns the last name.
net/url - Archive of obsolete content
parameters uri : string the url, as a string, to load.
... charset string the character set to use when read the content of the uri given.
places/history - Archive of obsolete content
sort string a string specifying how the results should be sorted.
... arguments string : a string indicating the error that occurred.
system/unload - Archive of obsolete content
name : string optional name of the destructor method.
...it is called with a single argument, one of the following strings describing the reason for unload: "uninstall", "disable", "shutdown", "upgrade", or "downgrade".
test/utils - Archive of obsolete content
it has two arguments, or three if it is asynchronous: the first argument is the test's name as a string.
...it has two arguments, or three if it is asynchronous: the first argument is the test's name as a string.
util/deprecate - Archive of obsolete content
parameters fun : function the function to execute after the error message msg : string the error message to display returns * : the returned value from fun deprecateusage(msg) dump to the console the error message given, prefixed with "deprecated:", and print the stacktrace.
... parameters msg : string the error message to display ...
util/list - Archive of obsolete content
parameters element1 : object|string|number element2 : object|string|number ...
... : object|string|number functions addlistitem(list, item) function adds a item to a list.
util/uuid - Archive of obsolete content
generate uuid to generate a new uuid, call uuid() with no arguments: let uuid = require('sdk/util/uuid').uuid(); parsing uuid to convert a string representation of a uuid to an nsid, pass the string representation to uuid(): let { uuid } = require('sdk/util/uuid'); let firefoxuuid = uuid('{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'); globals functions uuid(stringid) generate a new uuid, or convert a string representation of a uuid to an nsid.
... parameters stringid : string string representation of a uuid, such as: "8cbc9bf4-4a16-11e2-aef7-c1a56188709b" optional.
cfx - Archive of obsolete content
-f filename[:testname], --filter=filename[:testname] only run tests whose filenames match filename and optionally match testname, both regexps (test, testall, testex, testpkgs) for example: if you specify --filter data, then cfx will only run tests in those modules whose name contain the string "data".
... the value of --static-args must be a json string.
jpm - Archive of obsolete content
jpm sign accepts the following options: --api-key=jwt_issuer api access key (string) generated on the addons.mozilla.org key management page.
... --api-secret=jwt_secret api access secret (string) generated on the addons.mozilla.org key management page.
Chrome Authority - Archive of obsolete content
this list is generated by scanning all included modules for require(xyz) statements and recording the particular "xyz" strings that they reference.
...developers should stick to simple require statements, with a single static string, one per line of code.
Modifying Web Pages Based on URL - Archive of obsolete content
you can pass a single match-pattern string, or an array.
... keeping the content script in a separate file in the example above, we've supplied content script as a string.
Rosetta - Archive of obsolete content
nt; this.appendcompiler = function (vmimetypes, fcompiler) { if (arguments.length < 2) { throw new typeerror("rosetta.appendcompiler() \u2013 not enough arguments"); } if (typeof fcompiler !== "function") { throw new typeerror("rosetta.appendcompiler() \u2013 second argument must be a function"); } if (!array.isarray(vmimetypes)) { odicts[(vmimetypes).tostring()] = fcompiler; return true; } for (var nidx = 0; nidx < vmimetypes.length; nidx++) { odicts[(vmimetypes[nidx]).tostring()] = fcompiler; } return true; }; })(); now, imagine you need a compiler for scripts written in c (mime type: text/x-c).
...*/ return "alert(\"here you have the c code to be compiled to ecmascript:\\n\\n\" + " + json.stringify(scsrc) + ");"; } rosetta.appendcompiler([ "text/x-csrc", "text/x-c" ], createecmasrc); })(); note: creating a compiler from scratch can be a very difficult task.
View Source for XUL Applications - Archive of obsolete content
the object can include the following properties: url (required) a string url for the document to view the source of.
... the viewsource method will also accept the following arguments in place of the object: aurl a string url for the document to view the source of.
Code snippets - Archive of obsolete content
stringview a library that implements a stringview view for javascript typed arrays.
... this lets you access data in typed arrays using c-like string functions.
Inline options - Archive of obsolete content
setting types there are several types of <setting>s, each with a different type attribute: type attribute displayed as preference stored as bool checkbox boolean boolint checkbox integer (use the attributes on and off to specify what values to store) integer textbox integer string textbox string color colorpicker string (in the #123456 format) file browse button and label string directory browse button and label string menulist menulist dependent on the menu item values radio radio buttons dependent on the radio values control button no pref stored the pref attribute shou...
...nsions.myaddon.bool1" type="bool" title="boolean 1"/> <setting pref="extensions.myaddon.bool2" type="bool" title="boolean 2"> description of boolean 2 </setting> <!-- boolean stored as an integer --> <setting pref="extensions.myaddon.boolint" type="boolint" title="boolean 3" on="1" off="2"/> <!-- integer example --> <setting pref="extensions.myaddon.int" type="integer" title="integer"/> <!-- string examples --> <setting pref="extensions.myaddon.text" type="string" title="text"/> <setting pref="extensions.myaddon.password" type="string" title="password" inputtype="password"/> <!-- color example --> <setting pref="extensions.myaddon.color" type="color" title="color"/> <!-- file and directory examples --> <setting pref="extensions.myaddon.file" type="file" title="file"/> <setting pref="exten...
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.
Appendix D: Loading Scripts - Archive of obsolete content
some known issues include: e4x xml objects cannot be wrapped for passage between compartments: bug 613142 there are a number of type detection issues, including: string.replace does not recognize regexp objects from foreign compartments: bug 633830 debugging: support for sandbox evaluation in development tools is uneven.
... wantxrays: true }); // the script that will be executed: let script = string(); // evaluate the script: components.utils.evalinsandbox(script, sandbox, // the javascript version "1.8", // the apparent script filename: "zz-9://plural/zed/alpha", // the apparent script starting line number: ...
User Notifications and Alerts - Archive of obsolete content
notification boxes are very easy to create, and are very customizable: let nb = gbrowser.getnotificationbox(); let acceptbutton = new object(); let declinebutton = new object(); let message = this._bundle.getstring("xulschoolhello.friendmessage.label"); let that = this; acceptbutton.label = this._bundle.getstring("xulschoolhello.acceptbutton.label"); acceptbutton.accesskey = this._bundle.getstring("xulschoolhello.acceptbutton.accesskey"); acceptbutton.popup = null; acceptbutton.callback = function() { that.acceptrequest(); }; // similarly for decline button.
...on the other hand, alerts are displayed only temporarily using the alerts service is similar to using notification boxes: let alertsservice = cc["@mozilla.org/alerts-service;1"].getservice(ci.nsialertsservice); let title = this._bundle.getstring("xulschoolhello.greeting.title"); let message = this._bundle.getstring("xulschoolhello.greeting.label"); alertsservice.showalertnotification( "chrome://xulschoolhello/skin/hello-notification.png", title, message, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver.
Updating addons broken by private browsing changes - Archive of obsolete content
there is a new download-manager-remove-download-guid notification, which passes an nsisupportscstring subject for the guid or null.
... internalsave: takes a new required document argument (prior to the optional boolean and string arguments) indicating the document that originated the save action.
Getting the page URL in NPAPI plugin - Archive of obsolete content
npidentifier identifier = npn_getstringidentifier( "location" ); // declare a local variant value.
...identifier = npn_getstringidentifier( "href" ); // get the location property from the location object.
Structure of an installable bundle - Archive of obsolete content
the platform string is defined during the toolkit build process to a value unique for the combination of operating system, processor architecture and compiler.
... the format of the platform string is: {os_target}_{target_xpcom_abi} all of the files which are loaded from the main extension directory are loaded from the subdirectory /platform/{platform string} if it exists.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
; // hand over the application to xpcom/xul, this will block: appstartup.run(); here is an example of a locationprovider that works : public class locationprovider implements iappfilelocprovider { private final file libxulpath; int counter = 0; public locationprovider(file grepath) { this.libxulpath = grepath; } public file getfile(string aprop, boolean[] apersistent) { file file = null; if (aprop.equals("gred") || aprop.equals("grecomsd")) { file = libxulpath; if (aprop.equals("grecomsd")) { file = new file(file, "components"); } } else if (aprop.equals("mozbind") || aprop.equals("curprocd") || aprop.equals("comsd") || ...
... aprop.equals("profd")) { file = libxulpath; if (aprop.equals("comsd")) { file = new file(file, "components"); } } return file; } public file[] getfiles(string aprop) { file[] files = null; if (aprop.equals("apluginsdl")) { files = new file[1]; files[0] = new file(libxulpath, "plugins"); } return files; } } calling xpcom ui from another thread appstartup.run() enters the main event loop and will stay there until the application exits.
Twitter - Archive of obsolete content
textstatus is a simple string describing the status.
...textstatus is a simple string describing the type of error.
First run - Archive of obsolete content
the value of firstrunpage must be either a string or e4x xml.
... if the value is a both a string and a valid url, the page at that url becomes your first-run page.
First Run - Archive of obsolete content
the value of firstrunpage must be either a string or e4x xml.
... if the value is a both a string and a valid url, the page at that url becomes your first-run page.
Notifications - Archive of obsolete content
methods show(titlestring, [body as string] iconstring)draws a notification box.
... titlethe head of the notification message.string bodythe message itself.stringfalse iconthe url of an .ico file.string jetpack.notifications.show("hello world"); var mybody = " my first message body on jetpack"; var myicon = "http://www.mozilla.com/favicon.ico"; jetpack.notifications.show({title: "my first message on jetpack", body: mybody, icon: myicon}); ...
Microsummary topics - Archive of obsolete content
createinstance(components.interfaces.nsidomparser); var generatordoc = domparser.parsefromstring(generatortext, "text/xml"); var microsummaryservice = components.classes["@mozilla.org/microsummary/service;1"].
...it sets the value of the header to the string microsummary.
URIs and URLs - Archive of obsolete content
also a string should not be escaped more than once.
... necko will not escape an already escaped character unless forced by a special mask that can be used if it is known that a string is not escaped.
DOM Interfaces - Archive of obsolete content
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.
... parameters documenturl of type domstring - the url of a binding document.
Elements - Archive of obsolete content
an explicit encoding declarations may be present to override the default, for example <?xml version="1.0" encoding="iso-8859-1"?> uri in namespace declarations is an opaque string used to uniquely identify the namespace.
... [editor's note: a forthcoming dom events specification will presumably outline the list of valid keycode strings.] if this attribute is present, then its value must match the keycode field of the dom key event object in order for the handler to fire.
Windows Install - Archive of obsolete content
winreg.setrootkey(winreg.hkey_current_user) ;// current_user subkey = "software\\microsoft\\windows\\currentversion\\runonce" ; winreg.createkey(subkey,""); valname = "ren8dot3"; value = fprogram + "ren8dot3.exe " + ftemp + "ren8dot3.ini"; err = winreg.setvaluestring(subkey, valname, value); } } function prepareren8dot3(listlongfilepaths) { var ftemp = getfolder("temporary"); var fprogram = getfolder("program"); var fren8dot3ini = getwinprofile(ftemp, "ren8dot3.ini"); var binicreated = false; var flongfilepath; var sshortfilepath; if(fren8dot3ini != null) { for(i = 0; i < listlongfilepaths.length; i++) { flongfilep...
...ath = getfolder(fprogram, listlongfilepaths[i]); sshortfilepath = file.windowsgetshortname(flongfilepath); if(sshortfilepath) { fren8dot3ini.writestring("rename", sshortfilepath, flongfilepath); binicreated = true; } } if(binicreated) updatewinreg4ren8dot3() ; } return(0); } // main var srdest; var err; var fprogram; srdest = 449; err = initinstall(prettyname, regname, "6.0.0.2000110801"); logcomment("initinstall: " + err); fprogram = getfolder("program"); logcomment("fprogram: " + fprogram); if(verifydiskspace(fprogram, srdest)) { setpackagefolder(fprogram); err = adddirectory("", "6.0.0.2000110801", "bin", // dir name in jar to extract fprogram, // where to put this file // (returned f...
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.
...you can use a string representing any file on the disk you want to check, and xpinstall will resolve the reference to the partition itself.
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.
... aparameters an optional parameter string that is passed to the executable.
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.
... returns a string with the windows shortname.
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.
... adescription string description for the shortcut to be used as the shortcut name with a .lnk extension (do not include .lnk in the string).
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.
... version an installversion object or a string representing version information in the format "4.1.2.1234".
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.
... version a string representing version information in the format "4.1.2.1234".
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.
... if message is not a string, then it is converted into one and displayed.
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.
... subdirectory a string that specifies the name of a subdirectory.
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.
... subdirectory a string that specifies the name of a subdirectory.
Methods - Archive of obsolete content
methods getstring retrieves a value from a .ini file.
... writestring changes a value in a .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".
... classname usually an empty string.
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".
...var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); var index = 0; var basekey = "software\\mozilla"; while ( (mozillaversion = winreg.enumkeys(basekey,index)) != null ) { logcomment("mozillaversion = " + mozillaversion); subkey = basekey + "\\" + mozillaversion + "\\extensions"; pluginsdir = winreg.getvaluestring ( subkey, "plugins" ); if ( pluginsdir ) logcomment("pluginsdir = " + pluginsdir); else logcomment("no plugins dir for " + basekey + "\\" + mozillaversion); index++; } ...
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".
... returns the value of the key as a string if it succeeded; null if the referenced subkey does not exist.
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".
... returns number value of the specified key or null if there's an error, the value is not found, or the value is not a string.
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.
... value a string representing the value being queried.
Methods - Archive of obsolete content
getvaluestring retrieves the value of a key, when that value is a string.
... setvaluestring sets the value of a key, when that value is a string.
WinReg Object - Archive of obsolete content
typically values in the windows registry are strings.
... to manipulate such values, use the getvaluestring and setvaluestring methods.
XPInstall API reference - Archive of obsolete content
performinstall refreshplugins registerchrome 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 windowsregister...
...server 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 wind...
chromemargin - Archive of obsolete content
« xul reference home chromemargin type: margin string controls the amount of chrome that should be visible on each side of the window.
... the specified string should contain four numbers, separated by commas, indicating the margin in pixels for the top, right, bottom, and left edges of the window, respectively.
color - Archive of obsolete content
« xul reference home color type: color string the currently selected color.
...you can assign a string of the form #rrggbb to this property to change the selected color.
currentset - Archive of obsolete content
« xul reference home currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar.
...the value of this attribute should be a comma-separated list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer".
popup.position - Archive of obsolete content
« xul reference home position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.
... positions specified as a single word string are shortcuts for the values above.
windowtype - Archive of obsolete content
« xul reference home windowtype type: string set to a string which can be used to identify the type of window.
... values for window type as found on mxr: http://mxr.mozilla.org/mozilla-release/search?string=windowtype navigator:browser - looks like if window has gbrowser it has this window type devtools:scratchpad - scratchpad windows navigator:view-source - the view source windows ...
Accessing Files - Archive of obsolete content
retrieving a file when working with files, usage is always done via a file object and not via string paths.
...because string paths are not used, references to files in a file object are made relative to some starting directory.
loadURI - Archive of obsolete content
ArchiveMozillaXULMethodloadURI
the first argument should be a string, not a nsiuri object.
... to get a string from an nsiuri, use nsiuri.spec or nsiuri.asciispec ...
Namespaces - Archive of obsolete content
an uri is any string, although most people choose a url-based uri because urls are an easy way to hope for uniqueness.
... <foo/> the answer is that it's in no namespace, or alternately, it's in the namespace denoted by the empty string: <foo xmlns=""/> this second example is semantically equivalent to the first.
OpenClose - Archive of obsolete content
the openpopup method is defined as follows: void openpopup(in domelement anchorelement, in string position, in long x, in long y, in boolean iscontextmenu, in boolean attributesoverride); first an example: somepopup.openpopup(anchor, "after_start", 0, 0, false, false); this example will open a popup located just underneath another element referenced by 'anchor'.
...in this case, the second argument, the position, is not used, so an empty string can be used.
color - Archive of obsolete content
ArchiveMozillaXULPropertycolor
« xul reference color type: color string the currently selected color.
...you can assign a string of the form #rrggbb to this property to change the selected color.
currentSet - Archive of obsolete content
« xul reference currentset not in seamonkey 1.x type: comma-separated list of strings holds a comma-separated list of the ids of the items currently on the toolbar.
... for spacers, separators, and flexible spacers the following strings are used instead of ids: "spacer", "separator", "spring".
Providing Command-Line Options - Archive of obsolete content
* @param achromeurispec a string specifying the uri of the window to open.
...line.handleflag("myapp", false)) { openwindow(chrome_uri, null); cmdline.preventdefault = true; } }, // changeme: change the help info as appropriate, but // follow the guidelines in nsicommandlinehandler.idl // specifically, flag descriptions should start at // character 24, and lines should be wrapped at // 72 characters with embedded newlines, // and finally, the string should end with a newline helpinfo : " -myapp open my application\n" + " -viewapp <uri> view and edit the uri in my application,\n" + " wrapping this description\n" }; var nsgetfactory = xpcomutils.generatensgetfactory([commandlinehandler]); ...
Sorting and filtering a custom tree view - Archive of obsolete content
for the sake of simplicity, strings are not localized and the data loaded is hard coded.
...for strings, lowercases them function prepareforcomparison(o) { if (typeof o == "string") { return o.tolowercase(); } return o; } function gettopvisiblerow() { return tree.treeboxobject.getfirstvisiblerow(); } function settopvisiblerow(topvisiblerow) { return tree.treeboxobject.scrolltorow(topvisiblerow); } function inputfilter(event) { //do this now rather than doing it at every comparison var...
Result Generation - Archive of obsolete content
nodes in rdf are identified by a string value.
...here we will use strings for the values so they are easier to read.
SQLite Templates - Archive of obsolete content
the example above used a string parameter.
...if no type is specified, a string is assumed.
Simple Query Syntax - Archive of obsolete content
the subject of the binding is the result member resource, the predicate is the string that comes after 'rdf:' and the object isn't necessary as the value is replaced directly in the attribute.
...if one photo doesn't have a title, it will be replaced with an empty string.
XML Assignments - Archive of obsolete content
xpath provides syntax to retrieve this using the built-in string-length method.
...here is an example: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?namelength" expr="string-length(@name)"/> <assign var="?siblings" expr="count(../*) - 1"/> </query> <action> <hbox uri="?" align="center"> <button label="?name"/> <label value="?gender"/> <label value="?namelength"/> <label value="?siblings"/> </hbox> </action> </template> </vbox> two assign elements are placed as children of the query element.
XML Templates - Archive of obsolete content
when a question mark character followed by a string appears in an attribute value, the label value is not directly, but instead the value of an attribute for the source xml is used.
... for each node generated by the xpath expression used in the query, the attribute on the generated xml node is taken and substituted for the question mark and following string.
Accesskey display rules - Archive of obsolete content
if the value is "true" (string), the accesskey text will be appended always.
...if the value is "true" (string), a spece will be inserted before accesskey text.
Additional Install Features - Archive of obsolete content
the text 'file:///' is a special string which means the root of the filesystem.
...the logcomment() function can be used to write a string of text to the log file.
More Event Handlers - Archive of obsolete content
the event handler gets the clientx and clienty properties and creates a string from them.
... this string is then assigned to the value property of the label.
XUL Structure - Archive of obsolete content
the dtd files have a .dtd extension and contain entity declarations, one for each text string that is used in a window.
...the file browser.properties contains a few such localized strings.
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.
... var suggestions = {}; gspellcheckengine.suggest("kat", suggestions, {}); if (suggestions.value) { // suggestions.value is a javascript array of strings // there were suggestions.value.length suggestions found } ...
XULBrowserWindow - Archive of obsolete content
method overview boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden.
... boolean hidechromeforlocation( in string alocation ); parameters alocation the url to check to see if chrome should be hidden while that location is displayed.
XUL Reference - Archive of obsolete content
item menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel stringbundle stringbundleset tab tabbrowser (firefox-only starting with firefox 3/gecko 1.9) tabbox tabpanel tabpanels tabs template textnode textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecel...
...ichlistbox richlistitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack 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 ...
XML - Archive of obsolete content
all strings must be double quoted.
... all of the values for all of the attributes declared in xul are strings.
assign - Archive of obsolete content
for more information, see xml_assignments attributes expr, var examples (example needed) attributes expr type: string for xml queries, an xpath expression which returns results.
... var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name".
binding - Archive of obsolete content
e, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties object type: string the object of the element.
... subject type: string the subject of the element.
bindings - Archive of obsolete content
, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width object type: string the object of the element.
... subject type: string the subject of the element.
command - Archive of obsolete content
label type: string the label that will appear on the element.
... reserved type: string this attribute applies to a command element.
datepicker - Archive of obsolete content
value type: string the initial value of the datepicker in the form yyyy-mm-dd.
... value type: string the currently selected date in the form yyyy-mm-dd.
dialogheader - Archive of obsolete content
for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description type: string descriptive text to appear in addition to the dialog title.
... title type: string the text to appear in the title bar of the window.
editor - Archive of obsolete content
editortype="html" src="about:blank" flex="1" type="content-primary"/> once editable, the document can have special formatting and other html pieces added to it using the document.execcommand method: var editor = document.getelementbyid("myeditor"); // toggle bold for the current selection editor.contentdocument.execcommand("bold", false, null); see the midas overview for more command strings.
... type type: string if set to the string content-primary, this editor becomes the primary content for the page.
listcell - Archive of obsolete content
label type: string the label that will appear on the element.
... type type: string this attribute is reserved for use by anonymous children of listitem; do not use.
notificationbox - Archive of obsolete content
this should be either a string, or, from gecko 37 onwards, you can pass a documentfragment with rich content as well.
... type - a string.
param - Archive of obsolete content
ArchiveMozillaXULparam
name type: string the name of a parameter within the sql statement.
... type type: one of the values below the type of the parameter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value properties 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(), compar...
preferences - Archive of obsolete content
examples <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> <preference id="pref_two" name="extensions.myextension.two" type="string"/> ...
... void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element.
prefpane - Archive of obsolete content
label type: string the label that will appear on the element.
... label type: string gets and sets the value of the label attribute.
progressmeter - Archive of obsolete content
mode type: string gets and sets the value of the mode attribute.
... value type: string gets and sets the value of the value attribute.
radiogroup - Archive of obsolete content
value type: string the string attribute allows you to associate a data value with an element.
... value type: string gets and sets the value of the value attribute.
scale - Archive of obsolete content
ArchiveMozillaXULscale
value type: string the string attribute allows you to associate a data value with an element.
... value type: string gets and sets the value of the value attribute.
<statusbarpanel> - Archive of obsolete content
label type: string the label that will appear on the element.
... label type: string gets and sets the value of the label attribute.
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
tooltiptextnew not in firefox type: string used to set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row.
... value type: string gets and sets the value of the value attribute.
template - Archive of obsolete content
attributes container, member examples (example needed) attributes container type: string may optionally be set to the variable to use as the container or reference variable.
... member type: string may optionally be set to the variable to use as the member variable.
tree - Archive of obsolete content
ArchiveMozillaXULtree
seltype type: string gets and sets the value of the seltype attribute.
... selstyle type: string if set to the value primary, only the label of the primary column will be highlighted when an item in the tree is selected.
treecell - Archive of obsolete content
label type: string the label that will appear on the element.
... value type: string the string attribute allows you to associate a data value with an element.
treecol - Archive of obsolete content
label type: string the label that will appear on the element.
... width type: string (representing an integer) the preferred width of the tree column.
treeitem - Archive of obsolete content
label tipo: string (concatenación de caracteres) para un árbol tree con columnas simples, la etiqueta puede ser colocada directamnete sobre el elemeto "treeitem" sin la necesidad de una fila "row" y un elemento "treeitem" dentro.
... uri type: string for template-generated content, the attribute should be placed on the element where content generation should begin.
triple - Archive of obsolete content
attributes object, predicate, subject examples (example needed) attributes object type: string the object of the element.
... subject type: string the subject of the element.
Deploying XULRunner - Archive of obsolete content
here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutable</key> <string>xulrunner</string> <key>cfbundlegetinfostring</key> <string>1.0</string> <key>cfbundleiconfile</key> <string>app_icon.icns</string> <key>cfbundleidentifier</key> <string>net.yourcompany.yourapplication</string> <key>cfbundleinfodictionaryversion</key> <string>6.0</string> <key>cfbundlename</key> <string>applicationname</string> <...
...key>cfbundlepackagetype</key> <string>appl</string> <key>cfbundleshortversionstring</key> <string>1.0</string> <key>cfbundlesignature</key> <string>????</string> <!--only useful if your app handle urls--> <key>cfbundleurltypes</key> <array> <dict> <key>cfbundleurliconfile</key> <string>app_icon.icns</string> <key>cfbundleurlname</key> <string>yourapp entity</string> <key>cfbundleurlschemes</key> <array> <string>chrome</string> </array> </dict> </array> <key>cfbundleversion</key> <string>1.0</string> </dict> </plist> here's a sample of the pkginfo file aapl????
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.l10n - december 1, 2006 announcements langpacks for sunbird nightly builds available for testing langpacks for sunbird nightly builds available for testing seamonkey 1.1 late string changes for mail content policy the fix to bug 360288 has landed.
... thunderbird options dialog string changes a lot of string changes to the thunderbird options dialog was landed.
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.
... npidentifiers are unique, in that for any given string or integer, there is only one npidentifier.
NPN_Enumerate - Archive of obsolete content
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.
... note: the caller must call npn_memfree() on the pointer received through the identifiers parameter of a successful call to npn_enumerate to release the array of string identifiers when it is no longer needed.
SAX - Archive of obsolete content
// don't care }, endprefixmapping: function(prefix) { // don't care }, // nsisupports queryinterface: function(iid) { if(!iid.equals(components.interfaces.nsisupports) && !iid.equals(components.interfaces.nsisaxcontenthandler)) throw components.results.ns_error_no_interface; return this; } }; start parsing the xml reader component can parse xml from a string, an nsiinputstream, or asynchronously via the nsistreamlistener interface.
... below is an example of parsing from a string: xmlreader.parsefromstring("<f:a xmlns:f='g' d='1'><bbq/></f:a>", "text/xml"); this call results in the following output (assuming the content handler from the example above is used): startdocument startelement: namespace='g', localname='a', qname='f:a', attributes={d='1'} startelement: namespace='', localname='bbq', qname='bbq', attributes={} endelement: namespace='', localname='bbq', qname='bbq' endelement: namespace='g', localname='a', qname='f:a' enddocument ...
Introduction to Public-Key Cryptography - Archive of obsolete content
for comprehensive information about dns, see a string representation of distinguished names] at the following url: https://www.ietf.org/rfc/rfc1485.txt a typical certificate every x.509 certificate consists of two sections: the data section includes the following information: the version number of the x.509 standard supported by the certificate.
...if you want to get a commercial license for an eighteen-wheeler, the requirements are much more stringent.
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.
...serializing one of the most powerful tools of e4x is its ability to serialize an entire xml document (or portion thereof) into a string with one simple call to .toxmlstring() var element1 = <foo/>; var element2 = <bar/>; element1.appendchild(element2); element1.toxmlstring(); this will print <foo> <bar/> </foo> calling tostring() will achieve the same effect in this case, though calling tostring() on an element with only text content will product the text content (e.g., <foo>abc</foo>.tostring(); will simply provide 'abc...
Namespaces - Archive of obsolete content
info.uri; // returns "http://www.w3.org/1999/xhtml" elements in no namespace return the empty string as their uri.
...namespace differs in its tostring method, and in that it has a prefix property instead of a localname property.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
ecmascript 2016 array.prototype.includes() (firefox 43) typedarray.prototype.includes() (firefox 43) exponentiation operator (firefox 52) ecmascript 2017 object.values() (firefox 47) object.entries() (firefox 47) string.prototype.padstart() (firefox 48) string.prototype.padend() (firefox 48) object.getownpropertydescriptors() (firefox 50) async functions async function (firefox 52) async function expression (firefox 52) asyncfunction (firefox 52) await (firefox 52) trailing commas in function parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (...
... global_objects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) regexp unicode property escapes (not yet implemented; in other browsers) regexp named capture groups (not yet implemented; in other browsers) ecmascript 2019 array.flat() (firefox 62) array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trimend() (firefox 61) optional catch binding (firefox 58) function.tostring() revision (firefox 54) symbol.description (firefox 63) well-formed json.stringify() (firefox 64) ecmascript 2020 this is the current es.next version.
Enumerator - Archive of obsolete content
example the following code shows the usage of the enumerator object: var bytespergb = 1024 * 1024 * 1024; var fso = new activexobject("scripting.filesystemobject"); document.write(fso.drives); var e = new enumerator(fso.drives); var drivestring = ""; e.movefirst(); while (e.atend() == false) { var drv = e.item(); drivestring += drv.path + " - "; if (drv.isready){ var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; drivestring += freegb.tofixed(3) + " gb free of "; drivestring += totalgb.tofixed(3) + " gb"; } else{ drivestring += "not ready"; ...
... } drivestring += "<br />";; e.movenext(); } document.write(drivestring); // output: <drive information properties the enumerator object has no properties.
New in JavaScript 1.6 - Archive of obsolete content
several new features were introduced: e4x, several new array methods, and array and string generics.
... array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug in which arguments[n] cannot be set if n is greater than the number of formal or actual parameters has been fixed.
ECMAScript 5 support in Mozilla - Archive of obsolete content
string.trim() method, which trims whitespace from both ends of the string.
... gecko 1.9.1.4 updated the implementation of json.stringify() to be compliant with ecmascript 5.
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.
... syntax obj.eval(string) parameters string any string representing a javascript expression, statement, or sequence of statements.
LiveConnect - Archive of obsolete content
the reimplementation also restores the ability to use try-catch exceptions within javascript, and is free of the increasing number of other bugs introduced by the decline of the original liveconnect (e.g., java.lang.string and arrays not working properly).
...by writing code like "new java.lang.string('javascript string')" for classes in the java.* package hierarchy, or using a new "packages" object for classes outside this hierarchy).
XForms Custom Controls Examples - Archive of obsolete content
howing 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"> <f...
... var val = this.stringvalue; var newdom = this.domparser.parsefromstring(val, "text/xml"); var impnode = document.importnode(newdom.firstchild, true); // get content node, clean it, and update it var content = document.getanonymouselementbyattribute(this, "anonid", "content"); if (content.firstchild) { content.removechild(content.firstchild); } content.appendchild(impnode); return true; </body> </method> </implementation> </binding> ...
Mozilla XForms User Interface - Archive of obsolete content
for example, a xforms input control may appear as a text field or as a datepicker depending on whether it is bound to a xsd:string type or a xsd:date type.
...usually bound to data that can be well-represented by a string (see the spec).
bootstrap.js - Extensions
function startup(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// app_startup /// addon_enable /// addon_install /// addon_upgrade /// addon_downgrade } function shutdown(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// st...
...ring version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// app_shutdown /// addon_disable /// addon_uninstall /// addon_upgrade /// addon_downgrade } function install(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// addon_install /// addon_upgrade /// addon_downgrade } function uninstall(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri ///...
Async scripts for asm.js - Game development
what if your code is in a js string?
... instead of using eval or innerhtml, both of which trigger synchronous compilation, you should use a blob with an object url: var blob = new blob([codestring]); var script = document.createelement('script'); var url = url.createobjecturl(blob); script.onload = script.onerror = function() { url.revokeobjecturl(url); }; script.src = url; document.body.appendchild(script); the setting of src rather than innerhtml is what makes this script async.
Identifier - MDN Web Docs Glossary: Definitions of Web-related terms
an identifier differs from a string in that a string is data, while an identifier is part of the code.
... in javascript, there is no way to convert identifiers to strings, but sometimes it is possible to parse strings into identifiers.
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects).
... (date objects by default serialize to a string containing the date in iso format, so the information isn't completely lost.) if you need json to represent additional data types, transform values as they are serialized or before they are deserialized.
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
public static void main(string[] args) the public keyword is an access modifier and indicates that this method can be called by any object.
... the method accepts one parameter of type string array.
Type - MDN Web Docs Glossary: Definitions of Web-related terms
for example, a boolean data type can hold only a true or false value at any given time, whereas a string has the ability to hold a string or a sequence of characters, a number can hold numerical values of any kind, and so on.
...for example, a value of type number can be multiplied by another number, but not by a string - even if that string contains only a number, such as the string "2".
Accessible multimedia - Learn web development
chapter titles — chapter markers intended to help the user navigate the media resource implementing html5 video text tracks text tracks for displaying with html5 video need to be written in webvtt, a text format containing multiple strings of text along with metadata such as what time in the video you want each text string to be displayed, and even limited styling/positioning information.
... these text strings are called cues.
What are hyperlinks? - Learn web development
links can correlate any text string with a url, such that the user can instantly reach the target document by activating the link.
... deeper dive as we said, a link is a text string tied to a url, and we use links to allow easy jumping from one document to another.
Basic native form controls - Learn web development
the coordinates are sent as two key/value pairs: the x value key is the value of the name attribute followed by the string ".x".
... the y value key is the value of the name attribute followed by the string ".y".
Images in HTML - Learn web development
key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
...key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.onke...
Video and audio content - Learn web development
note: "transcribe" means "to write down spoken words as text." the resulting text is a "transcript." webvtt is a format for writing text files containing multiple strings of text along with metadata such as the time in the video at which each text string should be displayed, and even limited styling/positioning information.
... these text strings are called cues, and there are several kinds of cues which are used for different purposes.
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes no (unless it is the same one) no code example the following function creates a new date() object, extracts a time string out of it using tolocaletimestring(), and then displays it in the ui.
... we then run it once per second using setinterval(), creating the effect of a digital clock that updates once per second (see this live, and also see the source): function displaytime() { let date = new date(); let time = date.tolocaletimestring(); document.getelementbyid('demo').textcontent = time; } const createclock = setinterval(displaytime, 1000); pitfalls the frame rate isn't optimized for the system the animation is running on, and can be somewhat inefficient.
Build your own function - Learn web development
type the following in your browser's javascript console, on any page you like: alert('this is a message'); the alert function takes a single argument — the string that is displayed in the alert box.
... try varying the string to change the message.
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.
... both of these take three properties in their basic usage: the text string to draw and the x and y coordinates of the point to start drawing the text at.
Inheritance in JavaScript - Learn web development
in this example, we've used template literals rather than string concatenation to make the code easier to read.
...whenever you use various features of a web api , or methods/properties defined on a built-in browser object that you call on your strings, arrays, etc., you are implicitly using inheritance.
Test your skills: JSON - Learn web development
the json is loaded into the page as a text string and made available in the catstring parameter of the displaycatinfo() function, called when the provided promise chain (which starts by fetching the json data) is fulfilled.
... you'll probably want to use an outer loop to loop through the cats and add their names to the motherinfo variable string, and an inner loop to loop through all the kittens, add up the total of all/male/female kittens, and add those details to the kitteninfo variable string.
JavaScript — Dynamic client-side scripting - Learn web development
after that, we discuss some key javascript features in detail, such as variables, strings, numbers and arrays.
... introducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis built on top of javascript.
Server-side web frameworks - Learn web development
every "view" function (a request handler) receives an httprequest object containing request information, and is required to return an httpresponse object with the formatted output (in this case a string).
... # return httpresponse return httpresponse('output string to return') route requests to the appropriate handler most sites will provide a number of different resources, accessible through distinct urls.
Getting started with React - Learn web development
you should see something like this logged: object { subject: "clarice" } the object property subject corresponds to the subject prop we added to our <app /> component call, and the string clarice corresponds to its value.
...change the subject constant so that, instead of defining it as the string react, you are reading the value of props.subject.
Command line crash course - Learn web development
note: to run a command with multiple options at the same time, you can usually put them all in a single string after the dash character, for example ls -lah, or ls -ltrh.
... let’s say you had 1000 text files in a directory, and you wanted to go through them all and only delete the ones that have a certain substring inside the filename.
Mozilla’s UAAG evaluation report
we use 16 bit strings, not sure about utf-16 6.8 dom css access.
...does not highlight selected images we do not have the ability to show a border around the text selection we have the following focus appearance prefs that are not exposed in the ui, but can be manually inserted in the user's prefs.js file: setboolpref("browser.display.use_focus_colors", usefocuscolors); /* true or false */ setcharpref("browser.display.focus_background_color", colorstring); /* for example #ffeedd or the name of a color */ setcharpref("browser.display.focus_text_color", colorstring); setcharpref("browser.display.focus_ring_width", numpixels); /* integer 0-4 */ 10.3 distinct default highlight styles.
Debugging on Windows
here are some entries that will make your life easier: ;; mozilla (1.7beta and later) nsautostring=<mdata,su> nsstring=<mdata,su> nscstring=<mdata,s> nscautostring=<mdata,s> nsrect=x=<x,d> y=<y,d> width=<width,d>; height=<height,d> nsstaticatomwrapper=<mstaticatom->mstring,s> nsiatom=<mstring,su> ; the following are not necessary in vc8 nscomptr<*>=<mrawptr,x> nsrefptr=<mrawptr,x> nsautoptr=<mrawptr,x> after you have made the changes and saved the file, you will need to restart visual c++ fo...
... for xpcom strings (the "external" string api) you can use the following values: ;; mozilla (1.9) ; internal strings nsastring_internal=<mdata,su>, length=<mlength,u> nsacstring_internal=<mdata,s>, length=<mlength,u> ; xpcom strings nsastring=<nsstringcontainer.v,su>, length=<nsstringcontainer.d1,u> nsacstring=<nscstringcontainer.v,s>, length=<nscstringcontainer.d1,u> nsstringcontainer=<v,su>, length=<d1,u> nscstringcontainer=<v,s>, length=<d1,u> there is a more extensive version of this file in progress in autoexpforvc8.
Storage access policy: Block cookies from trackers
return an empty string for calls to document.cookie and ignore requests to set cookies via document.cookie.
... if the preference does not exist, click "string" and then "+" to create a new preference.
mozbrowsererror
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: type a domstring representing the type of error that occurred.
mozbrowserfindchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: active a boolean indicating whether a search is currently active (true), or not (false.) searchstring a domstring representing the string that is currently being searched for.
mozbrowserloadend
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: backgroundcolor a domstring representing the main background color of the browser <iframe> content, expressed as an rgb value.
mozbrowserlocationchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: url a domstring representing the url of the new location.
mozbrowseropentab
a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: url a domstring representing the url of the new document loaded.
mozbrowserscrollviewchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of scrolling in the viewport — available values are started and stopped.
mozbrowsertitlechange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail read only string the title of the document.
HTTP Cache
storage and entries scopes a scope key string used to map the storage scope is based on the arguments of nsiloadcontextinfo.
...then this entries hashtable is searched using <enhance-id:><uri> string.
IPDL Best Practices
consider the following protocol: async protocol pasyncquerier { child: pasyncquery(); } async protocol pasyncquery { child: kickoffquery(nsstring query); parent: returnresult(nsstring result); __delete__(); } in this situation, there is a guaranteed sequence of messages that will be sent.
... it makes sense to fold construction and the first message together, as well as the penultimate and deletion messages, so that the final protocol looks like this: async protocol pasyncquerier { child: pasyncquery(nsstring query); } async protocol pasyncquery { parent: __delete__(nsstring result); } ...
IPDL Type Serialization
return false if deserialization failed } }; } // namespace ipc the standard ipdl types (integers, floats, and xpcom strings) already have serializers.
...most structures can be serialized in this manner: struct examplestruct { int i; nscstring j; int k[4]; }; namespace ipc { template <> struct paramtraits<examplestruct> { typedef examplestruct paramtype; static void write(message* amsg, const paramtype& aparam) { writeparam(amsg, aparam.i); writeparam(amsg, aparam.j); for (int i = 0; i < 4; ++i) writeparam(amsg, aparam.k[i]); } static bool read(const message* amsg, void** aiter, paramtype* aresult) { if (!readparam(amsg, aiter, &(aresult->i)) || !readparam(amsg, aiter, &(aresult->j))) return false; for (int i = 0; i < 4; ++i) if (!read...
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.
...(the property could have been implemented as ["class"'] but that just looks silly.) xul also maps the hidden and collapsed attributes to properties, but note that these are boolean properties whereas the above list are all string properties.
AddonAuthor
represents a creator, developer, contributor or translator of an add-on attributes attribute type description name string the name of the person.
... url optional string an optional url with details about the person.
AddonListener
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.
... only applies to the following properties: applybackgroundupdates void onpropertychanged( in addon addon, in string properties[] ) parameters addon the addon that has had its properties changed properties an array of the names of properties that changed.
AddonType
properties attribute type description id string the unique id for the type.
... name string the localized name for the type.
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.
... void addblocker( in string name, in function|promise|* condition, optional in function info ) arguments name the human-readable name of the blocker.
Download
contenttype string the mime type of the download, for example "text/plain", or null if the mime type is not available.
... launcherpath string local file path of the application to be used to launch the target file, or null if the file should be launched with the default application associated with the contenttype property or the extension of the target file.
DownloadSource
properties attribute type description url read only string the uri for the download source.
... referrer read only string referrer uri of the download source, or null if no referrer should be sent or the download source is not http.
DownloadTarget
path read only string the path of the target file.
... partfilepath read only string the path of the ".part" file containing the data downloaded so far, or null to disable the use of a ".part" file to keep partially downloaded data.
Bootstrapping a new locale
--> after the localization notes, you will see a list of <!entity> strings like the following: <!entity certerror.pagetitle "untrusted connection"> you should go through each entity, translating the value in the parameters (e.g.
... untrusted connection in the example above), like so (example for polish): <!entity certerror.pagetitle "niezaufane połączenie"> once you have translated all the <!entity> strings in this file, you should save your work and open the next .dtd or .property file.
Localizing extension descriptions
each has at least one em:locale property marking the locale that the information should be used for and then all the various strings for the locale.
... add the following line to it (where extension_id matches your application id from install.rdf and path_to_localization_file is the chrome path to the localization file you added to earlier): pref("extensions.extension_id.description", "path_to_localization_file"); localizable strings the following add-on metadata can be localized using this process: name description creator homepageurl localizable lists in cases where multiple values can exist, a numeric index is appended to the end of the preference name: extensions.extension_id.contributor.1=first_localized_contributor_name extensions.extension_id.contributor.2=second_localized_contributor_name extensions.extens...
QA phase
enter the following command: $ hg log -l 1 you should see an output similar to the one below: changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings now compare the local repository on your machine with the remote hg repository by entering this command: $ hg outgoing http://hg.mozilla.org/l10n-central/x-testing the hg outgoing command compares the two repositories and lists all changesets that are present locally, but not in the remote repository.
...you can expect to see output like this: comparing with http://hg.mozilla.org/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings let's now push this changeset.
Release phase
here's how that's done: run this command to see recent commits in your local clone: $ hg log -l 3 you should a list of the most recent commits, similar to this one: changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings now run the hg outgoing command to compare the local repository on your machine with the remote repository on hg.mozilla.org.
...the output will look something like this: comparing with ssh://hg.mozilla.org/releases/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings make sure this output is accurate before continuing.
Translation phase
this tool includes workspaces for translating strings, reviewing string submissions, and project dashboards.
...see the list of the most critical strings for localizing in firefox, as well as a guide to understanding how they're organized.
Creating localizable web content
text content check that the text is factually correct for an international audience (e.g., mentions of en-us specific product pieces like specific search engines or dictionary should be adapted) look for strings that are likely hard to translate because they are unclear, use play on words or colloquialisms.
... depending on context, find alternate strings or document an explanation of the string for localizers check that we don't link in new pages to sub-pages with anchors.
Localization formats
(it should be noted that this is near impossibility since most sites will be set up with gettext support.) .lang files can be easily edited in a text editor with this setup, a localizer is given a "[something].lang" file containing all the strings needing localization.
..." "allez-y et montrez-le en téléchargeant et en imprimant votre " "certificat personnalisé firefox 3 download day." advantages of gettext gettext has very powerful tools to update this site (if you use the actual english strings in msgids, not unique identifier strings like certificate_intro) very established with a large set of powerful tools harder to screw things up because existing tools will not allow localizers to edit the l10n file where they shouldn't separates localizable strings available for localizers for the rest of the code, protecting it from unintended changes disadvantage of gettext .po file nee...
Setting up the infrastructure
copy the shell scripts from /addons/trunk/site/app/locale/ to your locale directory: extract-po.sh will be used to extract all english strings from your application's directories specified in source_dirs, merge the resulting template (*.pot) file with the existing (already containing translations) messages.po files for each locale (if they exist) and merge the new messages.po files to messages.mo files.
... stats-po.sh will give you a bird's-eye view on the statistics of translated, fuzzy and missing strings for each locale.
BloatView
for nsstring you'll see the size of the header struct, not the size of the string contents!) bytes leaked - the number of bytes per instance times the number of objects leaked: (bytes per-inst) x (objects rem).
... byte bloats name file date blank blank.txt tue aug 29 14:17:40 2000 mozilla mozilla.txt tue aug 29 14:18:42 2000 yahoo yahoo.txt tue aug 29 14:19:32 2000 netscape netscape.txt tue aug 29 14:20:14 2000 the numbers do not include malloc 'd data such as string contents.
DMD
identifier is a string that will be used for part of the filename (or a timestamp will be used if it is an empty string); anonymize is a boolean that indicates if the memory reports should be anonymized; and minimize is a boolean that indicates if memory usage should be minimized first.
...void const*), unsigned long*, unsigned long*, unsigned long*, unsigned long*, unsigned long*) const (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3029) 0x7f6860fdb6b1 #05: cyclecollectormultireporter::collectreports(nsimemorymultireportercallback*, nsisupports*) (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3075) 0x7f6860fde432 #06: nsmemoryinfodumper::dumpmemoryreportstofileimpl(nsastring_internal const&) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:626) 0x7f6860fece79 #07: nsmemoryinfodumper::dumpmemoryreportstofile(nsastring_internal const&, bool, bool) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:344) 0x7f6860febaf9 #08: mozilla::(anonymous namespace)::dumpmemoryreportsrunnable::run() (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:58) 0x7f6860fefe03 } ...
Gecko Profiler FAQ
to stop the profiler from gathering more samples after the “startup end” marker that you’re interested in, you can call services.profiler.pause(); or you can insert a marker with a special string and then write a script that filters out all samples that were gathered after your marker.
... this mode is usually recommended when you want to find a thread you want to do more focused profiling on, so that you can find its name and then construct a more useful thread filter string based on the found thread name.
Profiling with the Firefox Profiler
*/ ); ' -f ./run.js -e ' var profileobj = profiler.getprofiledata(); print(json.stringify(profileobj)); ' | tail -n 1 > run.cleo the xpcshell output all benchmark information and on its last line it output the result of the profiling, you can filter it with tail -n 1 and redirect it to a file to prevent printing it in your shell.
...thread names are the strings passed to the base::thread class at initialization.
PLHashComparator
pl_comparestrings compare two character strings using strcmp.
... see also pl_comparestrings, pl_comparevalues ...
PL_strlen
returns the length of a specified string (not including the trailing '\0') syntax pruint32 pl_strlen(const char *str); parameter the function has these parameter: str size in bytes of item to be allocated.
... returns if successful, the function returns length of the specified string.
PRDescIdentity
a string may be associated with a layer when the layer is created.
... the string is copied by the runtime, and pr_getnameforidentity returns a reference to that copy.
PR_GetLibraryName
syntax #include <prlink.h> char* pr_getlibraryname ( const char *dir, const char *lib); parameters the function has these parameters: dir a null-terminated string representing the path name of the library, as returned by pr_getlibrarypath.
... returns if successful, returns a new character string containing a constructed path name.
PR_NOT_REACHED
syntax #include <prlog.h> void pr_not_reached(const char *_reasonstr); parameters the macro has this parameter: reasonstr a string that describes why you should not have reached this statement.
... returns nothing description this macro writes the specified reason string to the log and terminates the application.
PR_SetErrorText
if not null, and if text is zero, the string is assumed to be a null-terminated c string.
... otherwise the text is assumed to be the length specified and to possibly include null characters (as might occur in a multilingual string).
PR_cnvtf
converts a floating point number to a string.
... description pr_cnvtf is a simpler interface to convert a floating point number to a string.
Encrypt Decrypt MAC Keys As Session Objects
v = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_heade...
... * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char *) "mac key"; secitem enckeyid = { siasciistring, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siasciistring, mackeyid, pl_strlen(mackeyid) }; secitem encckaid; secitem macckaid; unsigned char iv[blocksize]; secitem ivitem; pk11symkey *enckey = null; pk11symkey *mackey = null; secitem temp; unsigned char c; /* generate ...
Encrypt and decrypt MAC using token
v = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_heade...
... * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char *) "mac key"; secitem enckeyid = { siasciistring, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siasciistring, mackeyid, pl_strlen(mackeyid) }; secitem encckaid; secitem macckaid; unsigned char iv[blocksize]; secitem ivitem; pk11symkey *enckey = null; pk11symkey *mackey = null; secitem temp; unsigned char c; /* generate ...
4.3 Release Notes
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.
... to obtain the version info from the jar file use, "system.out.println(org.mozilla.jss.cryptomanager.jar_jss_version)" and to check the shared library: strings libjss4.so | grep -i header feedback bugs discovered should be reported by filing a bug report with bugzilla.
Encrypt Decrypt_MAC_Using Token
v = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_heade...
... * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char *) "mac key"; secitem enckeyid = { siasciistring, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siasciistring, mackeyid, pl_strlen(mackeyid) }; secitem encckaid; secitem macckaid; unsigned char iv[blocksize]; secitem ivitem; pk11symkey *enckey = null; pk11symkey *mackey = null; secitem temp; unsigned char c; /* generate ...
NSS Sample Code Sample_3_Basic Encryption and MACing
macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * write to header file */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_heade...
... * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char *) "mac key"; secitem enckeyid = { siasciistring, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siasciistring, mackeyid, pl_strlen(mackeyid) }; secitem encckaid; secitem macckaid; unsigned char iv[blocksize]; secitem ivitem; pk11symkey *enckey = null; pk11symkey *mackey = null; secitem temp; unsigned char c; /* generate ...
NSS Sample Code Utilities_1
column != level) { newline(out); } } /* * getdigit */ int getdigit(char c) { if (c == 0) { return -1; } if (c <= '9' && c >= '0') { return c - '0'; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } return -1; } /* * hextobuf */ int hextobuf(unsigned char *instring, secitem *outbuf, prbool ishexdata) { int len = strlen(instring); int outlen = len+1/2; int truelen = 0; int digit1, digit2; outbuf->data = ishexdata ?
... port_alloc(outlen) : port_alloc(len); if (!outbuf->data) { return -1; } if (ishexdata) { while (*instring) { if ((*instring == '\n') || (*instring == ':')) { instring++; continue; } digit1 = getdigit(*instring++); digit2 = getdigit(*instring++); if ((digit1 == -1) || (digit2 == -1)) { port_free(outbuf->data); outbuf->data = null; return -1; } outbuf->data[truelen++] = digit1 << 4 | digit2; } } else { while (*instring) { if (*instring == '\n') { instring++; continue; } outbuf->data[truelen++] = *instr...
EncDecMAC using token object - sample 3
ed int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case symkey: strcpy(header, enckey_header); strcpy(trailer, enckey_trailer); break; case mackey: strcpy(header, mackey_header); strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(trailer, iv_trailer); break; case mac: strcpy(header, mac_header); strcpy(trailer, mac_trailer); break; case pad: strcpy(header, pad_header); strcpy(trailer, pad_tr...
...rypt it using cbc, using previously created iv, * store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char *) "mac key"; secitem enckeyid = { siasciistring, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siasciistring, mackeyid, pl_strlen(mackeyid) }; secitem encckaid; secitem macckaid; unsigned char iv[blocksize]; secitem ivitem; pk11symkey *enckey = null; pk11symkey *mackey = null; secitem temp; unsigned char c; /* generate a symmetric aes key as a token object.
nss tech note1
the following macros are provided for tag numbers within the universal class : sec_asn1_boolean, sec_asn1_integer, sec_asn1_bit_string, sec_asn1_octet_string, sec_asn1_null, sec_asn1_object_id, sec_asn1_object_descriptor,† sec_asn1_real, sec_asn1_enumerated, sec_asn1_embedded_pdv, sec_asn1_utf8_string, sec_asn1_sequence, sec_asn1_set, sec_asn1_numeric_string, 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_g...
...eneralized_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 .
nss tech note4
em id; secitem maxusers; }; typedef struct _mycertextdata mycertextdata; /* template used for decoding the extension */ const sec_asn1template mycertexttemplate[] = { { sec_asn1_sequence, 0, null, sizeof( mycertextdata ) }, { sec_asn1_integer, offsetof(mycertextdata, version) }, { sec_asn1_octet_string, offsetof( mycertextdata, streetaddress ) }, { sec_asn1_octet_string, offsetof( mycertextdata, phonenum ) }, { sec_asn1_octet_string, offsetof( mycertextdata, rfc822name ) }, { sec_asn1_octet_string, offsetof( mycertextdata, id ) }, { sec_asn1_integer, offsetof(mycertextdata, maxusers ) }, { 0 } }; ...
...(&data.maxusers, pr_false); } } some miscellaneous helper functions compare two secitems (e.g., two oids) prbool secitem_itemsareequal(const secitem *a, const secitem *b); interpreting a secitem value as an integer if secitem *item->len <=4, then int value = der_getinteger(item); interpreting a secitem value as a string use string copy functions to copy item->len bytes from item->data and null terminate explicitly some higher level extension functions get a specific extension from the list of extensions, given the extension tag secstatus cert_findcertextension (certcertificate *cert, int tag, secitem *value); get a specific extension from th...
FC_GetTokenInfo
serialnumber: the device's serial number as a string, "0000000000000000", 16 characters and not null-terminated.
... examples note the use of the %.32s format string to print the label and manufacturerid members of the ck_token_info structure.
NSS tools : signtool
when you use signtool -v, these entries are displayed with the string not present.
...this metadata can be any ascii string, but is used mainly for specifying an installer script.
Necko Interfaces Overview
nsiioservice central necko service manages protocol handlers thin layer over protocol handlers provides interface for creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (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 nsirequ...
Necko walkthrough
nsdocshell as an example client of the nsihttpchannel api nsdocshell::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ...
...hostname and port) from the transaction, and then gets or creates a connection entry from the connection table, an nsclasshashtable<nscstringhashkey, nsconnectionentry> called mct in nshttpconnectionmgr.
Renaming With Pork
this makes it easier to refer to any diagnostics touch /tmp/err.txt tail -f /tmp/err.txt & ~/work/pork-barrel/pork-barrel 4 /tmp/ls.txt ./renamer -rename-class string sm::string > /tmp/string.diff 2>/tmp/err.txt pork-barrel runs multiple copies of the renamer and merges their output.
...--dry-run is helpful for debugging filterdiff -x \*/smbase/\* /tmp/string.diff |sed 's/.home.tglek.tmp.//' | patch -p1 --dry-run ...
Rhino scopes and contexts
uses of standard objects like function, string, or regexp will find the definitions in the shared scope.
...string loadme = "regexp; getclass; java; packages; javaadapter;"; cx.evaluatestring(sealedsharedscope , loadme, "lazyload", 0, null); sealedsharedscope .sealobject(); dynamic scopes there's one problem with the setup outlined above.
Creating JavaScript jstest reftests
a different approach is to use the expectexitcode(exitcode) function which outputs a string: --- note: in this testcase, we expect exit code <exitcode> --- that tells the post-processing scripts jsdriver.pl or post-process-logs.pl that the test passes if the shell or browser terminates with that exit code.
... a modification will soon be made to the javascript tests to allow an arbitrary string to be output which will be used to post process the test logs to better determine if a test has passed regardless of its exit code.
Hacking Tips
break 'mozilla::dom::canvasrenderingcontext2d::drawwindow(nsglobalwindow&, double, double, double, double, nsastring_internal const&, unsigned int, mozilla::errorresult&)' cont break 'presshell::renderdocument(nsrect const&, unsigned int, unsigned int, gfxcontext*)' set print object on set $x = <your x value> set $y = <your y value> print &((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).data[$y * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).stride + $x * ((cairo_image_su...
...each root has the form "0xabcd1234 <color> <description>", where <color> is the color of the given gc thing (b for black, g for gray, w for white) and <description> is a string.
64-bit Compatibility
the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: pointers uintptr_t, intptr_t, ptrdiff_t, (probably) size_t jsval jsuword, jsword length of a string, though the actual length cannot exceed 30 bits jsuintptr, jsintptr, jsptrdiff, jsuptrdiff, jssize, jsuword, jsword (let's not use these, kthx) the following types are 32-bit on 32-bit platforms.
...64, i32 i64 qursh i64, i32 i64 qcmov i32, i64, i64 i32 qior i64, i64 i64 qixor i64, i64 i64 qiaddp i64, i64 i64 qeq - quge i64, i64 i32 qcall n/a i64 extending or truncating native integers sometimes it is necessary to reduce a native integer to a 32-bit integer (for example, array or string lengths in tracemonkey) or extend a 32-bit integer to a native integer.
Statistics API
nonincremental_reason: string - a string representing the reason that an incremental gc was aborted or forced to finish in a single slice.
... reason: string - a string describing the api that initiated this gc slice.
JS::CompileOffThread
chars const char16_t * string containing the script to compile.
...chars is the string containing the text of the script.
JS::OrdinaryToPrimitive
most users should not call this -- use js::tonumber, js::toboolean, or js::tostring instead.
... see also mxr id search for js::ordinarytoprimitive js::tonumber js::toboolean js::tostring bug 1103152 ...
JS::PersistentRooted
there are typedefs available for the main types: namespace js { typedef persistentrooted<jsfunction*> persistentrootedfunction; typedef persistentrooted<jsid> persistentrootedid; typedef persistentrooted<jsobject*> persistentrootedobject; typedef persistentrooted<jsscript*> persistentrootedscript; typedef persistentrooted<jsstring*> persistentrootedstring; typedef persistentrooted<js::symbol*> persistentrootedsymbol; // added in spidermonkey 38 typedef persistentrooted<value> persistentrootedvalue; } example following example allocates persistentrootedvalue, and provides two functions for setting and getting it from javascript.
...} see also mxr id search for js::persistentrooted mxr id search for js::persistentrootedfunction mxr id search for js::persistentrootedid mxr id search for js::persistentrootedobject mxr id search for js::persistentrootedscript mxr id search for js::persistentrootedstring mxr id search for js::persistentrootedsymbol mxr id search for js::persistentrootedvalue js::rooted js::handle js::mutablehandle gc rooting guide bug 892643 bug 1107639 -- added two phase construction.
JSConvertOp
hint will be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint.
...however, the engine itself only requires support for jstype_string, jstype_number, and jstype_void, if js_convertvalue is not used.
JSExnType
jsexn_err error jsexn_internalerr internalerror jsexn_evalerr evalerror jsexn_rangeerr rangeerror jsexn_referenceerr referenceerror jsexn_syntaxerr syntaxerror jsexn_typeerr typeerror jsexn_urierr urierror jsexn_limit (upper bound) description these types are part of a jserrorformatstring structure.
... see also mxr id search for jsexntype jserrorformatstring bug 684526 ...
JSObjectOps.defaultValue
it calls the javascript methods obj.valueof() and/or obj.tostring().
... js_convertstub implements the default behavior for the jsclass.convert hook, which is to call obj.valueof() and obj.tostring() in accordance with the algorithm in es5 §8.12.8.
JS_CheckAccess
(this is redundant with passing the string id "__proto__" as id.) jsacc_parent check for permission to read obj's parent.
... (this is redundant with passing the string id "__parent__" as id.) jsacc_import check for permission to import the property.
JS_CompileScript
obsolete since jsapi 39 ascii or chars const char * or const char16_t * string containing the script to compile.
...ascii and chars are the string containing the text of the script.
JS_CompileScriptForPrincipals
src const char * or const jschar * string containing the script to compile.
... src is the string containing the text of the script.
JS_ConvertValue
type must be one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean.
... converting to jstype_string works like js::tostring.
JS_DecompileFunction
syntax jsstring * js_decompilefunction(jscontext *cx, js::handle<jsfunction*> fun); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... if successful, js_decompilefunction returns a string containing the text of the function.
JS_DecompileFunctionBody
syntax jsstring * js_decompilefunctionbody(jscontext *cx, js::handle<jsfunction*> fun, unsigned indent); name type description cx jscontext * the context in which to decompile the function.
...if successful, js_decompilefunctionbody returns a string containing the source code of the function body.
JS_DefinePropertyWithTinyId
any time the javascript engine would pass the name of the property as a string to the id parameter of a tiny-id-aware callback, it passes int_to_jsval(tinyid) instead.
...those getters and setters can use switch (jsval_to_int(id)), instead of checking the value of id as a string, to determine which property is being accessed.
JS_EvaluateScript
src const char * or const jschar * string containing the script to compile and execute.
... src is the string containing the text of the script.
JS_EvaluateScriptForPrincipals
src / bytes / chars const char * or const jschar string containing the script to compile and execute.
... src is the string containing the text of the script.
JS_FS
the _sym variants allow defining a function with a symbol key rather than a string key.
...(in builds without es6 symbols, it defines a method with the string id "@@iterator".) see an example in the jsapi user guide.
JS_ForgetLocalRoot
this must point to a jsobject, jsstring, jsfunction, or jsdouble.
...(here the term gc-thing refers to any value that is subject to garbage collection: a jsobject, jsstring, jsfunction, or jsdouble.) js_forgetlocalroot works on any gc-thing allocated in the current local root scope, but it's more time-efficient when called on references to more recently created gc-things.
JS_LookupElement
note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings.
...so any call to js_lookupelement is equivalent to a call to js_lookupproperty passing a numeric string for the name.
JS_PushArguments
format const char * null-terminated string holding a list of format types to convert the following arguments to.
...acters, as appropriate: character argument type b jsbool c uint16 (16-bit, unsigned integer) i int32 (32-bit, ecma-compliant signed integer) u uint32 (32-bit, ecma-compliant, unsigned integer) j int32 (32-bit, signed integer) d jsdouble i jsdouble (converted to an integer value) s char * (c string) s jsstring * (unicode string) w jschar * (unicode null-terminated string) o jsobject * f jsfunction * * none.
JS_RemoveRootRT
rp is thus a pointer to a pointer to a js double, string, or object.
... do not pass a pointer to a js double, string, or object -- you must pass a pointer to a pointer or a pointer to a jsval that's a gc thing.
JS_ReportErrorNumber
callback syntax typedef const jserrorformatstring * (* jserrorcallback)(void *userref, const unsigned errornumber); name type description userref void * the userref pointer that was passed to the reporterrornumber api.
...otherwise, if the jserrorformatstring returned by the jserrorcallback has .exntype == jsexn_none, then the error reporter, if any, is called, and no error object is created.
JS_ResolveStandardClass
id js::handleid an id of a standard class name, which must contain either a string or an int.
... description js_resolvestandardclass resolves id, which must contain either a string or an int, to a standard class name in obj if possible, defining the class's constructor and/or prototype and storing true in *resolved.
JS_SET_TRACING_DETAILS
the callback stores a string describing the reference traced in buf.
...when printer is null, arg must be const char * or char * c string naming the reference and index must be either (size_t)-1 indicating that the name alone describes the reference or it must be an index into some array vector that stores the reference.
JS_SetDefaultLocale
syntax bool js_setdefaultlocale(jsruntime *rt, const char *locale); void js_resetdefaultlocale(jsruntime *rt); name type description rt jsruntime * pointer to a js runtime locale const char * string represents locale.
... the locale string remains owned by the caller.
JS_SetElement
syntax /* added in spidermonkey 31 */ bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlevalue v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlestring v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, int32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, uint32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, double v); /* obsolete since jsapi 29 */ bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t i...
... v js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double the value to assign to the element.
JS_TypeOfValue
the return value is always one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean.
... see also mxr id search for js_typeofvalue js_convertvalue js_gettypename js_valuetoboolean js_valuetofunction js_valuetoint32 js_valuetonumber js_valuetoobject js_valuetostring ...
JS_ValueToSource
syntax jsstring * js_valuetosource(jscontext *cx, js::handle<js::value> v); name type description cx jscontext * the context in which to perform the conversion.
... on success, js_valuetosource returns a pointer to a string.
JS_malloc
s const char * (js_strdup only) pointer to a null-terminated string.
...js_strdup allocates a copy of the null-terminated string s.
Property attributes
mxr id search for jsprop_shared jsprop_index the property's id is represented internally as an integer, not a string.
... obsolete since jsapi 39 this flag has an additional special meaning when used with js_defineproperty, js_fs, and other apis that define properties: it means that the name parameter is actually an integer unsafely cast to a pointer type, not a string.
Gecko events
event_table_column_insert event_table_column_delete event_table_column_reorder event_window_activate event_window_deactivate event_window_destroy event_window_maximize event_window_minimize event_window_resize event_window_restore event_hyperlink_end_index_changed the ending index of this link within the containing string has changed.
...event_hyperlink_start_index_changed the starting index of this link within the containing string has changed.
Mork
MozillaTechMork
hex = [0-9a-fa-f]+ name = [a-za-z_?:] [a-za-z_?:+-]* value is a string terminated by ')' (not consumed) where '\' quotes the next metacharacter and '$' quotes the next two hexadecimal digits as a value (e.g., $20 is a space) the first line in the file is the header.
...the value of a mork cell is treated as nothing more than a char*, char here in the sense of an octet rather than a string character.
Fun With XBL and XPConnect
<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.
...i could apply a trick similar to what i did for the xpcom object: <property name="autocompletelistener"> <![cdata[ ({ onautocompleteresult: function(aitem, aoriginalstring, amatch) { if ( aitem ) { anonymouscontent[0].value = amatch; } } }) ]]> </property> as long as the js for the value of autocompletelistener evaluates to an object (and wrapping the expression with a set of parens like i did, does this), then the value of autocompletelistener is an object that implements my ...
Creating XPCOM components
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 u...
...tilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock getting called at startup registering for notifications getting access to the category manager providing access to weblock creating the weblock programming interface defining the weblock interface in xpidl the xpidl syntax scriptable interfaces subclassing nsisupports the web locking interface implementing weblock declaration macros representing return values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service ...
XPCOM guide
MozillaTechXPCOMGuide
however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.mozilla internal string guidemost of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers.
... this guide documents the string classes which are visible to code within the mozilla codebase (code which is linked into libxul).
Components.utils.evalInWindow
this function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context.
...syntax var result = components.utils.evalinwindow(script, window); parameters script : string the script to evaluate in the other window.
Components.utils.reportError
if it is not a javascript error object, the parameter is converted to a string and reported as a new error.
... function mydump(amessage) { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); consoleservice.logstringmessage("my component: " + amessage); } firefox 3: the error console will not display chrome errors by default.
nsIRegistry
js> rs.getstringutf8(530, "directory") // 530: key corresponding with profiles/default the output is something like: /home/lion/.mozilla/default/awp83kud.slt boo-yah!
...js> rs.setstringutf8(530, "directory", "/home/lion/somewhere/else") js> rs.getstringutf8(530, "directory") /home/lion/somewhere/else yes!
BeginReading
« xpcom api reference summary the beginreading function returns a const pointer to the first element of the string's internal buffer.
... example code // count the number of times a particular character appears in the string pruint32 countchar(const nsacstring& str, char c) { const char* start = str.beginreading(); const char* end = str.endreading(); pruint32 count = 0; while (start != end) { if (*start++ == c) ++count; } return count; } see also length, endreading ...
BeginReading
« xpcom api reference summary the beginreading function returns a const pointer to the first element of the string's internal buffer.
... example code // count the number of times a particular character appears in the string pruint32 countchar(const nsastring& str, prunichar c) { const prunichar* start = str.beginreading(); const prunichar* end = str.endreading(); pruint32 count = 0; while (start != end) { if (*start++ == c) ++count; } return count; } see also length ...
get
« xpcom api reference summary the get function returns a const pointer to the string's null-terminated, internal buffer.
... const char_type* get() const; example code nsembedcstring str("hello world"); printf("%s\n", str.get()); ...
get
« xpcom api reference summary the get function returns a const pointer to the string's null-terminated, internal buffer.
... const char_type* get() const; example code void getbar(nsastring &result); void func() { nsembedstring str; getbar(str); const prunichar *data = str.get(); ...
IAccessible2
extendedstates() returns the extended states (array of strings).
...localizedextendedstates() returns the localized extended states() (array of strings).
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.
... void oninstallended( in astring aurl, in print32 astatus ); parameters aurl the url of the add-on being installed.
imgIContainer
obsolete since gecko 2.0 void setdiscardable(in string amimetype); native code only!
...void setdiscardable( in string amimetype ); parameters amimetype missing description exceptions thrown missing exception missing description setframeblendmethod() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete.
imgIDecoderObserver
mgirequest arequest, in imgicontainer acontainer); void onstartdecode(in imgirequest arequest); void onstartframe(in imgirequest arequest, in unsigned long aframe); 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.
...void onstopdecode( in imgirequest arequest, in nsresult status, in wstring statusarg ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object.
imgILoader
l 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 imgidecoderobserver 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.
...boolean supportimagewithmimetype( in string mimetype ); parameters mimetype the type to find a decoder for.
mozIPlaceInfo
guid string read only: the globally unique id of the place.
... title string read only: the title associated with the place.
mozIStorageAggregateFunction
nscomptr<mozistoragefunction> func = new standarddeviationfunc(); ns_ensure_true(func, ns_error_out_of_memory); nsresult rv = dbconn->createfunction( ns_literal_cstring("stddev"), 1, func ); ns_ensure_success(rv, rv); // run some query that uses the function.
... nscomptr<mozistoragestatement> stmt; rv = dbconn->createstatement(ns_literal_cstring( "select stddev(value) from some_table"), getter_addrefs(stmt) ); ns_ensure_success(rv, rv); prbool hasmore; while (ns_succeeded(stmt->executestep(&hasmore)) && hasmore) { // handle the results } ...
mozIStorageError
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description message autf8string a human readable error string with details; this may be null if no details are available.
... toobig 18 a string or blob exceeds the size limit.
mozIStorageFunction
nscomptr<mozistoragefunction> func = new squarefunction(); ns_ensure_true(func, ns_error_out_of_memory); nsresult rv = dbconn->createfunction( ns_literal_cstring("square"), 1, func ); ns_ensure_success(rv, rv); // run some query that uses the function.
... nscomptr<mozistoragestatement> stmt; rv = dbconn->createstatement(ns_literal_cstring( "select square(value) from some_table"), getter_addrefs(stmt) ); ns_ensure_success(rv, rv); prbool hasmore; while (ns_succeeded(stmt->executestep(&hasmore)) && hasmore) { // handle the results } see also storage introduction and how-to article mozistorageconnection database connection to a specific file or in-memory data storage mozistoragestatement create and execute sql statements on a sqlite database.
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.
...nsivariant getresultbyname( in autf8string aname ); parameters aname the name of the column whose value is to be returned.
DefaultKeyBinding
« nsiaccessible page summary provides localized string of global keyboard accelerator for default action, such as ctrl+o for open file (ctrl + o).
... attribute astring defaultkeybinding; see also nsiaccessible.getkeybindings() nsiaccessible.keyboardshortcut ...
KeyboardShortcut
« nsiaccessible page summary provides localized string of accesskey name, such as alt+d (alt + d).
... attribute astring keyboardshortcut; see also nsiaccessible.defaultkeybinding nsiaccessible.getkeybindings() ...
nsIAccessibleEvent
045 event_window_create 0x004a 0x0046 event_window_deactivate 0x004b 0x0047 event_window_destroy 0x004c 0x0048 event_window_maximize 0x004d 0x0049 event_window_minimize 0x004e 0x004a event_window_resize 0x004f 0x004b event_window_restore 0x0050 0x004c event_hyperlink_end_index_changed 0x0051 0x004d the ending index of this link within the containing string has changed.
... event_hyperlink_start_index_changed 0x0056 0x0052 the starting index of this link within the containing string has changed.
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()...
...void create( inout int argc, inout string argv ); parameters argc the number of parameters passed in on the command line.
nsIAuthModule
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void getnexttoken([const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength); void init(in string aservicename, in unsigned long aserviceflags, in wstring adomain, in wstring ausername, in wstring apassword); void unwrap([const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength); void wrap([const] in voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned long aouttokenlen...
...void init( in string aservicename, in unsigned long aserviceflags, in wstring adomain, in wstring ausername, in wstring apassword ); parameters aservicename the service name, which may be null if not applicable (for example, for ntlm, this parameter should be null).
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.
...void onstatus( in wstring statustext ); parameters statustext ...
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.
... void startsearch( in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener ); parameters searchstring the string to search for.
nsIBadCertListener2
method overview boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status.
... boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
nsICacheDeviceInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description description string get a human readable description of the cache device.
... usagereport string get a usage report, statistics, miscellaneous data about the cache device.
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.
... boolean visitmetadataelement( in string key, in string value ); parameters key the key for visiting the meta data for a cache entry.
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.
...violates the xpcom interface guidelines exceptions thrown ns_error_not_available if the class does not have a classid contractid string a contractid through which an instance of this class can be created, or null.
nsIContentPref
nsicontentpref dom/interfaces/base/nsicontentprefservice2.idlscriptable a content preference 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) attributes attribute type description domain astring read only.
... name astring read only.
nsIControllers
es["@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 append...
...nsicontroller getcontrollerforcommand( in string command ); parameters command the name of a command, e.g.
nsICookiePromptService
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie.
... long cookiedialog( in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision ); parameters parent the parent window for the dialog.
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(in unsigned long long aaddress, in string aobjectdescription); methods begin() void begin(); parameters none.
...noteedge() void noteedge( in unsigned long long afromaddress, in unsigned long long atoaddress, in string aedgename ); parameters afromaddress atoaddress aedgename noteobject() void noteobject( in unsigned long long aaddress, in string aobjectdescription ); parameters aaddress aobjectdescription ...
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 relatedtargetarg, in long axis); attributes ...
...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 ); pa...
nsIDOMMozNetworkStatsManager
it contains the following fields: appmanifesturl a string used to filter network stats by app.
... servicetype a string used to filter network stats by system service.
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, in long clientyarg, in...
...void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long st...
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.
...void initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event.
nsIDOMParser
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.
... examples within the context of a window: var parser = new domparser(); var doc = parser.parsefromstring(astr, "application/xml"); outside of a window (e.g., a js xpcom component, a js module, or an xpcshell test): var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); var doc = parser.parsefromstring(astr, "application/xml"); using components.constructor(): const domparser = new components.constructor("@mozilla.org/xmlextras/domparser;1", "nsidomparser"); var parser = new domparser(); parser.init(principal, documenturi, baseuri); var doc = parser.parsefromstring(astr, "application/xml"); ...
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 is known.
... void initprogressevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg ); parameters typearg the type of event.
nsIDOMSimpleGestureEvent
method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg...
... void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long di...
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 the event represents a change to session storage.
... void initstorageevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring domainarg ); parameters typearg the type argument.
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.
... nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object.
nsIDOMUserDataHandler
1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value description node_cloned 1 the node was cloned.
...void handle( in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst ); parameters operation one of the node_* operation type constants from the above table.
nsIDOMXPathResult
stringvalue domstring if resulttype is string_type, the boolean value.
... string_type 2 type is a single string.
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 ...
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.
...void oninformationavailable( in nsirequest arequest, in nsisupports actxt, in astring ainfo ); parameters arequest the request.
nsIDirIndexParser
attributes attribute type description comment string the comment given, if any.
... encoding string the encoding to use.
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.
... nsisimpleenumerator getfiles( in string prop ); parameters prop the symbolic name of the file list.
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.
...unsigned long gethostingflags( in string acontext ); parameters acontext return value isclassmarkedsafeforscripting() test if the specified class is marked safe for scripting.
nsIDocumentLoader
cko 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 nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage); obsolete since gecko 1.8 void getcontentviewercontainer(in nsisupports adocumentid, out nsicontentviewercontainer aresult); native code only!
...ocationchange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri auri ); parameters awebprogress arequest auri fireonstatuschange() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void fireonstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage ); parameters awebprogress arequest astatus amessage native code only!getcontentviewercontainer obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete.
nsIDownload
displayname astring a user-readable description of the transfer.
... deprecated since gecko 19.0 guid astring the guid of the download that is stored in the database.
nsIDownloadProgressListener
id 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); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload); obsolete since gecko 1.9.1 attributes attribute type description document nsidomdocument document the document of the download manager frontend.
... void onstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads.
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.
... boolean isdataflavorsupported( in string adataflavor ); parameters adataflavor a string representing the mime type of the data to be matched, such as "text/unicode".
nsIFeedGenerator
1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description agent astring the name of the software that created the feed.
... version astring a string indicating the version of the generator software that created the feed.
nsIFeedPerson
1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description email astring the person's email address.
... name astring the name of the person.
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.
... void reporterror( in astring errortext, in long linenumber, in boolean bozo ); parameters errortext a short description of the error.
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.
...void setfilter( in astring filterstring ); parameters filterstring the filter to be applied to the file list.
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 ...
...key return value setboolean() void setboolean( in autf8string key, in boolean value ); parameters key value setint() void setint( in autf8string key, in long value ); parameters key value setstring() void setstring( in autf8string key, in autf8string value ); parameters key value ...
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.
...void setpagetitle( in nsiuri auri, in astring atitle ); parameters auri the nsiuri for which to set to the title.
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.
... void visitheader( in acstring aheader, in acstring avalue ); parameters aheader a string containing the key for a header such as "content-type" avalue the header's value field such as "text/html".
nsIInputStream
nsacstring* pbuf = (nsacstring*) aclosure; pbuf->append(afromsegment, acount); // indicate that we have consumed all of afromsegment *awritecount = acount; return ns_ok; } // copy the contents of astream into aresultbuf as one contiguous // buffer.
...nsresult copystream(nsiinputstream* astream, nsacstring& aresultbuf) { uint32_t numread; return astream->readsegments(appendsegment, (void*) &aresultbuf, pr_uint32_max, &numread); } remarks this interface was frozen for gecko 1.0.
nsILoginMetaInfo
attributes attribute type description guid astring the guid to uniquely identify the login.
... this can be any arbitrary string, but a format as created by nsiuuidgenerator is recommended.
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.
...void callback( in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure ); parameters process the value of the process attribute for the memory reporter.
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.
...parameters name type description messagename string the name of the message.
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.
...parameters name type description messagename string the name of the message.
nsIMessageWakeupService
to indicate a wakeup request in a manifest file, add a line that looks something like this: category wakeup-request nscomponent @mozilla.org/myservice;1,nsimyinterface,getservice,mymessage1,mymessage2[,..] the category entry value consists of a comma separate string that contains: the contract id for your component (e.g.
... the string name of interface to instantiate the component as (e.g.
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.
nsIMsgDBViewCommandUpdater
fox 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.
... void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message.
nsIMsgRuleAction
throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target label.
... throws an exception if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exception if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsIMsgSearchValue
attribute astring str; attribute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunkstatus junkstatus; /* * j...
... * (range 0-100, 100 is junk) */ attribute unsigned long junkpercent; astring tostring(); }; ...
nsINavHistoryQueryOptions
excludeitemifparenthasannotation obsolete since gecko 13.0 autf8string this option excludes items from a bookmarks query if the parent of the item has this annotation.
... sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes.
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.
... void observe( in nsisupports asubject, in string atopic, in wstring adata ); parameters asubject in general reflects the object whose change or action is being observed.
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.
...void removedatafromdomain( in autf8string adomain ); parameters adomain the domain for which data should be removed.
nsIProcess2
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.
... void runasync( [array, size_is(count)] in string args, in unsigned long count, in nsiobserver observer, optional in boolean holdweak optional ); parameters args an array of arguments to pass into the process, using the native character set.
nsIPrompt
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 di...
...alogtitle, in wstring text, in unsigned long buttonflags, in wstring button0title, in wstring button1title, in wstring button2title, in wstring checkmsg, inout boolean checkvalue); boolean prompt(in wstring dialogtitle, in wstring text, inout wstring value, in wstring checkmsg, inout boolean checkvalue); boolean promptpassword(in wstring dialogtitle, in wstring text, inout wstring password, in wstring checkmsg, inout boolean checkvalue); boolean promptusernameandpassword(in wstring dialogtitle, in wstring text, inout wstring username, inout wstring password, in wstring checkmsg, inout boolean checkvalue); boolean select(in wstring dialogtitle, in wstring text, in pruint32 count, [array, size_is(count)] in wstring selectlist, out lon...
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.
... nsivariant getproperty( in astring name ); parameters name the name to return the matching property.
nsIProxyInfo
host autf8string this attribute specifies the hostname of the proxy server.
... type acstring this attribute specifies the type of the proxy server as a case insensitive ascii string.
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.
... domstring text(); parameters none.
nsISSLErrorListener
method overview boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error.
... boolean notifysslerror( in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
nsISelection3
method overview void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection.
... void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend" } "move" collapses the selection to the end of the selection and applies the movement direction/granularity to the collapsed selection.
nsISelectionPrivate
void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wrapcolumn); attributes attribute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endplaceholdertransaction.
... tostringwithformat() wstring tostringwithformat( in string formattype, in unsigned long flags, in print32 wrapcolumn ); parameters formattype flags wrapcolumn return value ...
nsISessionStartup
note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was a string.
... it was changed in order to improve performance, which was suffering due to the need to parse and stringify the data.
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.
... nsisocketprovider getsocketprovider( in string sockettype ); parameters sockettype the socket type for which to get a socket provider.
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 receives email.
...void playsystemsound( in astring soundalias ); parameters soundalias two different types of names are supported: you can specify the name of a system sound provided by the host operating system; for example, if you specify "systemexclamation", you can play the windows alert sound, but it's played only on windows.
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.
...void settitle( in wstring text ); parameters text title to set for the html document.
nsITaskbarPreview
tooltip domstring a string containing the text displayed in the tooltip above the preview when the user hovers over it.
... by default, this is an empty string.
nsITaskbarPreviewButton
tooltip domstring the string displayed in the button's tooltip.
... by default, this is an empty string.
nsITaskbarTabPreview
title domstring the title displayed above the thumbnail.
... by default, this is an empty string.
nsITransportSecurityInfo
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description errormessage wstring error message on connection failure.
... shortsecuritydescription wstring for secure connections (ssl) gives the common name (cn) of the certifying authority.
nsITreeColumns
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
...nsitreecolumn getnamedcolumn( in astring id ); parameters id a column id return value the nsitreecolumn for this id.
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.
...void setuploadstream( in nsiinputstream astream, in acstring acontenttype, in long acontentlength ); parameters astream the stream to be uploaded by this channel.
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.
nsIWebBrowserChrome3
1.0 66 introduced gecko 2.0 inherits from: nsiwebbrowserchrome2 last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); methods onbeforelinktraversal() determines the appropriate target for a link.
... astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the original link target.
nsIWebNavigation
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 description load_flags_mask 65535 this flag defines the range of bits that may be specified.
... void loaduri( wstring uri, unsigned long loadflags, nsiuri referrer, nsiinputstream postdata, nsiinputstream headers ); parameters uri the uri string to load.
nsIWebNavigationInfo
cko 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.
...unsigned long istypesupported( in acstring atype, in nsiwebnavigation awebnav ); parameters atype the mime type to check.
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.
...void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message the worker wishes to post back to its creator.
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.
... nsiworker newchromeworker( in domstring ascripturl ); parameters ascripturl the url of the script to load into the new worker.
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.
... void postmessage( in domstring amessage ); parameters amessage the message to post.
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.
...void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message to post.
nsIXMLHttpRequest
try something like this: nscomptr<nsidomeventtarget> target(do_queryinterface(myxmlhttpreq)); target->addeventlistener(ns_literal_string("load"), mylistener, pr_false) where mylistener is your event listener object that implements the interface nsidomeventlistener.
... } }; let evf = f => ['load', 'error', 'abort'].foreach(f); evf(m => xhr.addeventlistener(m, handler, false)); xhr.mozbackgroundrequest = true; xhr.open('get', url, true); xhr.channel.loadflags |= ci.nsirequest.load_anonymous | ci.nsirequest.load_bypass_cache | ci.nsirequest.inhibit_persistent_caching; xhr.responsetype = "arraybuffer"; //dont set it, so it returns string, you dont want arraybuffer.
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.
nsIXULTemplateBuilder
verview void rebuild(); void refresh(); void addresult(in nsixultemplateresult aresult, in nsidomnode aquerynode); void removeresult(in nsixultemplateresult aresult); void replaceresult(in nsixultemplateresult aoldresult, in nsixultemplateresult anewresult, in nsidomnode aquerynode); void resultbindingchanged(in nsixultemplateresult aresult); nsixultemplateresult getresultforid(in astring aid); nsixultemplateresult getresultforcontent(in nsidomelement aelement); boolean hasgeneratedcontent(in nsirdfresource anode, in nsiatom atag); void addrulefilter(in nsidomnode arule, in nsixultemplaterulefilter afilter); [noscript] void init(in nsicontent aelement); [noscript] void createcontents(in nsicontent aelement, in boolean aforcecreation); void addlistener(in nsixulbuilderl...
...nsixultemplateresult getresultforid( in astring aid ); parameters aid the id to return the result for return value the result for the given id.
nsIXULWindow
void assumechromeflagsarefrozen(); void center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); nsidocshelltreeitem getcontentshellbyid(in wstring id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type description chromeflags pruint32 chromeflags are from nsiwebbrowserchrome.
... nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which is the same as the "type" attribute on the containing frame element.
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.
... nsizipreader getinnerzip( in nsifile zipfile, in autf8string zipentry ); parameters zipfile the zip file.
nsMsgSearchTerm
at the start of this macro, which means the macro // needs to enumerate the non-string attributes.
... %{c++ #define is_string_attribute(_a) \ (!(_a == nsmsgsearchattrib::priority || _a == nsmsgsearchattrib::date || \ _a == nsmsgsearchattrib::msgstatus || _a == nsmsgsearchattrib::messagekey || \ _a == nsmsgsearchattrib::size || _a == nsmsgsearchattrib::ageindays || \ _a == nsmsgsearchattrib::folderinfo || _a == nsmsgsearchattrib::location || \ _a == nsmsgsearchattrib::label || _a == nsmsgsearchattrib::junkstatus || \ _a == nsmsgsearchattrib::folderflag || _a == nsmsgsearchattrib::uint32hdrproperty || \ _a == nsmsgsearchattrib::junkpercent || _a == nsmsgsearchattrib::hasattachmentstatus)) %} ...
XPCOM Interface Reference by grouping
mpleenumerator nsisupportschar nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprimitive nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsixpcscriptable future nsixmlhttprequestupload obsolete nsixmlrpcclient nsixmlrpcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider ...
... nsihttpchannel nsihttpchannelinternal nsihttpheadervisitor nsiidnservice nsiprotocolhandler nsiprotocolproxycallback nsiprotocolproxyfilter nsiprotocolproxyservice nsiproxyinfo preferences nsiiniparser nsiiniparserfactory nsiprefbranch nsiprefbranch2 nsipreflocalizedstring nsiprefservice nsistringbundle nsistringbundleservice security cookies nsicookie nsicookie2 nsicookieacceptdialog nsicookieconsent nsicookiemanager nsicookiemanager2 nsicookiepermission nsicookiepromptservice nsicooki...
nsIMsgSearchValue
attribute astring str; attribute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunkstatus junkstatus; /* * j...
... * (range 0-100, 100 is junk) */ attribute unsigned long junkpercent; astring tostring(); }; ...
Setting HTTP request headers
(and yes, "http-on-modify-request" is a string.) note: there are many topics, besides just "http-on-modify-request", that you can get notifications about, for example "http-on-examine-response" and "xpcom-shutdown".
...var headername = "x-hello"; var headervalue = "world"; function log(text) { // var consoleservice = components.classes["@mozilla.org/consoleservice;1"].getservice(components.interfaces.nsiconsoleservice); // consoleservice.logstringmessage(text); } function myhttplistener() { } myhttplistener.prototype = { observe: function(subject, topic, data) { if (topic == "http-on-modify-request") { log("----------------------------> (" + subject + ") mod request"); var httpchannel = subject.queryinterface(components.interfaces.nsihttpchannel); httpchannel.setrequestheader(headername, headerv...
Using nsIPasswordManager
the example below should serve as a starting point: // the host name of the password we are looking for var querystring = 'http://www.example.com'; // ask the password manager for an enumerator: var e = passwordmanager.enumerator; // step through each password in the password manager until we find the one we want: while (e.hasmoreelements()) { try { // get an nsipassword object out of the password manager.
... var pass = e.getnext().queryinterface(components.interfaces.nsipassword); if (pass.host == querystring) { // found it!
Using nsISimpleEnumerator
using nsisimpleenumerator <stringbundle>.strings var enumerator = document.getelementbyid('astringbundleid').strings; var s = ""; while (enumerator.hasmoreelements()) { var property = enumerator.getnext().queryinterface(components.interfaces.nsipropertyelement); s += property.key + ' = ' + property.value + ';\n'; } alert(s); example using javascript 1.7 features // creates a generator iterating over enum's values function generatorfromsimpleenumerator(enum, interface) { while (enum.hasmoreelements()) { yield enum.getnext().queryinterface(interface); } } var b = document.getelementbyid("stringbundleset").firstchild var props = generatorfromenumerator(b.strings, components.interfaces.nsipropertyelement); var s = ""; for (let property in props) { s += property.key + ' ...
...= ' + property.value + ';\n'; } alert(s); links code based on using_nsipasswordmanager nsisimpleenumerator xul:property:strings ...
XPCOM tasks
p3 nsstringtokenizer probably belongs in the parser.
... p2 classes that parallel standard library classes should have compatible apis, i.e., nsdeque bug 18505 nsstring nsavltree nshashtable our various array classes in some cases, this might initially be provided by additional interfaces.
Account Provisioner
to have logs dumped to the terminal, create a string preference called mail.provider.logging.dump and set its value to all.
... to have logs dumped to the error console, create a string preference called mail.provider.logging.console and set its value to all.
Creating a gloda message query
query.bodymatches(searchstring): perform a full-text search against plaintext message bodies.
...query.subjectmatches(searchstring) for message subject (compare fundattr.js line 145 ).
MailNews fakeserver
the following comprises the api of the news fakeserver itself: nntpdaemon api name arguments returns notes [constructor] daemon flags n/a flags are defined below addgroup group name (string), is postable nothing adds the group (resetting if it exists) addarticle newsarticle object nothing adds the message to all groups in the article's group list addarticletogroup newsarticle object, group (string), integral key for group nothing adds the message to the specified group with the specified key getgroup group name group object group is a map key->article, with the additional prop...
... getarticle message id newsarticle object pretty self-explanatory newsarticle api name arguments returns notes [constructor] text (as a string) n/a initializes all fields headers (property) map of header (lower-case) -> value body (property) text of body messageid (property) message id fulltext (property) full text as message without modification except added headers.
Mail event system
sample code in this example, a listener will be set up to be notified when the message count changes in a folder: // our variable to know if the listener fired var listenerhasfired = false; var totalmessageslistenerhasfired = false; // the listening function that will react to changes function myonintpropertychanged(item, property, oldvalue, newvalue) { listenerhasfired=true; var propertystring = property.getunicode(); dump("onintpropertychanged has fired with property + " + propertystring + "!\n"); if (propertystring == "totalmessages") { totalmessageslistenerhasfired=true; //now show us visually var folder = item.queryinterface(components.interfaces.nsimsgfolder); dump("the folder " + folder.prettyname + " now has " + newvalue + " messages."); } ...
...else if (propertystring == "testproperty") { dump("recieved integer test property fired on folder " + folder.prettyname + " with values " + oldvalue + " and " + newvalue + "\n"); } // set up the folder listener to point to the above function var folderlistener = { onitemadded: function(parent, item, viewstring) {}, onitemremoved: function(parent, item, viewstring) {}, onitempropertychanged: function(parent, item, viewstring) {}, onitemintpropertychanged: myonintpropertychanged, onitemboolpropertychanged: function(item, property, oldvalue, newvalue) {}, onitemunicharpropertychanged: function(item, property, oldvalue, newvalue) {}, onitempropertyflagchanged: function(item, property, oldflag, newflag) {}, onitemevent: function(item, event) = {}, onfolderloaded:...
Filter Incoming Mail
by example, to modify the mail subject : var newmaillistener = { msgadded: function(amsghdr) { if( !amsghdr.isread ) { // here we are, a new mail has popped // let get a javascript string object from the subject property // querying mime conversion interface var mimeconvert = components.classes["@mozilla.org/messenger/mimeconverter;1"] .getservice(components.interfaces.nsimimeconverter); var subject = mimeconvert.decodemimeheader(amsghdr.subject, null, false, true); // here with have a string to modify with javascript.
... by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationservice = components.classes["@mozilla.org/messenger/msgnotificationservice;1"] .getservice(components.interfaces.nsimsgfoldernotificationservice); notificationservice.addlistener(newmaillistener, notificationservice.msgadded); } addeventlistener("load", init, true); have a look to nsimsgdbhdr to get the full list of properties to be modified.
Using the Mozilla symbol server
using the symbol server in microsoft visual c++ using the symbol server in windbg the windbg symbol path is configured with a string value delimited with asterisk characters.
... to use only the mozilla symbol server, add the following entry to your symbol path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://symbols.mozilla.org/ set this string as _nt_symbol_path in the environment, using the windbg menus, or by typing the .sympath command.
Zombie compartments
multiple compartments can share a zone, where a zone keeps track of things that can easily and securely be shared between related compartments such as string data and type information.
... │ ├──1.03 mb (00.21%) ── gc-heap │ │ │ └──0.25 mb (00.05%) ── malloc-heap │ │ ├──1.24 mb (00.25%) ── type-pool │ │ ├──1.07 mb (00.21%) -- type-objects │ │ │ ├──1.04 mb (00.21%) ── gc-heap │ │ │ └──0.03 mb (00.01%) ── malloc-heap │ │ ├──0.23 mb (00.05%) ++ strings │ │ └──0.18 mb (00.04%) ── gc-heap-arena-admin the first line says that the window from www.google.de is taking up 28.45 mb and futher breaks it down into zones, compartments, dom etc.
Using C struct and pointers
using c strings with js-ctypes a pointer to char in javascript is declared as follows: var str = ctypes.pointertype(ctypes.char); now imagine you call a c function that returns a c string and you want to modify the contents of this string.
... once we have a ctypes char pointer that points to a buffer of known size, we modiify the contents of the memory block as follows: ptr.contents = string("hello world from javascript!!!"); string() adds the '\0' character.
Declaring types
field descriptors each field descriptor is comprised of a field name and its data type, represented as a string and a ctype object, respectively.
... var timestr = asctime(thetime.address()); // pass a pointer to the tm struct var jsstring = timestr.readstring(); // convert the c string to javascript the last line converts the c string returned by the libc asctime() function into a javascript string by calling the cdata readstring() method.
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.
...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 casted.tostring(); // "ctypes.uint8_t.array(640000)([45, 66, 135, 255, 99, 86, 55, 255, ..........
Mozilla
mozilla external string guide the mozilla codebase used to have a notion of "external" strings, which were the string classes visible to code outside of the mozilla codebase (extensions, xulrunner applications, and embedders).
...the only remaining string classes are the "internal" ones, which are documented xpcom guide internal strings.
Initialization and Destruction - Plugins
/* define global variable to hold the user agent string.
...*/ useragent = (char*) npn_memalloc(strlen(result) + 1); if (useragent == null) return nperr_out_of_memory_error; /* copy the string to your memory.
Version, UI, and Status Information - Plugins
in the message parameter, pass the string you want to display on the status line.
...this function returns a string that contains the user_agent field of the browser.
Debug eval sources - Firefox Developer Tools
you can debug javascript code that is evaluated dynamically, either as a string passed to eval() or as a string passed to the function constructor.
... in the video below, we load a page containing a source like this: var script = `function foo() { console.log('called foo'); } //# sourceurl=my-foo.js`; eval(script); var button = document.getelementbyid("foo"); button.addeventlistener("click", foo, false); the evaluated string is given the name "my-foo.js" using the //# sourceurl directive.
Aggregate view - Firefox Developer Tools
type this is the default view, which looks something like this: it groups the things on the heap into types, including: javascript objects: such as function or array dom elements: such as htmlspanelement or window strings: listed as "strings" javascript sources: listed as "jsscript" internal objects: such as "js::shape".
...for example, in the screenshot above you can see that javascript objects account for most memory, followed by strings.
Dominators view - Firefox Developer Tools
in particular, allocation stacks are currently only recorded for objects, not for arrays, strings, or internal structures.
...each monster has a bigger retained size, which is accounted for by the string used for the monster's name: all this maps closely to the memory graph we were expecting to see.
Monster example - Firefox Developer Tools
each monster has: a string, for the monster's name a number representing the number of eyes it has a number representing the number of tentacles it has.
... so the structure of the memory allocated on the javascript heap is an object containing three arrays, each containing 5000 objects (monsters), each object containing a string and two integers: ...
Tree map view - Firefox Developer Tools
strings other: this includes internal spidermonkey objects.
...you can see that most of the heap is occupied by the strings used for the monsters' names, and the objects used to contain the monsters' other attributes.
Examine and edit CSS - Firefox Developer Tools
filtering rules there's a box at the top of the rules view labeled "filter styles": as you type: any rules which don't contain the typed string at all are hidden any declarations which contain the typed string are highlighted click the "x" at the end of the search box to remove the filter.
... strict search by default, the search box highlights all declarations which contain any part of the string.
Responsive Design Mode - Firefox Developer Tools
the screen, three buttons allow you to: camera button - take a screenshot settings button - opens the rdm settings menu close button - closes rdm mode and returns to regular browsing the settings menu includes the following commands: left-align viewport - when checked moves the rdm viewport to the left side of the browser window show user agent - when checked displays the user agent string the final two options define when the page is reloaded: reload when touch simulation is toggled: when this option is enabled, the page is reloaded whenever you toggle touch support.
...each device can have its own: name size devicepixelratio user agent string touch screen also, you can preview the properties of existing devices by hovering over the name in the device modal, where they display in a tooltip.
Taking screenshots - Firefox Developer Tools
--filename string the name to use in saving the file.
... --selector string a css selector that selects a single element on the page.
AddressErrors.city - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var cityerror = addresserrors.city; value if the value specified in the paymentaddress object's city property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.country - Web APIs
the value is a string describing the error and should offer suggestions for how to correct it.
... syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AddressErrors.dependentLocality - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var localityerror = addresserrors.dependentlocality; value if the value specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.phone - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var phoneerror = addresserrors.phone; value if the value specified in the paymentaddress object's phone property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.postalCode - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var postcodeerror = addresserrors.postcode; value if the value specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.recipient - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var recipienterror = addresserrors.recipient; value if the value specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.region - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var regionerror = addresserrors.region; value if the value specified in the paymentaddress object's region property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.regionCode - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var regioncodeerror = addresserrors.regioncode; value if the value specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.sortingCode - Web APIs
the returned string explains the error and should offer suggestions for how to correct it.
... syntax var sortingcodeerror = addresserrors.sortingcode; value if the value specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
Animation.id - Web APIs
WebAPIAnimationid
the animation.id property of the web animations api returns or sets a string used to identify the animation.
... syntax var animationsid = animation.id; animation.id = newidstring; value a domstring which can be used to identify the animation, or null if the animation has no id.
AnimationEvent.initAnimationEvent() - Web APIs
syntax animationevent.initanimationevent(typearg, canbubblearg, cancelablearg, animationnamearg, elapsedtimearg); parameters typearg a domstring identifying the specific type of animation event that occurred.
... animationnamearg a domstring containing the value of the animation-name css property associated with the transition.
AnimationEvent.pseudoElement - Web APIs
summary the animationevent.pseudoelement read-only property is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
... if the animation doesn't run on a pseudo-element but on the element, an empty string: ''.
AudioContextLatencyCategory - Web APIs
the audiocontextlatencycategory type is an enumerated set of strings which are used to select one of a number of default values for acceptable maximum latency of an audio context.
... by using these strings rather than a numeric value when specifying a latency to a audiocontext, you can allow the user agent to select an appropriate latency for your use case that makes sense on the device on which your content is being used.
AudioContextOptions.latencyHint - Web APIs
the value is specified either as a member of the string enum audiocontextlatencycategory or a double-precision value.
... the best way to specify the preferred latency is to use a value form the string enum audiocontextlatencycategory.
AudioParamDescriptor - Web APIs
properties name the domstring which represents the name of the audioparam.
... automationrate optional either "a-rate", or "k-rate" string which represents an automation rate of this audioparam.
AudioParamMap - Web APIs
the web audio api interface audioparammap represents a set of multiple audio parameters, each described as a mapping of a domstring identifying the parameter to the audioparam object representing its value.
... properties the audioparammap object is accessed as a map in which each parameter is identified by a name string which is mapped to an audioparam containing the value of that parameter.
AudioTrack.id - Web APIs
WebAPIAudioTrackid
the id property contains a string which uniquely identifies the track represented by the audiotrack.
... syntax var trackid = audiotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an audiotracklist such as the one specified by a media element's audiotracks property.
AudioTrack.language - Web APIs
the read-only audiotrack property language returns a string identifying the language used in the audio track.
... syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
AudioWorkletGlobalScope.registerProcessor - Web APIs
syntax audioworkletglobalscope.registerprocessor(name, processorctor); parameters name a string representing the name under which the processor will be registered.
... return value undefined exceptions notsupportederror the name is an empty string, or a constructor under the given name is already registered.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
the properties of these objects are as follows: name the domstring which represents the name of the audioparam.
... automationrate optional either "a-rate", or "k-rate" string which represents an automation rate of this audioparam.
BasicCardRequest.supportedNetworks - Web APIs
the supportednetworks property of the basiccardrequest dictionary contains an array of domstrings representing the card networks that the retailer supports (e.g.
...value]] value an array containing one or more domstrings, which describe the card networks the retailer supports.
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccardrequest dictionary can optionally be provided to specify an array of domstrings representing the card types that the retailer supports (e.g.
... syntax basiccardrequest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports.
Using the Beacon API - Web APIs
the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
... 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.
Beacon API - Web APIs
the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
...the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
BeforeInstallPromptEvent - Web APIs
beforeinstallpromptevent.platforms read only returns an array of domstring items containing the platforms on which the event was dispatched.
... beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "accepted" or "dismissed".
BiquadFilterNode.type - Web APIs
the type property of the biquadfilternode interface is a string (enum) value defining the kind of filtering algorithm the node is implementing.
... syntax var audioctx = new audiocontext(); var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = 'lowpass'; value a string (enum) representing a biquadfiltertype.
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.
... returns a promise that resolves with a usvstring which contains the blob's data as a text string.
id - Web APIs
the bluetoothdevice.id read-only property returns a domstring that uniquely identifies a device.
... syntax var id = instanceofbluetoothdevice.id returns a domstring.
BluetoothDevice.name - Web APIs
the bluetoothdevice.name read-only property returns a domstring that provides a human-readable name for the device.
... syntax var name = instanceofbluetoothdevice.name returns a domstring.
BluetoothRemoteGATTCharacteristic.uuid - Web APIs
the bluetoothremotegattcharacteristic.uuid read-only property returns domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic.
... syntax var uuid = bluetoothremotegattcharacteristic.uuid returns a domstring.
uuid - Web APIs
the bluetoothgattservice.uuid read-only property returns a domstring representing the uuid of this service.
... syntax var uuid = bluetoothgattservice.uuid returns a domstring.
CSSMathValue.operator - Web APIs
for example, if the current cssmathvalue subtype is cssmathsum, this property will return the string "sum".
... syntax var astring = cssmathvalue.operator; value a string.
CSSNamespaceRule.namespaceURI - Web APIs
the cssnamespacerule.namespaceuri read-only property returns a domstring containing the text of the uri of the given namespace.
... syntax var namespaceuri = cssnamespacerule.namespaceuri returns a domstring containing a uri.
CSSNamespaceRule.prefix - Web APIs
the cssnamespacerule.prefix read-only property returns a domstring with the name of the prefix associated to this namespace.
... syntax var prefix = cssnamespacerule.prefix returns a domstring containing the prefix associated to this namespace.
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.
... syntax var cssnumericvalue = cssnumericvalue.parse(csstext); parameters csstext a string containing numeric and unit parts.
CSSPseudoElement.type - Web APIs
the type read-only property of the csspseudoelement interface returns the type of the pseudo-element as a string, represented in the form of a css selector.
... syntax var typeofpseudoelement = csspseudoelement.type; value a cssomstring containing one of the following values: "::before" "::after" "::marker" examples the example below demonstrates the relationship between csspseudoelement.type and element.pseudo(): const myelement = document.queryselector('q'); const myselector = '::after'; const csspseudoelement = myelement.pseudo(myselector); const typeofpseudoelement = csspseudoelement.type; console.log(myselector === typeofpseudoelement); // outputs true specifications specification status comment css pseudo-elements level 4the definition of 'type' in that specification.
CSSStyleDeclaration.item() - Web APIs
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.
... return value propertyname is a domstring that is the name of the css property at the specified index.
CSSStyleDeclaration.removeProperty() - Web APIs
syntax var oldvalue = style.removeproperty(property); parameters property is a domstring representing the property name to be removed.
... return value oldvalue is a domstring equal to the value of the css property before it was removed.
CSSStyleDeclaration - Web APIs
cssstyledeclaration.item() returns a css property name by its index, or the empty string if the index is out-of-bounds.
... example var styleobj = document.stylesheets[0].cssrules[0].style; console.log(styleobj.csstext); for (var i = styleobj.length; i--;) { var namestring = styleobj[i]; styleobj.removeproperty(namestring); } console.log(styleobj.csstext); specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration' in that specification.
CSSStyleRule.selectorText - Web APIs
syntax string = cssrule.selectortext example // for cssrule: body { background-color: darkblue; } var stylesheet = document.stylesheets[0]; alert(stylesheet.cssrules[0].selectortext); // body notes the implementation may have stripped out insignificant whitespace while parsing the selector.
... if set to a selector string which cannot be parsed, a syntaxerror is thrown.
CSSStyleSheet.insertRule() - Web APIs
syntax stylesheet.insertrule(rule [, index]) parameters rule a domstring containing the rule to be inserted.
... /*else*/ return originalinsertrule.call( this, // the sheet to be changed selectorandrule.substring(0, openbracketpos), // the selector selectorandrule.substring(closebracketpos), // the rule arguments[3] // the insert index ); } // works by if the char code is a backslash, then isescaped // gets flipped (xor-ed by 1), and if it is not a backslash // then isescaped gets xored by itself, zeroing it isescaped ^= newcharcod...
CSSUnitValue.unit - Web APIs
WebAPICSSUnitValueunit
the cssunitvalue.unit read-only property of the cssunitvalue interface returns a usvstring indicating the type of unit.
... syntax var astring = cssunitvalue.unit; value a usvstring.
Cache.delete() - Web APIs
WebAPICachedelete
the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
... cachename: a domstring that represents a specific cache to search within.
Cache.keys() - Web APIs
WebAPICachekeys
the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
... cachename: a domstring that represents a specific cache to search within.
CacheStorage - Web APIs
maintains a mapping of string names to corresponding cache objects.
... cachestorage.keys() returns a promise that will resolve with an array containing strings corresponding to all of the named cache objects tracked by the cachestorage.
CanvasRenderingContext2D.createPattern() - Web APIs
it can be any of the following: htmlimageelement (<img>) svgimageelement (<image>) htmlvideoelement (<video>, by using the capture of the video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indicating how to repeat the pattern's image.
... possible values are: "repeat" (both directions) "repeat-x" (horizontal only) "repeat-y" (vertical only) "no-repeat" (neither direction) if repetition is specified as an empty string ("") or null (but not undefined), a value of "repeat" will be used.
CanvasRenderingContext2D.drawWindow() - Web APIs
bgcolor a domstring that specifies the color the canvas is filled with before the window is rendered into it.
...it is given as a css color string (for example, rgb() or rgba()).
CanvasRenderingContext2D.font - Web APIs
this string uses the same syntax as the css font specifier.
... syntax ctx.font = value; options value a domstring parsed as css font value.
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.
... syntax canvasrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context.
Clipboard.readText() - Web APIs
return value a promise that resolves with a domstring containing the textual contents of the clipboard.
... returns an empty string if the clipboard is empty, does not contain text, or does not include a textual representation among the datatransfer objects representing the clipboard's contents.
CloseEvent() - Web APIs
syntax var event = new closeevent(typearg, closeeventinit); values typearg is a domstring representing the name of the event.
... "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection.
CloseEvent.initCloseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble, cancelable, wasclean, reasoncode, reason); parameters type the string to set the event's type to.
... reason a domstring describing the reason of the close in shuman-readable way.
console.count() - Web APIs
WebAPIConsolecount
syntax console.count([label]); parameters label optional a string.
... if we pass the user variable as the label argument to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "alice: 3" we're now maintaining separate counts based only on the value of label.
Console.countReset() - Web APIs
syntax console.countreset([label]); parameters label optional a string.
... if we pass the user variable as the label argument with the string "bob" to the first invocation of count(), and the string "alice" to the second: let user = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.countreset("bob"); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "bob: 0" "alice: 3" resetting the value of the counter "bob" o...
ContentIndexEvent.id - Web APIs
the read-only id property of the contentindexevent interface is a string which identifies the deleted content index via it's id.
... syntax var id = contentindexevent.id; value a string representation of the deleted content index id.
Credential.id - Web APIs
WebAPICredentialid
the id property of the credential interface returns a domstring containing the credential's identifier.
... syntax var id = credential.id; value a a domstring containing the credential's identifier.
Credential.name - Web APIs
WebAPICredentialname
the name property of the credential interface returns a domstring, containing the name associated with a credential.
... syntax var credname = credential.name; value a domstring containing the credential's given name.
Credential.type - Web APIs
WebAPICredentialtype
the type property of the credential interface returns a domstring containing the credential's type.
... syntax var credtype = credential.type; value a domstring contains a credential's given name.
Credential - Web APIs
properties credential.id read only returns a domstring containing the credential's identifier.
... credential.type read only returns a domstring containing the credential's type.
CryptoKey - Web APIs
WebAPICryptoKey
properties cryptokey.type string which may take one of the following values: "secret": this key is a secret key for use with a symmetric algorithm.
... cryptokey.usages an array of strings, indicating what can be done with the key.
DOMException() - Web APIs
if not present, the empty string '' is used.
... name optional returns a domstring that contains one of the strings associated with an error constant.
DOMException.message - Web APIs
the message read-only property of the domexception interface returns a domstring representing a message or description associated with the given error name.
... syntax var domexceptionmessage = domexceptioninstance.message; value a domstring.
DOMException.name - Web APIs
WebAPIDOMExceptionname
the name read-only property of the domexception interface returns a domstring that contains one of the strings associated with an error name.
... syntax var domexceptionname = domexceptioninstance.name; value a domstring.
DOMImplementation.createDocument() - Web APIs
syntax var doc = document.implementation.createdocument(namespaceuri, qualifiednamestr, documenttype); parameters namespaceuri is a domstring containing the namespace uri of the document to be created, or null if the document doesn't belong to one.
... qualifiednamestr is a domstring containing the qualified name, that is an optional prefix and colon plus the local root element name, of the document to be created.
DOMImplementation.hasFeature() - Web APIs
syntax const flag = document.implementation.hasfeature(feature, version); parameters feature a domstring representing the feature name.
... version a domstring representing the version of the specification defining the feature.
DOMMatrixReadOnly - Web APIs
dommatrixreadonly.tostring() creates and returns a domstring object which contains a string representation of the matrix in css matrix syntax, using the appropriate css matrix notation.
... for a 3d matrix, the returned string contains all 16 elements and takes the form matrix3d(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44).
DOMTokenList.item() - Web APIs
WebAPIDOMTokenListitem
syntax tokenlist.item(index) parameters index a domstring representing the index of the item you want to return.
... return value a domstring representing the returned item.
DOMTokenList.remove() - Web APIs
syntax tokenlist.remove(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token you want to remove from the list.
... if the string is not in the list, no error is thrown, and nothing happens.
DOMTokenList.replace() - Web APIs
syntax tokenlist.replace(oldtoken, newtoken); parameters oldtoken a domstring representing the token you want to replace.
... newtoken a domstring representing the token you want to replace oldtoken with.
DOMTokenList.value - Web APIs
the value property of the domtokenlist interface is a stringifier that returns the value of the list as a domstring, or clears and sets the list to the given value.
... syntax tokenlist.value; value a domstring examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist, then write the value of the list to the <span>'s node.textcontent.
DataTransfer.dropEffect - Web APIs
when the datatransfer object is created, dropeffect is set to a string value.
... syntax datatransfer.dropeffect; values a domstring representing the drag operation effect.
DataTransfer.mozSetDataAt() - Web APIs
the data should be either a string, a boolean or number type (which will be converted into a string) or an nsisupports.
... syntax void datatransfer.mozsetdataat([type], data, index); arguments type a string representing the type of the drag data to add to the drag data object.
DataTransfer.setData() - Web APIs
syntax void datatransfer.setdata(format, data); arguments format a domstring representing the type of the drag data to add to the drag object.
... data a domstring representing the data to add to the drag object.
DataTransferItem.getAsFile() - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html console.log("...
... drop: html"); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri console.log("...
DataTransferItem - Web APIs
properties datatransferitem.kind read only the kind of drag data item, string or file.
... datatransferitem.getasstring() invokes the specified callback with the drag data item string as its argument.
DataTransferItemList.DataTransferItem() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DataTransferItemList.clear() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DataTransferItemList.length - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DataTransferItemList.remove() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/html'))) { // drag data item is html data[i].getasstring(function (s){ console.log("...
... drop: html = " + s); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^text/uri-list'))) { // drag data item is uri data[i].getasstring(function (s){ console.log("...
DedicatedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
... windowbase64.btoa() creates a base-64 encoded ascii string from a string of binary data.
DirectoryReaderSync - Web APIs
you can do that by passing a list of filesystem: urls—which are just strings—instead of a list of entries.
...function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command.
Document.URL - Web APIs
WebAPIDocumentURL
the url read-only property of the document interface returns the document location as a string.
... living standard defines that the property is a usvstring instead of a domstring.
Document.createAttribute() - Web APIs
the string given in parameter is converted to lowercase.
... syntax attribute = document.createattribute(name) parameters name is a string containing the name of the attribute.
Document.createCDATASection() - Web APIs
data is a string containing the data to be added to the cdata section.
... example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml') var cdata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err.
Document.createComment() - Web APIs
syntax commentnode = document.createcomment(data); parameters data a string containing the data to be added to the comment.
... example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml'); var comment = docu.createcomment('this is a not-so-secret comment in your document'); docu.getelementsbytagname('xml')[0].appendchild(comment); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><!--this is a not-so-secret comment in your document--></xml> specifications specification status comment domthe definition of 'document.createcomment' in that specification.
Document.createElement() - Web APIs
syntax let element = document.createelement(tagname[, options]); parameters tagname a string that specifies the type of element to be created.
... note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
Document.createEvent() - Web APIs
type is a string that represents the type of event to be created.
...elem.dispatchevent(event); notes event type strings suitable for passing to createevent() are listed in the dom standard — see the table in step 2.
Document.createProcessingInstruction() - Web APIs
target is a string containing the first part of the processing instruction (i.e., <?target … ?>) data is a string containing any information the processing instruction should carry, after the target.
... example var doc = new domparser().parsefromstring('<foo />', 'application/xml'); var pi = doc.createprocessinginstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'); doc.insertbefore(pi, doc.firstchild); console.log(new xmlserializer().serializetostring(doc)); // displays: <?xml-stylesheet href="mycss.css" type="text/css"?><foo/> specifications specification status comment domthe definition of 'createp...
Document.domain - Web APIs
WebAPIDocumentdomain
syntax const domainstring = document.domain document.domain = domainstring value the domain portion of the current document's origin.
... inside a sandboxed <iframe> the document has no browsing context the document's effective domain is null the given value is not equal to the document's effective domain (or it is not a registerable domain suffix of it) the document-domain feature-policy is enabled examples getting the domain for the uri http://developer.mozilla.org/docs/web, this example sets currentdomain to the string "developer.mozilla.org".
Document.enableStyleSheetsForSet() - Web APIs
specify an empty string for the name parameter to disable all alternate and preferred style sheets (but not the persistent style sheets; that is, those with no title attribute).
... 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.
Document.getElementById() - Web APIs
the document method getelementbyid() returns an element object representing the element whose id property matches the specified string.
...the id is case-sensitive string which is unique within the document; only one element may have any given id.
Document.getElementsByTagName() - Web APIs
name is a string representing the name of the elements.
... the special string "*" represents all elements.
Document.referrer - Web APIs
WebAPIDocumentreferrer
syntax var referrer = document.referrer; value the value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark).
... because this property returns only a string, it doesn't give you document object model (dom) access to the referring page.
Document.title - Web APIs
WebAPIDocumenttitle
syntax var doctitle = document.title; doctitle is a string containing the document's title.
... in xul, accessing document.title before the document is fully loaded has undefined behavior: document.title may return an empty string and setting document.title may have no effect.
Document.write() - Web APIs
WebAPIDocumentwrite
the document.write() method writes a string of text to a document stream opened by document.open().
... syntax document.write(markup); parameters markup a string containing the text to be written to the document.
Document.writeln() - Web APIs
WebAPIDocumentwriteln
writes a string of text followed by a newline character to a document.
... syntax document.writeln(line); parameters line is string containing a line of text.
DocumentFragment.querySelector() - Web APIs
syntax element = documentfragment.queryselector(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas.
... 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.
Document Object Model (DOM) - Web APIs
dom interfaces attr cdatasection characterdata childnode comment customevent document documentfragment documenttype domerror domexception domimplementation domstring domtimestamp domstringlist domtokenlist element event eventtarget htmlcollection mutationobserver mutationrecord namednodemap node nodefilter nodeiterator nodelist nondocumenttypechildnode parentnode processinginstruction selection range text textdecoder textencoder timeranges treewalker url window worker xmldocument obsolete dom interfaces the document obj...
...svgpathsegarcabs svgpathsegarcrel svgpathseglinetohorizontalabs svgpathseglinetohorizontalrel svgpathseglinetoverticalabs svgpathseglinetoverticalrel svgpathsegcurvetocubicsmoothabs svgpathsegcurvetocubicsmoothrel svgpathsegcurvetoquadraticsmoothabs svgpathsegcurvetoquadraticsmoothrel svgpathseglist svgpoint svgpointlist svgpreserveaspectratio svgrect svgstringlist svgtransform svgtransformlist animated type svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlist svganimatedpathdata svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimatedstring svganimatedtransformlist smil-related interfaces elementtim...
EcKeyGenParams - Web APIs
properties name a domstring.
... namedcurve a domstring representing the name of the elliptic curve to use.
EcKeyImportParams - Web APIs
properties name a domstring.
... namedcurve a domstring representing the name of the elliptic curve to use.
EcdsaParams - Web APIs
properties name a domstring.
... hash a domstring.
EffectTiming.easing - Web APIs
syntax var timingproperties = { easing: single-transition-timing-function } timingproperties.easing = single-transition-timing-function value a string defining the timing function to use for easing transitions during the animation process.
... accepts several pre-defined domstring values, a steps() timing function like steps(5, end), or a custom cubic-bezier value like cubic-bezier(0.42, 0, 0.58, 1).
Element.className - Web APIs
WebAPIElementclassName
syntax var cname = elementnodereference.classname; elementnodereference.classname = cname; cname is a string variable representing the class or space-separated classes of the current element.
... classname can also be an instance of svganimatedstring if the element is an svgelement.
Element.getAttributeNodeNS() - Web APIs
namespace is a string specifying the namespace of the attribute.
... nodename is a string specifying the name of the attribute.
Element.insertAdjacentHTML() - Web APIs
syntax element.insertadjacenthtml(position, text); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself.
... text the string to be parsed as html or xml and inserted into the tree.
Element.removeAttributeNS() - Web APIs
syntax element.removeattributens(namespace, attrname); parameters namespace is a string that contains the namespace of the attribute.
... attrname is a string that names the attribute to be removed from the current node.
Element.tagName - Web APIs
WebAPIElementtagName
syntax elementname = element.tagname; value a string indicating the element's tag name.
... this string's capitalization depends on the document type: for dom trees which represent html documents, the returned tag name is always in the canonical upper-case form.
ErrorEvent - Web APIs
errorevent.message read only is a domstring containing a human-readable error message describing the problem.
... errorevent.filename read only is a domstring containing the name of the script file in which the error occurred.
Event.type - Web APIs
WebAPIEventtype
the type read-only property of the event interface returns a string containing the event's type.
... syntax let eventtype = event.type; value a domstring containing the type of event.
EventSource.url - Web APIs
WebAPIEventSourceurl
the url read-only property of the eventsource interface returns a domstring representing the url of the source.
... syntax var myurl = eventsource.url; value a domstring representing the url of the source.
ExtendableMessageEvent.lastEventId - Web APIs
this is an empty string.
... syntax var mylasteventid = extendablemessageevent.lasteventid; value a domstring.
FederatedCredential.protocol - Web APIs
the protocol property of the federatedcredential interface returns a read-only domstring containing a credential's federated identity protocol.
... syntax var protocol = federatedcredential.protocol value a domstring containing a credential's federated identity protocol (e.g.
FederatedCredential.provider - Web APIs
the provider property of the federatedcredential interface returns a usvstring containing a credential's federated identity provider.
... syntax var provider = federatedcredential.provider value a usvstring containing a credential's federated identity provider.
FederatedCredential - Web APIs
federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider.
... federatedcredential.protocol read only returns a domstring containing a credential's federated identity protocol.
FetchEvent.resultingClientId - Web APIs
if the fetch request is a subresource request or the request's destination is report, resultingclientid will be an empty string.
... syntax var myresultingclientid = fetchevent.resultingclientid; value a domstring.
File.type - Web APIs
WebAPIFiletype
syntax var name = file.type; value a string, containing the media type(mime) indicating the type of the file, for example "image/png" for png images example <input type="file" multiple onchange="showtype(this)"> function showtype(fileinput) { var files = fileinput.files; for (var i = 0; i < files.length; i++) { var name = files[i].name; var type = files[i].type; alert("filename: " + name + " , type: " + type); } } note: based on the current implementation, browsers won't actually read the bytestream of a file to determine its media type.
...uncommon file extensions would return an empty string.
File.webkitRelativePath - Web APIs
the file.webkitrelativepath is a read-only property that contains a usvstring which specifies the file's path relative to the directory selected by the user in an <input> element with its webkitdirectory attribute set.
... syntax relativepath = file.webkitrelativepath value a usvstring containing the path of the file relative to the ancestor directory the user selected.
FileReader.readAsText() - Web APIs
when the read operation is complete, the readystate is changed to done, the loadend event is triggered, and the result property contains the contents of the file as a text string.
... encoding optional a string specifying the encoding to use for the returned data.
FileReader - Web APIs
filereader.readasbinarystring() starts reading the contents of the specified blob, once finished, the result attribute contains the raw binary data from the file as a string.
... filereader.readastext() starts reading the contents of the specified blob, once finished, the result attribute contains the contents of the file as a text string.
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.
... return value an domstring representing the input data as a data url.
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.
... return value an domstring representing the input data.
FileSystem.name - Web APIs
WebAPIFileSystemname
this usvstring is unique among all file systems currently exposed by the file and directory entries api.
... syntax var fsname = filesystem.name; value a usvstring representing the file system's name.
FileSystemEntry.fullPath - Web APIs
the read-only fullpath property of the filesystementry interface returns a usvstring specifying the full, absolute path from the file system's root to the file represented by the entry.
... syntax var fullpath = filesystementry.fullpath; value a usvstring indicating the entry's full path.
FileSystemEntry.name - Web APIs
the read-only name property of the filesystementry interface returns a usvstring specifying the entry's name; this is the entry within its parent directory (the last component of the path as indicated by the fullpath property).
... syntax var name = filesystementry.name; value a usvstring indicating the entry's name.
FileSystemEntry - Web APIs
fullpath read only a usvstring object which provides the full, absolute path from the file system's root to the entry; it can also be thought of as a path which is relative to the root directory, prepended with a "/" character.
... name read only a usvstring containing the name of the entry (the final part of the path, after the last "/" character).
FileSystemFileEntry.file() - Web APIs
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.
...the filereader's load event handler is set up to deliver the loaded string to the successcallback specified when the readfile() method was called; similarly, its error handler is set up to call the errorcallback specified.
Using FormData Objects - Web APIs
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).
Gamepad - Web APIs
WebAPIGamepad
gamepad.id read only a domstring containing identifying information about the controller.
... gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout.
GeolocationPositionError.message - Web APIs
the geolocationpositionerror.message read-only property returns a human-readable domstring describing the details of the error.
... syntax let msg = geolocationpositionerrorinstance.message value a human-readable domstring describing the details of the error.
HTMLBaseElement - Web APIs
htmlbaseelement.href is a domstring that reflects the href html attribute, containing a base url for relative urls in the document.
... htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.
HTMLCanvasElement.getContext() - Web APIs
syntax var ctx = canvas.getcontext(contexttype); var ctx = canvas.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas.
... (blink only) storage: string that indicates which storage is used ("persistent" by default).
HTMLCanvasElement.mozGetAsFile() - Web APIs
syntax canvas.mozgetasfile(name, type); parameters name a domstring indicating the file name to give the file representing the image file in memory.
... type optional a domstring which specifies the image file format to use when creating the new image file.
HTMLDataElement.value - Web APIs
the value property of the htmldataelement interface returns a domstring reflecting the value html attribute.
... syntax var avalue = htmldataelement.value htmldataelement.value = avalue value a domstring.
HTMLDialogElement.close() - Web APIs
an optional domstring may be passed as an argument, updating the returnvalue of the the dialog.
... syntax dialoginstance.close(returnvalue); parameters returnvalue optional a domstring representing an updated value for the htmldialogelement.returnvalue of the dialog.
HTMLDialogElement - Web APIs
htmldialogelement.returnvalue a domstring that sets or returns the return value for the dialog.
...an optional domstring may be passed as an argument, updating the returnvalue of the the dialog.
HTMLElement.dir - Web APIs
WebAPIHTMLElementdir
syntax var currentwritingdirection = elementnodereference.dir; elementnodereference.dir = newwritingdirection; currentwritingdirection is a string variable representing the text writing direction of the current element.
... newwritingdirection is a string variable representing the text writing direction value.
HTMLElement.lang - Web APIs
WebAPIHTMLElementlang
syntax var languageused = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written.
... newlanguage is a string variable with its value setting the language in which the text of the current element is written.
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format.
... the format of the string must follow one of the following html microsyntaxes: microsyntax description examples valid name color string nameofcolor (case insensitive) green green green valid hex color string in rgb format: #rrggbb #008000 rgb using decimal values rgb(x,x,x) (x in 0-255 range) rgb(0,128,0) syntax colorstring = fontobj.color; fontobj.color = colorstring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.color = "green"; specifications the <font> tag is not supported in html5 and as a result neither is <font>.color.
HTMLFontElement.face - Web APIs
the obsolete htmlfontelement.face property is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names.
... the format of the string must follow one of the following html microsyntax: microsyntax description examples list of one or more valid font family names a list of font names, that have to be present on the local system courier,verdana syntax facestring = fontobj.face; fontobj.face = facestring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.face = "arial"; specifications the <font> tag is not supported in html5 and as a result neither is <...
HTMLFontElement.size - Web APIs
the obsolete htmlfontelement.size property is a domstring that reflects the size html attribute.
... the format of the string must follow one of the following html microsyntaxes: microsyntax description examples valid size number string integer number in the range of 1-7 6 relative size string +x or -x, where x is the number relative to the value of the size attribute of the <basefont> element (the result should be in the same range of 1-7) +2 -1 syntax sizestring = fontobj.size; fontobj.size = sizestring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.size = "6"; specifications the <font> tag is not supporte...
HTMLFormControlsCollection.namedItem() - Web APIs
like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value").
... syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null.
HTMLFormElement.name - Web APIs
the htmlformelement.name property represents the name of the current <form> element as a string.
... syntax var string = form.name; form.name = string; example var form1name = document.getelementbyid('form1').name; if (form1name != document.form.form1) { // browser doesn't support this form of reference } specifications specification status comment html living standardthe definition of 'htmlformelement: name' in that specification.
HTMLFrameSetElement - Web APIs
htmlframesetelement.cols is a domstring structured as a comma-seperated list specifing the width of each column inside a frameset.
... htmlframesetelement.rows is a domstring structured as a comma-seperated list specifing the height of each column inside a frameset.
HTMLHyperlinkElementUtils.host - Web APIs
the htmlhyperlinkelementutils.host property is a usvstring containing the host, that is the hostname, and then, if the port of the url is nonempty, a ':', and the port of the url.
... syntax string = object.host; object.host = string; examples var anchor = document.createelement("a"); anchor.href = "https://developer.mozilla.org/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.host' in that specification.
HTMLHyperlinkElementUtils.hostname - Web APIs
the htmlhyperlinkelementutils.hostname property is a usvstring containing the domain of the url.
... syntax string = object.hostname; object.hostname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.hostname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.hostname; // returns:'developer.mozilla.org' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.hostname' in that specification.
HTMLHyperlinkElementUtils.href - Web APIs
the htmlhyperlinkelementutils.href property is a stringifier that returns a usvstring containing the whole url, and allows the href to be updated.
... syntax string = object.href; object.href = string; examples // lets imagine an <a id="myanchor" href="https://developer.mozilla.org/htmlhyperlinkelementutils/href"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.href; // returns: 'https://developer.mozilla.org/htmlhyperlinkelementutils/href' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.href' in that specification.
HTMLHyperlinkElementUtils.origin - Web APIs
the htmlhyperlinkelementutils.origin read-only property is a usvstring containing the unicode serialization of the origin of the represented url; that is: for url using the http or https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified); for url using file: scheme, the value is browser dependant; for url using the blob: scheme, the origin of the url following blob:.
... syntax string = object.origin; examples // on this page, returns the origin var result = window.location.origin; // returns:'https://developer.mozilla.org' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.origin' in that specification.
HTMLHyperlinkElementUtils.password - Web APIs
the htmlhyperlinkelementutils.password property is a usvstring containing the password specified before the domain name.
... syntax string = object.password; object.password = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/htmlhyperlinkelementutils.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.password; // returns:'flabada' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.password' in that specification.
HTMLHyperlinkElementUtils.pathname - Web APIs
the htmlhyperlinkelementutils.pathname property is a usvstring containing an initial '/' followed by the path of the url (or the empty string if there is no path).
... syntax string = object.pathname; object.pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.pathname; // returns:'/docs/htmlhyperlinkelementutils.pathname' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.pathname' in that specification.
HTMLHyperlinkElementUtils.port - Web APIs
the htmlhyperlinkelementutils.port property is a usvstring containing the port number of the url.
... syntax string = object.port; object.port = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org:443/docs/htmlhyperlinkelementutils.port"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.port; // returns:'443' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.port' in that specification.
HTMLHyperlinkElementUtils.protocol - Web APIs
the htmlhyperlinkelementutils.protocol property is a usvstring representing the protocol scheme of the url, including the final ':'.
... syntax string = object.protocol; object.protocol = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/htmlhyperlinkelementutils.protocol"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.protocol; // returns:'https:' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.protocol' in that specification.
HTMLHyperlinkElementUtils.username - Web APIs
the htmlhyperlinkelementutils.username property is a usvstring containing the username specified before the domain name.
... syntax string = object.username; object.username = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/htmlhyperlinkelementutils.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.username; // returns:'anonymous' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.username' in that specification.
HTMLImageElement.align - Web APIs
the obsolete align property of the htmlimageelement interface is a string which indicates how to position the image relative to its container.
... syntax htmlimageelement.align = alignmode; alignmode = htmlimageelement.align; value a domstring specifying one of the following strings which set the alignment mode for the image.
HTMLImageElement.border - Web APIs
syntax htmlimageelement.border = thickness; let thickness = htmlimageelement.border; value a domstring containing an integer value specifying the thickness of the border that should surround the image, in css pixels.
... a value of 0, or an empty string, indicates that there should be no border drawn.
HTMLImageElement.loading - Web APIs
the htmlimageelement property loading is a string whose value provides a hint to the user agent that tells the browser how to handle loading images which are currently outside the window's visual viewport.
... syntax let imageloadscheduling = htmlimageelement.loading; htmlimageelement.loading = eagerorlazy; value a domstring providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.
HTMLImageElement.sizes - Web APIs
syntax let sizes = htmlimageelement.sizes; htmlimageelement.sizes = sizes; value a usvstring containing a comma-separated list of source size descriptors followed by an optional fallback size.
... 1.5em; font: 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.
HTMLLegendElement - Web APIs
htmllegendelement.accesskey is a domstring representing a single-character access key to give access to the element.
... htmllegendelement.align is a domstring representing the alignment relative to the form set methods no specific method; inherits methods from its parent, htmlelement.
HTMLLinkElement.as - Web APIs
the as property of the htmllinkelement interface returns a domstring representing the type of content being loaded by the html link, one of "script", "style", "image", "video", "audio", "track", "font", "fetch".
... syntax var as = htmllinkelement.as htmllinkelement.as = as value a domstring.
HTMLMediaElement.currentSrc - Web APIs
the value is an empty string if the networkstate property is empty.
... syntax var mediaurl = audioobject.currentsrc; value a domstring object containing the absolute url of the chosen media source; this may be an empty string if networkstate is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is provided.
HTMLMediaElement.sinkId - Web APIs
the htmlmediaelement.sinkid read-only property returns a domstring that is the unique id of the audio device delivering output.
... if it is using the user agent default, it returns an empty string.
HTMLModElement - Web APIs
htmlmodelement.cite is a domstring reflecting the cite html attribute, containing a uri of a resource explaining the change.
... htmlmodelement.datetime is a domstring reflecting the datetime html attribute, containing a date-and-time string representing a timestamp for the change.
HTMLObjectElement.data - Web APIs
the data property of the htmlobjectelement interface returns a domstring that reflects the data html attribute, specifying the address of a resource's data.
... syntax var data = htmlobjectelement.data; htmlobjectelement.data; value a domstring.
HTMLObjectElement.height - Web APIs
the height property of the htmlobjectelement interface returns a domstring that reflects the height html attribute, specifying the displayed height of the resource in css pixels.
... syntax var string = htmlobjectelement.height; htmlobjectelement.height = string; value a domstring.
HTMLObjectElement.name - Web APIs
the name property of the htmlobjectelement interface returns a domstring that reflects the name html attribute, specifying the name of the browsing context.
... syntax var string = htmlobjectelement.name; htmlobjectelement.name = string; value a domstring.
HTMLObjectElement.type - Web APIs
the type property of the htmlobjectelement interface returns a domstring that reflects the type html attribute, specifying the mime type of the resource.
... syntax var string = htmlobjectelement.type htmlobjectelement.type = string; value a domstring.
HTMLObjectElement.useMap - Web APIs
the usemap property of the htmlobjectelement interface returns a domstring that reflects the usemap html attribute, specifying a <map> element to use.
... syntax var string = htmlobjectelement.usemap; htmlobjectelement.usemap = string; value a domstring.
HTMLObjectElement.width - Web APIs
the width property of the htmlobjectelement interface returns a domstring that reflects the width html attribute, specifying the displayed width of the resource in css pixels.
... syntax var string = htmlobjectelement.width; htmlobjectelement.width = string; value a domstring.
HTMLSelectElement.namedItem() - Web APIs
in javascript, using the array bracket syntax with a string, like selectelt["value"] is equivalent to selectelt.nameditem("value").
... syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring.
HTMLSelectElement.setCustomValidity() - Web APIs
use the empty string to indicate that the element does not have a custom validity error.
... syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message.
HTMLStyleElement - Web APIs
htmlstyleelement.media is a domstring representing the intended destination medium for style information.
... htmlstyleelement.type is a domstring representing the type of style being applied by this statement.
HTMLTableElement.frame - Web APIs
the htmltableelement interface's frame property is a string that indicates which of the table's exterior borders should be drawn.
... syntax htmltableelement.frame = framesides; var framesides = htmltableelement.frame; parameters framesides is a string whose value is one of the following values: void no sides.
History.pushState() - Web APIs
WebAPIHistorypushState
passing the empty string here should be safe against future changes to the method.
...with the hash-based approach, you need to encode all of the relevant data into a short string.
Working with the History API - Web APIs
passing the empty string here should be safe against future changes to the method.
...with the hash-based approach, you need to encode all of the relevant data into a short string.
HkdfParams - Web APIs
properties name a domstring.
... hash a domstring representing the digest algorithm to use.
HmacImportParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
HmacKeyGenParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
IDBCursor.direction - Web APIs
the direction read-only property of the idbcursor interface is a domstring that returns the direction of traversal of the cursor (set using idbobjectstore.opencursor for example).
... syntax var direction = cursor.direction; value a string (defined by the idbcursordirection enum) indicating the direction in which the cursor is traversing the data.
IDBDatabase.name - Web APIs
WebAPIIDBDatabasename
the name read-only property of the idbdatabase interface is a domstring that contains the name of the connected database.
... syntax var dbname = idbdatabase.name; value a domstring containing the name of the connected database.
IDBDatabase.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbdatabase interface is a domstringlist containing a list of the names of the object stores currently in the connected database.
... syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database.
IDBDatabase.transaction() - Web APIs
storenames the names of object stores that are in the scope of the new transaction, declared as an array of strings.
... if you need to access only one object store, you can specify its name as a string.
IDBIndex.name - Web APIs
WebAPIIDBIndexname
the name property of the idbindex interface contains a string which names the index.
... syntax var indexname = idbindex.name; idbindex.name = indexname; value a domstring specifying a name for the index.
IDBTransaction.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbtransaction interface returns a domstringlist of names of idbobjectstore objects.
... syntax var mydatabase = transactionobj.objectstorenames; returns a domstringlist of names of idbobjectstore objects.
IDBTransaction - Web APIs
idbtransaction.objectstorenames read only returns a domstringlist of the names of idbobjectstore objects associated with the transaction.
...you should use the string constants directly instead.
IDBTransactionSync - Web APIs
method overview void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
... idbobjectstoresync objectstore( in domstring name ) raises (idbdatabaseexception); parameters name the name of the requested object store.
InputEvent - Web APIs
inputevent.dataread only returns a domstring with the inserted characters.
... this may be an empty string if the change doesn't insert text (such as when deleting characters, for example).
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 version registry for the component whose version is to be compared.
... version an installversion object containing version information or a string in the format major.minor.release.build, where major, minor, release, and build are integer values representing version information.
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.
... example the following example demonstrates how to get the location- or layout-specific string associated with the key that corresponds to the 'w' key on an english qwerty keyboard.
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.
... example the following example demonstrates how to get the location- or layout-specific string associated with the key that corresponds to the 'w' key on an english qwerty keyboard.
KeyboardEvent.initKeyEvent() - Web APIs
syntax event.initkeyevent (type, bubbles, cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event.
... the initkeyevent is the current gecko equivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following arguments : typearg of type domstring canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifierslist of type domstring); ...
KeyboardLayoutMap - Web APIs
the keyboardlayoutmap interface of the the keyboard api is a map-like object with functions for retrieving the string associated with specific physical keys.
... examples the following example demonstrates how to get the location- or layout-specific string associated with the key that corresponds to the 'w' key on an english qwerty keyboard.
LocalFileSystem - Web APIs
window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
... void resolvelocalfilesystemurl( in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback ); parameters url the url of a local file in the file system.
LocalFileSystemSync - Web APIs
method overview filesystemsync requestfilesystemsync (in unsigned short type, in long long size) raises fileexception; entrysync resolvelocalfilesystemsyncurl (in domstring url) raises fileexception; constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
... void resolvelocalfilesystemurl( in domstring url ); parameter url the url of a local file in the file system.
Location: host - Web APIs
WebAPILocationhost
the host property of the location interface is a usvstring containing the host, that is the hostname, and then, if the port of the url is nonempty, a ':', and the port of the url.
... syntax string = object.host; object.host = string; examples var anchor = document.createelement("a"); anchor.href = "https://developer.mozilla.org/location.host" anchor.host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/location.host" anchor.host == "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/location.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment html living standardthe definition of 'host' in that specification.
Location: hostname - Web APIs
WebAPILocationhostname
the hostname property of the location interface is a usvstring containing the domain of the url.
... syntax string = object.hostname; object.hostname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/location.hostname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.hostname; // returns:'developer.mozilla.org' specifications specification status comment html living standardthe definition of 'hostname' in that specification.
Location: href - Web APIs
WebAPILocationhref
the href property of the location interface is a stringifier that returns a usvstring containing the whole url, and allows the href to be updated.
... syntax string = object.href; object.href = string; examples // lets imagine an <a id="myanchor" href="https://developer.mozilla.org/location/href"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.href; // returns: 'https://developer.mozilla.org/location/href' specifications specification status comment html living standardthe definition of 'href' in that specification.
Location: origin - Web APIs
WebAPILocationorigin
the origin read-only property of the location interface is a usvstring containing the unicode serialization of the origin of the represented url; that is: for url using the http or https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified); for url using file: scheme, the value is browser dependant; for url using the blob: scheme, the origin of the url following blob:.
... syntax string = object.origin; examples // on this page, returns the origin var result = window.location.origin; // returns:'https://developer.mozilla.org' specifications specification status comment html living standardthe definition of 'origin' in that specification.
Location: password - Web APIs
WebAPILocationpassword
the password property of the location interface is a usvstring containing the password specified before the domain name.
... syntax string = object.password; object.password = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/location.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.password; // returns:'flabada' ...
Location: pathname - Web APIs
WebAPILocationpathname
the pathname property of the location interface is a usvstring containing an initial '/' followed by the path of the url (or the empty string if there is no path).
... syntax string = object.pathname; object.pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/location.pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.pathname; // returns:'/docs/location.pathname' specifications specification status comment html living standardthe definition of 'pathname' in that specification.
Location: port - Web APIs
WebAPILocationport
the port property of the location interface is a usvstring containing the port number of the url.
... syntax string = object.port; object.port = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org:443/docs/location.port"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.port; // returns:'443' specifications specification status comment html living standardthe definition of 'location.port' in that specification.
Location: protocol - Web APIs
WebAPILocationprotocol
the protocol property of the location interface is a usvstring representing the protocol scheme of the url, including the final ':'.
... syntax string = object.protocol; object.protocol = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/location.protocol"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.protocol; // returns:'https:' specifications specification status comment html living standardthe definition of 'protocol' in that specification.
Location: username - Web APIs
WebAPILocationusername
the username property of the location interface is a usvstring containing the username specified before the domain name.
... syntax string = object.username; object.username = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/location.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.username; // returns:'anonymous' ...
MSManipulationEvent.initMSManipulationEvent() - Web APIs
syntax msmanipulationevent.initmsmanipulationevent(typearg, canbubblearg, cancelablearg, viewarg, detailarg, laststate, currentstate); parameters typearg [in] type: domstring the type of the event being created.
... example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; readonly inertiadestinationy: number; readonly laststate: number; initmsmanipulationevent(typearg: string, canbubblearg: boolean, cancelablearg: boolean, viewarg: window, detailarg: number, laststate: number, currentstate: number): void; readonly ms_manipulation_state_active: number; readonly ms_manipulation_state_cancelled: number; readonly ms_manipulation_state_committed: number; readonly ms_manipulation_state_dragging: number; readonly ms_manipulation_state_inertia: number; ...
MediaDeviceInfo.deviceId - Web APIs
the deviceid readonly property of the mediadeviceinfo interface returns a domstring that is an identifier for the represented device and is persisted across sessions.
... syntax var deviceid = mediadeviceinfo.deviceid value a domstring.
MediaDeviceInfo.groupId - Web APIs
the groupid readonly property of the mediadeviceinfo interface returns a domstring that is a group identifier.
... syntax var groupid = mediadeviceinfo.groupid; value a domstring which uniquely identifies the group of related devices to which this device belongs.
MediaError - Web APIs
mediaerror.message a domstring object containing a human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diagnostic information to help in understanding what exactly went wrong.
...if no diagnostics are available, or no explanation can be provided, this value is an empty string ("").
MediaList - Web APIs
WebAPIMediaList
properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist.
... medialist.item() a getter that returns a cssomstring representing a media query as text, given the media query's index value inside the medialist.
MediaQueryList.media - Web APIs
the media read-only property of the mediaquerylist interface is a domstring representing a serialized media query.
... syntax var media = mediaquerylist.media; value a domstring representing a serialized media query.
MediaQueryListEvent.media - Web APIs
the media read-only property of the mediaquerylistevent interface is a domstring representing a serialized media query.
... syntax var media = mediaquerylistevent.media; value a domstring representing a serialized media query.
MediaSource.addSourceBuffer() - Web APIs
syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource.
... exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type.
MediaStreamTrack.kind - Web APIs
the mediastreamtrack.kind read-only property returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track.
... syntax const type = track.kind value the possible values are a domstring with on of the following values: "audio": the track is an audio track.
MediaStreamTrack.label - Web APIs
the mediastreamtrack.label read-only property returns a domstring containing a user agent-assigned label that identifies the track source, as in "internal microphone".
... the string may be left empty and is empty as long as no source has been connected.
Recording a media element - Web APIs
function log(msg) { logelement.innerhtml += msg + "\n"; } the log() function is used to output text strings to a <div> so we can share information with the user.
...while the download attribute can be a boolean, you can also set it to a string to use as the name for the downloaded file.
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the captured video.
... syntax var constraintsobject = { cursor: constraint }; constraintsobject.cursor = constraint; value a constraindomstring which specifies whether or not the mouse cursor should be rendered into the video track in the mediastream returned by the call to getdisplaymedia().
MediaTrackConstraints.deviceId - Web APIs
the mediatrackconstraints dictionary's deviceid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the deviceid constrainable property.
... syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content.
MediaTrackConstraints.displaySurface - Web APIs
the mediatrackconstraints dictionary's displaysurface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the displaysurface constrainable property.
... syntax var constraintsobject = { displaysurface: constraint }; constraintsobject.displaysurface = constraint; value a constraindomstring which specifies the type of display surface that's being captured.
MediaTrackConstraints.groupId - Web APIs
the mediatrackconstraints dictionary's groupid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the groupid constrainable property.
... syntax var constraintsobject = { groupid: constraint }; constraintsobject.groupid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) group ids which are acceptable as the source of media content.
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.
... while the mime type is fairly simple to figure out, we can get the codec string using the mp4info utility.
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.
MerchantValidationEvent.validationURL - Web APIs
the merchantvalidationevent property validationurl is a read-only string value providing the url from which to fetch the payment handler-specific data needed to validate the merchant.
... syntax validationurl = merchantvalidationevent.validationurl; value a read-only usvstring giving the url from which to load payment handler specific data needed to complete the merchant verification process.
MessageEvent.lastEventId - Web APIs
the lasteventid read-only property of the messageevent interface is a domstring representing a unique id for the event.
... syntax var myid = messageevent.lasteventid; value a domstring representing the id.
MessageEvent.origin - Web APIs
the origin read-only property of the messageevent interface is a usvstring representing the origin of the message emitter.
... syntax var origin = messageevent.origin; value a usvstring representing the origin.
MessageEvent - Web APIs
messageevent.origin read only a usvstring representing the origin of the message emitter.
... messageevent.lasteventid read only a domstring representing a unique id for the event.
MouseEvent() - Web APIs
syntax event = new mouseevent(typearg, mouseeventinit); values typearg is a domstring representing the name of the event.
... "region", optional and defaulting to null, of type domstring, is the id of the hit region affected by the event.
MutationObserverInit.attributeFilter - Web APIs
the mutationobserverinit dictionary's optional attributefilter property is an array of strings specifying the names of the attributes whose values are to be monitored for changes.
... syntax var options = { attributefilter: [ "list", "of", "attribute", "names" ] } value an array of domstring objects, each specifying the name of one attribute whose value is to be monitored for changes.
NDEFRecord.encoding - Web APIs
the encoding property ofthe ndefrecord interface is usvstring containing the name of the encoding used to encode ndef payload if it contains textual data.
... syntax ndefrecord.encoding value a usvstring which can be one of the following: "utf-8", "utf-16", "utf-16le" or "utf-16be".
NDEFRecord.id - Web APIs
WebAPINDEFRecordid
the id property ofthe ndefrecord interface is usvstring containing the record identifier.
... syntax ndefrecord.id value a usvstring.
NDEFRecord.lang - Web APIs
WebAPINDEFRecordlang
the lang property ofthe ndefrecord interface is usvstring containing the language tag of the record contents, if it is a vailable.
... syntax ndefrecord.lang value a usvstring.
NDEFRecord.mediaType - Web APIs
the mediatype property ofthe ndefrecord interface is usvstring containing the mime type of the record payload.
... syntax ndefrecord.mediatype value a usvstring, corresponding to a mime type of the record payload.
NDEFRecord.recordType - Web APIs
the recordtype property ofthe ndefrecord interface is usvstring containing the ndef record type.
... syntax ndefrecord.recordtype value a usvstring which can be one of the following: "empty" represents a empty ndef record.
NameList - Web APIs
WebAPINameList
namelist.getname() returns a domstring.
... namelist.getnamespaceuri() returns a domstring.
Navigator.requestMediaKeySystemAccess() - Web APIs
syntax ​promise = navigator.requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a domstring identifying the key system.
... typeerror either keysystem is an empty string or the supportedconfigurations array is empty.
Navigator.vendor - Web APIs
WebAPINavigatorvendor
the value of the navigator vendor property is always either "google inc.", "apple computer, inc.", or (in firefox) the empty string.
... syntax venstring = window.navigator.vendor value either "google inc.", "apple computer, inc.", or (in firefox) the empty string.
Navigator.vendorSub - Web APIs
the value of the navigator.vendorsub property is always the empty string, in any browser.
... syntax vensub = window.navigator.vendorsub value the empty string specifications specification status comment html living standardthe definition of 'navigatorid: vendorsub' in that specification.
NavigatorLanguage - Web APIs
navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui.
... navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference.
Node.nodeName - Web APIs
WebAPINodenodeName
the nodename read-only property returns the name of the current node as a string.
... syntax var str = node.nodename; value a domstring.
Node.textContent - Web APIs
WebAPINodetextContent
syntax let text = somenode.textcontent someothernode.textcontent = string value a string or null description the value of textcontent depends on the situation: if the node is a document or a doctype, textcontent returns null.
...(this is an empty string if the node has no children.) setting textcontent on a node removes all of the node's children and replaces them with a single text node with the given string value.
Notation - Web APIs
WebAPINotation
properties notation.publicid read only is a domstring.
... notation.systemid read only is a domstring.
Notification.body - Web APIs
WebAPINotificationbody
the body read-only property of the notification interface indicates the body string of the notification, as specified in the body option of the notification() constructor.
... syntax var body = notification.body; value a domstring.
Notification.lang - Web APIs
WebAPINotificationlang
the language itself is specified using a domstring representing a bcp 47 language tag.
... syntax var language = notification.lang; value a domstring specifying the language tag.
Notification.requestPermission() - Web APIs
returns a promise that resolves to a domstring with the permission picked by the user.
... possible values for this string are: granted denied default examples assume this basic html: <button onclick="notifyme()">notify me!</button> it's possible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification.
Notification - Web APIs
notification.permission read only a string representing the current permission to display notifications.
... notification.body read only the body string of the notification as specified in the constructor's options parameter.
NotificationEvent - Web APIs
notificationevent.action read only returns the string id of the notification button the user clicked.
... this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button.
OffscreenCanvas.getContext() - Web APIs
syntax offscreen.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas.
... (blink only) storage: string that indicates which storage is used ("persistent" by default).
ParentNode.replaceChildren() - Web APIs
these can be domstring or node objects.
... syntax // [throws, unscopable] parentnode.replacechildren(...nodesordomstrings) // returns undefined parameters nodesordomstrings a set of node or domstring objects to replace the parentnode's existing children with.
PasswordCredential.iconURL - Web APIs
the iconurl read-only property of the passwordcredential interface returns a usvstring containing a url pointing to an image for an icon.
... syntax url =passwordcredential.iconurl value a usvstring containing a url.
PasswordCredential.idName - Web APIs
the idname property of the passwordcredential interface returns a usvstring, representing the name that will be used for the id field, when submitting the current object to a remote endpoint via fetch.
... syntax var idname = passwordcredential.idname passwordcredential.idname = "userid" value a usvstring represents the name used for the id field, when submitting the current object to a remote endpoint via fetch.
PasswordCredential.name - Web APIs
the name read-only property of the passwordcredential interface returns a usvstring containing a human-readable public name for display in a credential chooser.
... syntax name =passwordcredential.name value a usvstring containing a name.
PasswordCredential.password - Web APIs
the password read-only property of the passwordcredential interface returns a usvstring containing the password of the credential.
... syntax password =passwordcredential.password value a usvstring containing a password.
PasswordCredential.passwordName - Web APIs
the passwordname property of the passwordcredential interface returns a usvstring, depicting the name used by the password field, when submitting the current object to a remote endpoint via fetch.
... syntax var passwordname = passwordcredential.passwordname passwordcredential.passwordname = "passcode" value a usvstring representing the password field name, used when submitting the current object to a remote endpoint via fetch.
Path2D() - Web APIs
WebAPIPath2DPath2D
the path2d() constructor returns a newly instantiated path2d object, optionally with another path as an argument (creates a copy), or optionally with a string consisting of svg path data.
... d optional when invoked with a string consisting of svg path data, a new path is created from that description.
PayerErrors.email - Web APIs
WebAPIPayerErrorsemail
the email property is included in a payererrors object if the paymentresponse.payeremail property failed validation; in this case, the property should contain a string describing how to correct the problem.
... syntax payeremail = payererrors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it.
PaymentAddress.addressLine - Web APIs
the addressline read-only property of the paymentaddress interface is an array of domstring objects, each specifying a line of the address that is not covered by one of the other properties of paymentaddress.
... syntax var paymentaddresslines = paymentaddress.addressline; value an array of domstring objects, each containing one line of the address.
PaymentAddress.city - Web APIs
the city read-only property of the paymentaddress interface returns a string containing the city or town portion of the address.
... syntax var paymentcity = paymentaddress.city; value a domstring indicating the city or town portion of the address described by the paymentaddress object.
PaymentAddress.languageCode - Web APIs
the languagecode read-only property of the paymentaddress interface returns a string containing the bcp-47 language code for the address.
... syntax var paymentlanguagecode = paymentaddress.languagecode; value a domstring providing the bcp-47 format language code indicating the language the address was written in, such as "en-us", "pt-br", or "ja-jp".
PaymentAddress.organization - Web APIs
the organization read-only property of the paymentaddress interface returns a string containing the name of the organization, firm, company, or institution at the address.
... syntax var paymentorganization = paymentaddress.organization; value a domstring whose value is the name of the organization or company located at the address described by the paymentaddress object.
PaymentAddress.sortingCode - Web APIs
the sortingcode read-only property of the paymentaddress interface returns a string containing a postal sorting code such as is used in france.
... syntax var sortingcode = paymentaddress.sortingcode; value a domstring containing the sorting code portion of the address.
PaymentCurrencyAmount.currency - Web APIs
the paymentcurrencyamount property currency is a string which specifies the currency in which the value is specified.
... syntax currency = paymentcurrencyamount.currency; value a domstring specifying the canonical, three-character currency identification code defined by the iso 4217 standard.
PaymentCurrencyAmount.currencySystem - Web APIs
the obsolete paymentcurrencyamount property currencysystem is a string which specifies the standard being used to specify the currency the value is specified in.
... syntax currencysystem = paymentcurrencyamount.currencysystem; value a domstring which specifies the currency standard used to specify the currency in which the payment value is represented.
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which provides an error message to be displayed if the specified information doesn't offer any valid shipping options.
... syntax errorstring = paymentdetailsupdate.error; paymentdetailsupdate.error = errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't provide any valid shipping options.
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
syntax var addresserrors = paymentdetailsupdate.shippingaddresserrors; value an addresserrors object, which contains domstrings describing errors in the properties of a paymentaddress.
...in that case, the property in shippingaddresserrors is a string describing the validation error, ideally including suggestions about fixing the error.
PaymentRequest.PaymentRequest() - Web APIs
starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods.
... for example, the basic card payment method is selected by specifying the string basic-card here.
PaymentRequest.show() - Web APIs
if and only if every field is valid, the complete() method is called on the response with the string "success", which indicates that everything is valid and that the payment can complete accordingly.
... if any fields have unacceptable values, or if an exception is thrown by the previous code, complete() is called with the string "fail", which indicates that the payment process is complete and failed.
Payment Request API - Web APIs
dictionaries addresserrors a dictionary containing strings providing descriptive explanations of any errors in any paymentaddress entries which have errors.
... payererrors a dictionary containing strings providing descriptive explanations of any errors in related to paymentresponse's email, phone, and name attributes.
Pbkdf2Params - Web APIs
properties name a domstring.
... hash a domstring representing the digest algorithm to use.
PerformanceNavigationTiming.type - Web APIs
the type read-only property returns a string representing the type of navigation.
... syntax perfentry.type; return value a string which is one of the values listed above.
PerformanceNavigationTiming - Web APIs
performancenavigationtiming.type read only a string representing the navigation type.
... methods performancenavigationtiming.tojson() returns a domstring that is the json representation of the performancenavigationtiming object.
PerformanceObserverEntryList.getEntriesByName() - Web APIs
syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve.
... type optional a domstring representing the type of entry to retrieve such as "mark".
PerformanceResourceTiming.nextHopProtocol - Web APIs
the nexthopprotocol read-only property is a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301).
... syntax resource.nexthopprotocol; return value a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301).
PerformanceServerTiming.toJSON - Web APIs
the tojson() method of the performanceservertiming interface returns a domstring that is the json representation of the performanceservertiming object.
... return value a domstring containing json.
PointerEvent.PointerEvent() - Web APIs
syntax event = new pointerevent(type, pointereventinit); arguments type is a domstring representing the name of the event (see pointerevent event types).
... pointertype — optional and defaulting to "", of type domstring, that sets the value of the instance's pointerevent.pointertype.
PointerEvent.pointerType - Web APIs
the supported values are the following strings: "mouse" the event was generated by a mouse device.
... if the device type cannot be detected by the browser, the value can be an empty string ("").
Using Pointer Events - Web APIs
function colorfortouch(touch) { var r = touch.pointerid % 16; var g = math.floor(touch.pointerid / 3) % 16; var b = math.floor(touch.pointerid / 7) % 16; r = r.tostring(16); // make it a hex digit g = g.tostring(16); // make it a hex digit b = b.tostring(16); // make it a hex digit var color = "#" + r + g + b; log("color for touch with identifier " + touch.pointerid + " = " + color); return color; } the result from this function is a string that can be used when calling <canvas> functions to set drawing colors.
... for example, for a pointerevent.pointerid value of 10, the resulting string is "#aaa".
PublicKeyCredential.id - Web APIs
the id read-only property of the publickeycredential interface is a domstring, inherited from credential, which represents the identifier of the current publickeycredential instance.
... syntax id = publickeycredential.id value a domstring being the base64url encoded version of publickeycredential.rawid.
PublicKeyCredentialCreationOptions.attestation - Web APIs
this is a string whose value indicates the preference regarding the attestation transport, between the authenticator, the client and the relying party.
... syntax attestation = publickeycredentialcreationoptions.attestation value a string which may be "none": the relying party is not interested in this attestation.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
syntax authenticatorselection = publickeycredentialcreationoptions.authenticatorselection value an object with the following properties: authenticatorattachmentoptional a string which is either "platform" or "cross-platform".
... userverificationoptional a string qualifying how the user verification should be part of the authentication process.
PublicKeyCredentialRequestOptions.rpId - Web APIs
the rpid property, of the publickeycredentialrequestoptions dictionary, is an optional property which indicates the relying party's identifier as a usvstring.
... syntax rpid = publickeycredentialrequestoptions.rpid value a usvstring for the identifier of the relying party.
PublicKeyCredentialRequestOptions.userVerification - Web APIs
this is a string which indicates how the user verification should be part of the authentication process.
... syntax userverification = publickeycredentialrequestoptions.userverification value a string qualifying how the user verification should be part of the authentication process.
PublicKeyCredentialRequestOptions - Web APIs
publickeycredentialrequestoptions.rpid optional a usvstring which indicates the relying party's identifier (ex.
... publickeycredentialrequestoptions.userverification optional a string qualifying how the user verification should be part of the authentication process.
PushManager.permissionState() - Web APIs
the permissionstate() method of the pushmanager interface returns a promise that resolves to a domstring indicating the permission state of the push manager.
... returns a promise that resolves to a domstring with a value of 'prompt', 'denied', or 'granted'.
PushManager.register() - Web APIs
if the method call is successful, the request's result will be a string, which is the endpoint url.
... example var req = navigator.push.register(); req.onsuccess = function(e) { var endpoint = req.result; debug("new endpoint: " + endpoint ); } req.onerror = function(e) { debug("error getting a new endpoint: " + json.stringify(e)); } specification specification status comment push api working draft defines the pushmanager interface.
PushManager.unregister() - Web APIs
pushregistration those objects are anonymous javascript objects with the following properties: pushendpoint a string representing the url of the unregistered endpoint.
... example var req = navigator.push.unregister(pushendpoint); req.onsuccess = function(e) { var endpoint = req.result; debug("unregistered endpoint: " + endpoint ); } req.onerror = function(e) { debug("error unregistering the endpoint: " + json.stringify(e)); } specification specification status comment push api working draft defines the pushmanager interface.
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.
...this could be anything that can be represented by json — an object, an array, a string, a number...
PushMessageData.text() - Web APIs
the text()method of the pushmessagedata interface extracts push message data as a plain text string.
... returns a usvstring.
PushSubscription.endpoint - Web APIs
the endpoint read-only property of the pushsubscription interface returns a usvstring containing the endpoint associated with the push subscription.
... syntax var myend = pushsubscription.endpoint; value a usvstring.
PushSubscription - Web APIs
properties pushsubscription.endpoint read only a usvstring containing the endpoint associated with the push subscription.
... pushsubscription.subscriptionid read only a domstring containing the subscription id associated with the push subscription.
RTCConfiguration.iceTransportPolicy - Web APIs
the webrtc device api dictionary rtcconfiguration's icetransportpolicy property is a string indicating the transport selection policy the ice agent should use during negotiation of connections.
... syntax let rtcconfiguration = { icetransportpolicy: policy }; rtcconfiguration.icetransportpolicy = policy; let policy = rtcconfiguration.icetransportpolicy; value a domstring which indicates what ice candidate policy the ice agent should use during the negotiation process, per the jsep standard.
RTCDTMFSender.insertDTMF() - Web APIs
syntax rtcdtmfsender.insertdtmf(tones[, duration[, intertonegap]]); parameters tones a domstring containing the dtmf codes to be transmitted to the recipient.
... specifying an empty string as the tones parameter clears the tone buffer, aborting any currently queued tones.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
syntax var event = new rtcdtmftonechangeevent(type, options); parameters type a domstring containing the name of the event.
... options a dictionary of type rtcdtmftonechangeeventinit, which may contain one or more of the following fields: tone a domstring containing a single dtmf tone character which has just begun to play, or an empty string ("") to indicate that the previous tone has stopped playing.
RTCDTMFToneChangeEvent.tone - Web APIs
the read-only property rtcdtmftonechangeevent.tone returns the dtmf character which has just begun to play, or an empty string ("").
... syntax var tone = dtmftonechangeevent.tone; example this example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>".
RTCDataChannel.label - Web APIs
the read-only rtcdatachannel property label returns a domstring containing a name describing the data channel.
... syntax var name = adatachannel.label; value a string identifier assigned by the web site or app when the data channel was created, as specified when rtcpeerconnection.createdatachannel() was called to create the channel.
RTCDataChannel.readyState - Web APIs
syntax var state = adatachannel.readystate; values a string which is one of the values in the rtcdatachannelstate enum, indicating the current state of the underlying data transport.
... rtcdatachannelstate enum the rtcdatachannelstate enum defines string constants which reflect the current status of the rtcdatachannel's underlying data connection.
RTCIceCandidate.component - Web APIs
the read-only component property on the rtcicecandidate interface is a string which indicates whether the candidate is an rtp or an rtcp candidate.
... syntax var component = rtcicecandidate.component; value a domstring which is "rtp" for rtp (or rtp and rtcp multiplexed together) candidates or "rtcp" for rtcp candidates.
RTCIceCandidate.foundation - Web APIs
the rtcicecandidate interface's read-only foundation property is a string which uniquely identifies the candidate across multiple transports.
... as such, the foundation can be used to correlate candidates that are present on multiple rtcicetransport objects syntax var foundation = rtcicecandidate.foundation; value a domstring which uniquely identifies the candidate across all rtcicetransports on which it is available.
RTCIceCandidate.protocol - Web APIs
the rtcicecandidate interface's read-only protocol property is a string which indicates whether the candidate uses udp or tcp as its transport protocol.
... syntax var protocol = rtcicecandidate.protocol; value a domstring which indicates what network protocol the candidate uses, udp or tcp.
RTCIceCandidate.relatedAddress - Web APIs
the rtcicecandidate interface's read-only relatedaddress property is a string indicating the related address of a relay or reflexive candidate.
... syntax var reladdress = rtcicecandidate.relatedaddress; value a domstring which contains the candidate's related address.
RTCIceCandidateStats.localCandidateId - Web APIs
the rtcicecandidatepairstats property localcandidateid is a string that uniquely identifies the local ice candidate which was analyzed to generate the rtcicecandidatestats used to compute the statistics for this pair of candidates.
... syntax localcandidateid = rtcicecandidatepairstats.localcandidateid; value a domstring giving a unique identifier for the local rtcicecandidate for the connection described by this rtcicecandidatepairstats object.
RTCIceCandidatePairStats.remoteCandidateId - Web APIs
the rtcicecandidatepairstats property remotecandidateid is a string that uniquely identifies the remote ice candidate which was analyzed to generate the rtcicecandidatestats used to compute the statistics for this pair of candidates.
... syntax remotecandidateid = rtcicecandidatepairstats.remotecandidateid; value a domstring uniquely identifies the remote ice candidate—that is, the candidate describing a configuration for the remote peer—which is represented by the remote end of these statistics.
RTCIceCandidateStats.candidateType - Web APIs
the rtcicecandidatestats interface's candidatetype property is a string which indicates the type of ice candidate the object represents.
... syntax candidatetype = rtcicecandidatestats.candidatetype; value a domstring whose value is one of the strings found in the rtcicecandidatetype enumerated type:host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the remote peer.
RTCIceCandidateStats.networkType - Web APIs
syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type.
... the string indicates the type of network connection that the described candidate would use to communicate with the other peer.
RTCIceCandidateStats.transportId - Web APIs
the rtcicecandidatestats dictionary's transportid property is a string that uniquely identifies the transport that produced the rtctransportstats from which information about this candidate was taken.
... syntax transportid = rtcicecandidatestats.transportid; value a domstring whose value uniquely identifies the transport from which any transport-related information accumulated in the rtcicecandidatestats was taken.
RTCIceCandidateType - Web APIs
the webrtc api's rtcicecandidatetype enumerated type provides a set of domstring values representing the types of ice candidate that can arrive.
... these strings are taken directly from the candidate a-line in sdp.
RTCIceComponent - Web APIs
the webrtc api's rtcicecomponent enumerated type contains domstring values that each identify a specific ice component; these are "rtp" and "rtcp".
... these strings are mapped to corresponding numeric values as they appear in the candidate a-line in sdp.
RTCIceParameters.usernameFragment - Web APIs
syntax ufrag = rtciceparameters.usernamefragment; value a domstring containing the username fragment that, in tandem with the password, uniquely identify the ice session being used by the transport.
... the string may be up to 256 characters long.
RTCIceParameters - Web APIs
properties usernamefragment a domstring specifying the value of the ice session's username fragment field, ufrag.
... password a domstring specifying the session's password string.
RTCIceProtocol - Web APIs
the webrtc api's rtciceprotocol enumerated type provides a set of domstring values representing the names of the transport protocols ice candidates can use.
... these strings are taken directly from the candidate a-line in sdp.
RTCIceServer.credentialType - Web APIs
the rtciceserver dictionary's credentialtype property is a string value from the rtcicecredentialtype enum which indicates what type of credential the rtciceserver.credential value is.
... }; var credentialtype = iceserver.credentialtype; iceserver.credentialtype = newcredentialtype; value the permitted values are found in the rtcicecredentialtype enumerated string type: oauth the rtciceserver requires the use of oauth 2.0 to authenticate in order to use the ice server described.
RTCIceServer - Web APIs
urls this required property is either a single domstring or an array of domstrings, each specifying a url which can be used to connect to the server.
... url this obsolete property is a string specifies a single ice server's url.
RTCIceTransport.component - Web APIs
the value is one of the strings in rtcicecomponent.
... syntax icecomponent = rtcicetransport.component; value a domstring whose value comes from the enumerated type rtcicecomponent: "rtp" identifies an ice transport which is being used for the real-time transport protocol (rtp), or for rtp multiplexed with the rtp control protocol (rtcp).
RTCIceTransport.gatheringState - Web APIs
the read-only rtcicetransport property gatheringstate returns a domstring from the enumerated type rtcicegathererstate that indicates what gathering state the ice agent is currently in: "new", "gathering", or "complete".
... syntax gatherstate = rtcicetransport.gatheringstate; value a string from the rtcicegathererstate enumerated type whose value indicates the current state of the ice agent's candidate gathering process: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
the qualitylimitationreason property of the rtcoutboundrtpstreamstats dictionary is a string indicating the reason why the media quality in the stream is currently being reduced by the codec during encoding, or none if no quality reduction is being performed.
... syntax var qualitylimitationreason = rtcoutboundrtpstreamstats.qualitylimitationreason; value a map whose keys are domstrings whose values come from the rtcqualitylimitationreason enumerated type, and whose values are the duration of the media, in seconds, whose quality was reduced for that reason.
RTCOutboundRtpStreamStats - Web APIs
perdscppacketssent a record of key-value pairs with strings as the keys mapped to 32-bit integer values, each indicating the total number of packets this rtcrtpsender has transmitted for this source for each differentiated services code point (dscp).
... remoteid a string which identifies the rtcremoteinboundrtpstreamstats object that provides statistics for the remote peer for this same ssrc.
RTCPeerConnection.connectionState - Web APIs
the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connection by returning one of the string values specified by the enum rtcpeerconnectionstate.
... rtcpeerconnectionstate enum the rtcpeerconnectionstate enum defines string constants which describe states in which the rtcpeerconnection may be.
RTCPeerConnection: iceconnectionstatechange event - Web APIs
the ice layer makes this determination upon receiving the end-of-candidates signal, which is provided by caling addicecandidate() with a candidate whose candidate property is an empty string (""), or by setting the rtcpeerconnection property cantrickleicecandidates to false.
... in this example, a handler for iceconnectionstatechange is set up to update a call state indicator by using the value of iceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection.
RTCPeerConnectionIceErrorEvent.address - Web APIs
the rtcpeerconnectioniceerrorevent property address is a string which indicates the local ip address being used to communicate with the stun or turn server during negotiations.
... syntax let address = rtcpeerconnectioniceerrorevent.address; value a domstring which specifies the local ip address of the network connection to the ice server with which negotiations were occurring when the error occurred.
RTCRtpCapabilities - Web APIs
each object contains a single domstring, uri, specifying the uri of the header extension, as described in rfc 5285.
... the mime type strings used by rtp differ from those used elsewhere.
RTCRtpCodecCapability - Web APIs
mimetype a domstring indicating the codec's mime media type and subtype.
... sdpfmtpline optional a domstring giving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists.
RTCRtpCodecParameters - Web APIs
mimetype optional the codec's mime media type and subtype specified as a domstring of the form "type/subtype".
... sdpfmtpline optional a domstring containing the format-specific parameters field from the "a=fmtp" line in the codec's sdp, if one is present; see section 5.8 of the ietf specification for jsep.
RTCRtpEncodingParameters - Web APIs
the value is taken from the enumerated string type rtcdtxstatus.
... rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension.
RTCRtpSendParameters.encodings - Web APIs
the value is taken from the enumerated string type rtcdtxstatus.
... rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension.
RTCRtpStreamStats.codecId - Web APIs
the rtcrtpstreamstats dictionary's codecid property is a string which uniquely identifies the object that was inspected to produce the data in the rtccodecstats for the rtp stream.
... syntax var codecid = rtcrtpstreamstats.codecid; value a domstring which uniquely identifies the object from which the contents of the stream's rtccodecstats are derived.
RTCRtpStreamStats.trackId - Web APIs
the rtcrtpstreamstats dictionary's trackid property is a string which uniquely identifies the rtcmediastreamtrackstats object which contains the track statistics for the mediastreamtrack for which statistics are provided in this object.
... syntax var trackid = rtcrtpstreamstats.trackid; value a domstring which uniquely identifies the rtcmediastreamtrackstats object that provides statistics for the track for which statistics are being collected by this rtcstatsreport.
RTCRtpStreamStats.transportId - Web APIs
the rtcrtpstreamstats dictionary's transportid property is a string which uniquely identifies the object from which the statistics contained in the rtctransportstats properties in the rtcstatsreport.
... syntax var transportid = rtcrtpstreamstats.transportid; value a domstring uniquely identifying the source of the statistics contained the rtctransportstats properties in the rtcstatsreport.
RTCRtpTransceiver - Web APIs
properties currentdirection read only a string from the enum rtcrtptransceiverdirection which indicates the transceiver's current directionality, or null if the transceiver is stopped or has never participated in an exchange of offers and answers.
... direction a string from the enum rtcrtptransceiverdirection which is used to set the transceiver's desired direction.
RTCRtpTransceiverDirection - Web APIs
the rtcrtptransceiverdirection type is an enumerated set of strings which are used to describe the directionality of a rtcrtptransceiver instance.
... values the rtcrtptransceiverdirection type is an enumeration of string values.
RTCSessionDescription.sdp - Web APIs
the property rtcsessiondescription.sdp is a read-only domstring containing the sdp which describes the session.
... syntax var value = sessiondescription.sdp; sessiondescription.sdp = value; value the value is a domstring containing an sdp message like this one: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 example // the remote description has been set previously on pc, an rtcpeerconnection alert(pc.remotedescription.sdp); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.sdp' in that specification.
RTCSessionDescription.toJSON() - Web APIs
"sdp", containing a domstring, or null, with the sdp message corresponding to rtcsessiondescription.sdp property.
... example // sd is a rtcsessiondescriptor alert(json.stringify(sd)); // this call the tojson() method behind the scene.
RTCSessionDescription - Web APIs
rtcsessiondescription.sdp read only a domstring containing the sdp describing the session.
... constants rtcsdptype this enum defines strings that describe the current state of the session description, as used in the type property.
RTCStats - Web APIs
WebAPIRTCStats
properties id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype.
RadioNodeList - Web APIs
on retrieving the value property, the value of the currently checked radio button is returned as a string.
... if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned.
Range.createContextualFragment() - Web APIs
syntax documentfragment = range.createcontextualfragment(tagstring) parameters tagstring text that contains text and tags to be converted to a document fragment.
... example var tagstring = "<div>i am a div node</div>"; var range = document.createrange(); // make the parent of the first div in the document becomes the context node range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.createcontextualfragment(tagstring); document.body.appendchild(documentfragment); specification specification status comment dom parsing and serializationthe definition of 'range.createcontextualfragment()' in that specification.
Range - Web APIs
WebAPIRange
range.tostring() returns the text of the range.
... range.createcontextualfragment() returns a documentfragment created from a given string of code.
ReadableStream.cancel() - Web APIs
syntax var promise = readablestream.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation.
... examples in jake archibald's cancelling a fetch example, a stream is used to fetch the whatwg html spec chunk by chunk; each chunk is searched for the string "service workers".
ReadableStreamDefaultReader.read() - Web APIs
it deals with stream chunks not ending on line boundaries and converting from uint8array to strings.
...utf8decoder.decode(chunk) : ""); startindex = re.lastindex = 0; continue; } yield chunk.substring(startindex, result.index); startindex = re.lastindex; } if (startindex < chunk.length) { // last line didn't end in a newline char yield chunk.substr(startindex); } } for await (let line of maketextfilelineiterator(urloffile)) { processline(line); } specifications specification status comment streamsthe definition of 'read()' in that specification.
Request.referrer - Web APIs
WebAPIRequestreferrer
(e.g., client, no-referrer, or a url.) note: if referrer's value is no-referrer, it returns an empty string.
... syntax var myreferrer = request.referrer; value a domstring representing the request's referrer.
Response() - Web APIs
WebAPIResponseResponse
this can be null (which is the default value), or one of: blob buffersource formdata readablestream urlsearchparams usvstring init optional an options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value).
... headers: any headers you want to add to your response, contained within a headers object or object literal of bytestring key/value pairs (see http headers for a reference).
RsaHashedImportParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
RsaHashedKeyGenParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
SVGAElement.target - Web APIs
the svgaelement.target read-only property of svgaelement returns an svganimatedstring object that specifies the portion of a target window, frame, pane into which a document is to be opened when a link is activated.
... syntax mylink.target = 'value'; value an svganimatedstring indicating the ending resource target that opens the document when the link is activated.
SVGAltGlyphElement.glyphRef - Web APIs
the svgaltglyphelement.glyphref property is a domstring representing a glyph identifier.
... syntax string = myglyph.glyphref; myglyph.glyphref = string; value the return value is a glyph identifier, the value of which depends on the format of the given font.
SVGColorProfileElement - Web APIs
properties svgcolorprofileelement.local a domstring corresponding to the local attribute of the given element.
... svgcolorprofileelement.name a domstring corresponding to the name attribute of the given element.
SVGElement - Web APIs
s,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance svgelement.datasetread only a domstringmap object which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element.
... svgelement.classname read only an svganimatedstring that reflects the value of the class attribute on the given element, or the empty string if class is not present.
SVGFEBlendElement - Web APIs
svgfeblendelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
... svgfeblendelement.in2 read only an svganimatedstring corresponding to the in2 attribute of the given element.
SVGFEDisplacementMapElement - Web APIs
svgfedisplacementmapelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
... svgfedisplacementmapelement.in2 read only an svganimatedstring corresponding to the in2 attribute of the given element.
SVGGlyphRefElement - Web APIs
svgglyphrefelement.glyphref a domstring corresponding to the glyphref attribute of the given element.
... svgglyphrefelement.format a domstring corresponding to the format attribute of the given element.
SVGImageElement - Web APIs
svgimageelement.crossorigin a domstring corresponding to the crossorigin attribute of the given <image> element.
... svgimageelement.decoding returns a domstring representing a hint given to the browser on how it should decode the image.
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 = 7 ...
... pathsegtypeasletter domstring the type of the path segment as specified by the corresponding one character command name.
SVGScriptElement - Web APIs
"321" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="401" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgscriptelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgscriptelement.type read only a domstring corresponding to the type attribute of the given <script> element.
... svgscriptelement.crossorigin read only a domstring corresponding to the crossorigin attribute of the given <script> element.
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.
SVGURIReference - Web APIs
y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgurireference</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgurireference.href read only an svganimatedstring that represents the value of the href attribute, and, on elements that are defined to support it, the deprecated xlink:href attribute.
... on getting href, an svganimatedstring object is returned that reflects the href attribute, and if the element is defined to support the deprecated xlink:href attribute, additionally reflects that deprecated attribute.
SecurityPolicyViolationEvent.blockedURI - Web APIs
the blockeduri read-only property of the securitypolicyviolationevent interface is a usvstring representing the uri of the resource that was blocked because it violates a policy.
... syntax let blockeduri = violationeventinstance.blockeduri; value a usvstring representing the uri of the blocked resource.
SecurityPolicyViolationEvent.documentURI - Web APIs
the documenturi read-only property of the securitypolicyviolationevent interface is a usvstring representing the uri of the document or worker in which the violation was found.
... syntax let documenturi = violationeventinstance.documenturi; value a usvstring representing the uri of the document or worker in which the violation was found.
SecurityPolicyViolationEvent.effectiveDirective - Web APIs
the effectivedirective read-only property of the securitypolicyviolationevent interface is a domstring representing the directive whose enforcement uncovered the violation.
... syntax let effdir = violationeventinstance.effectivedirective; value a domstring representing the directive whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.originalPolicy - Web APIs
the originalpolicy read-only property of the securitypolicyviolationevent interface is a domstring containing the policy whose enforcement uncovered the violation.
... syntax let origpolicy = violationeventinstance.originalpolicy; value a domstring representing the policy whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.referrer - Web APIs
the referrer read-only property of the securitypolicyviolationevent interface is a usvstring representing the referrer of the resources whose policy was violated.
... syntax let referrer = violationeventinstance.referrer; value a usvstring representing the url of the referrer of the violating resources.
SecurityPolicyViolationEvent.sample - Web APIs
the sample read-only property of the securitypolicyviolationevent interface is a domstring representing a sample of the resource that caused the violation.
... syntax let sample = violationeventinstance.sample; value a domstring containing a sample of the resource that caused the violation, usually the first 40 characters.
SecurityPolicyViolationEvent.sourceFile - Web APIs
the sourcefile read-only property of the securitypolicyviolationevent interface is a usvstring representing the uri of the document or worker in which the violation was found.
... syntax let source = violationeventinstance.sourcefile; value a usvstring representing the uri of the document or worker in which the violation was found.
SecurityPolicyViolationEvent.violatedDirective - Web APIs
the violateddirective read-only property of the securitypolicyviolationevent interface is a domstring representing the directive whose enforcement uncovered the violation.
... syntax let violateddir = violationeventinstance.violateddirective; value a domstring representing the directive whose enforcement uncovered the violation.
Selection.type - Web APIs
WebAPISelectiontype
the type read-only property of the selection interface returns a domstring describing the type of the current selection.
... syntax value = sel.type value a domstring describing the type of the current selection.
Selection API - Web APIs
once your selection is in a variable, you perform a variety of operations on it, for example copying the selection to a text string using selection.tostring(), adding a range (as represented by a standard range object) to the selection (or removing one) with selection.addrange()/selection.removerange(), or changing the selection to be the entire contents of a dom node using selection.selectallchildren().
... yeschrome android full support yesfirefox android full support 55opera android full support yessafari ios full support yessamsung internet android full support yestostring experimentalchrome full support 1edge full support ≤18firefox full support yesie ?
SharedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
... windowbase64.btoa() creates a base-64 encoded ascii string from a string of binary data.
SourceBuffer.changeType() - Web APIs
syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to.
... exceptions typeerror the specified string is empty, rather than indicating a valid mime type.
SpeechGrammar - Web APIs
properties speechgrammar.src sets and returns a string containing the grammar from within in the speechgrammar object instance.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
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.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'speechgrammarlist' in that specification.
SpeechGrammarList.addFromURI() - Web APIs
parameters src a domstring representing the uri of the grammar to be added.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; speechrecognitionlist.addfromuri('http://www.example.com/grammar.txt'); // adds a second grammar to the list.
SpeechRecognition.lang - Web APIs
syntax var mylang = myspeechrecognition.lang; myspeechrecognition.lang = 'en-us'; value a domstring representing the bcp 47 language tag for the current speechrecognition.
...od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognitionAlternative.transcript - Web APIs
the transcript read-only property of the speechrecognitionresult interface returns a string containing the transcript of the recognised word(s).
... syntax var mytranscript = speechrecognitionalternativeinstance.transcript; returns a domstring.
Storage.getItem() - Web APIs
WebAPIStoragegetItem
syntax var avalue = storage.getitem(keyname); parameters keyname a domstring containing the name of the key you want to retrieve the value of.
... return value a domstring containing the value of the key.
Storage.setItem() - Web APIs
WebAPIStoragesetItem
syntax storage.setitem(keyname, keyvalue); parameters keyname a domstring containing the name of the key you want to create/update.
... keyvalue a domstring containing the value you want to give the key you are creating/updating.
Streams API - Web APIs
with streams being available to javascript, this all changes — you can now start processing raw data with javascript bit by bit as soon as it is available on the client-side, without needing to generate a buffer, string, or blob.
... simple random stream: this example shows how to use a custom stream to generate random strings, enqueue them as chunks, and then read them back out again.
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
syntax const signature = crypto.subtle.sign(algorithm, key, data); parameters algorithm is a string or object that specifies the signature algorithm to use and its parameters: to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the form { "name": "rsassa-pkcs1-v1_5" }.
... to use hmac, pass the string "hmac" or an object of the form { "name": "hmac" }.
SubtleCrypto.wrapKey() - Web APIs
syntax const result = crypto.subtle.wrapkey( format, key, wrappingkey, wrapalgo ); parameters format is a string describing the data format in which the key will be exported before it is encrypted.
... to use aes-kw, pass the string "aes-kw", or an object of the form { "name": "aes-kw }.
Text.wholeText - Web APIs
WebAPITextwholeText
this allows to specify any text node and obtain all adjacent text as a single string.
... however, "); wholetext is just a property of text nodes that returns the string of data making up all the adjacent (i.e.
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.
... html <p>encoded value: <span id="encoded-value"></span></p> <p>decoded value: <span id="decoded-value"></span></p> javascript const encoder = new textencoder(); const array = encoder.encode('€'); // uint8array(3) [226, 130, 172] document.getelementbyid('encoded-value').textcontent = array; const decoder = new textdecoder(); const str = decoder.decode(array); // string "€" document.getelementbyid('decoded-value').textcontent = str; result specifications specification status comment encodingthe definition of 'textdecoder.decode()' in that specification.
TextDecoder - Web APIs
textdecoder.prototype.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use.
... textdecoder.prototype.decode() returns a domstring containing the text decoded with the method of the specific textdecoder object.
TextTrack.mode - Web APIs
WebAPITextTrackmode
the texttrack interface's mode property is a string specifying and controlling the text track's mode: disabled, hidden, or showing.
... syntax var mode = texttrack.mode; texttrack.mode = "disabled" | "hidden" | "showing"; value a domstring which indicates the track's current mode.
TextTrackCue - Web APIs
these cues represent a string of text that is presented for some duration of time during the performance of a texttrack.
... texttrackcue.id a domstring that identifies the cue.
Touch events - Web APIs
function colorfortouch(touch) { var r = touch.identifier % 16; var g = math.floor(touch.identifier / 3) % 16; var b = math.floor(touch.identifier / 7) % 16; r = r.tostring(16); // make it a hex digit g = g.tostring(16); // make it a hex digit b = b.tostring(16); // make it a hex digit var color = "#" + r + g + b; console.log("color for touch with identifier " + touch.identifier + " = " + color); return color; } the result from this function is a string that can be used when calling <canvas> functions to set drawing colors.
... for example, for a touch.identifier value of 10, the resulting string is "#a31".
TrackDefault.byteStreamTrackID - Web APIs
if not specified in the constructor, this value will be an empty string and the sourcebuffer can contain any tracks of the specified trackdefault.type.
... syntax var myid = trackdefault.bytestreamtrackid; value a domstring.
TransitionEvent.initTransitionEvent() - Web APIs
do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.inittransitionevent(typearg, canbubblearg, cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred.
... transitionnamearg is a domstring containing the name of the css property associated with the transition.
TransitionEvent.pseudoElement - Web APIs
the transitionevent.pseudoelement read-only property is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
... if the transition doesn't run on a pseudo-element but on the element, an empty string: ''.
TypeInfo - Web APIs
WebAPITypeInfo
properties typeinfo.typename read only returns a domstring indicating the type's name.
... typeinfo.typenamespace read only returns a domstring indicating the type's namespace within the schema.
URL.createObjectURL() - Web APIs
the url.createobjecturl() static method creates a domstring containing a url representing the object given in the parameter.
... return value a domstring containing an object url that can be used to reference the contents of the specified source object.
URL.host - Web APIs
WebAPIURLhost
the host property of the url interface is a usvstring containing the host, that is the hostname, and then, if the port of the url is nonempty, a ':', followed by the port of the url.
... syntax const host = url.host url.host = newhost value a usvstring.
URL.hostname - Web APIs
WebAPIURLhostname
the hostname property of the url interface is a usvstring containing the domain name of the url.
... syntax const domain = url.hostname url.hostname = domain value a usvstring.
URL.href - Web APIs
WebAPIURLhref
the href property of the url interface is a usvstring containing the whole url.
... syntax const urlstring = url.href url.href = newurlstring value a usvstring.
URL.origin - Web APIs
WebAPIURLorigin
the origin read-only property of the url interface returns a usvstring containing the unicode serialization of the origin of the represented url.
... syntax const originstring = url.origin value a usvstring.
URL.password - Web APIs
WebAPIURLpassword
the password property of the url interface is a usvstring containing the password specified before the domain name.
... syntax const passwordstring = url.password url.password = newpassword value a usvstring.
URL.pathname - Web APIs
WebAPIURLpathname
the pathname property of the url interface is a usvstring containing an initial '/' followed by the path of the url (or the empty string if there is no path).
... syntax const path = url.pathname url.pathname = newpath value a usvstring.
URL.pathname - Web APIs
the pathname property of the url interface is a usvstring containing an initial '/' followed by the path of the url (or the empty string if there is no path).
... syntax const path = url.pathname url.pathname = newpath value a usvstring.
URL.port - Web APIs
WebAPIURLport
the port property of the url interface is a usvstring containing the port number of the url.
... syntax const portnumber = url.port url.port = newportnumber value a usvstring.
URL.protocol - Web APIs
WebAPIURLprotocol
the protocol property of the url interface is a usvstring representing the protocol scheme of the url, including the final ':'.
... syntax const protocol = url.protocol url.protocol = newprotocol value a usvstring.
URL.username - Web APIs
WebAPIURLusername
the username property of the url interface is a usvstring containing the username specified before the domain name.
... syntax const usernamestring = url.username url.username = newusername value a usvstring.
URLSearchParams.append() - Web APIs
as shown in the example below, if the same key is appended multiple times it will appear in the parameter string multiple times for each value.
...params.append('foo', 4); //query string is now: 'foo=1&bar=2&foo=4' specifications specification status comment urlthe definition of 'append()' in that specification.
URLSearchParams.get() - Web APIs
return value a usvstring if the given search parameter is found; otherwise, null.
... examples if the url of your page is https://example.com/?name=jonathan&age=18 you could parse out the 'name' and 'age' parameters using: let params = new urlsearchparams(document.location.search.substring(1)); let name = params.get("name"); // is the string "jonathan" let age = parseint(params.get("age"), 10); // is the number 18 requesting a parameter that isn't present in the query string will return null: let address = params.get("address"); // null specifications specification status comment urlthe definition of 'get()' in that specification.
URLUtilsReadOnly.hash - Web APIs
the urlutilsreadonly.hash read-only property returns a domstring containing a '#' followed by the fragment identifier of the url.
... syntax string = object.hash; examples // in a web worker, on the page https://developer.mozilla.org/docs/urlutilsreadonly.hash#example var result = window.self.hash; // returns:'#hash' specifications specification status comment urlthe definition of 'urlutilsreadonly.hash' in that specification.
URLUtilsReadOnly.host - Web APIs
the urlutilsreadonly.host read-only property returns a domstring containing the host, that is the hostname, a ':', and the port of the url.
... syntax string = object.host; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.host var result = window.self.host; // returns:'developer.mozilla.org:80' specifications specification status comment urlthe definition of 'urlutilsreadonly.host' in that specification.
URLUtilsReadOnly.hostname - Web APIs
the urlutilsreadonly.hostname read-only property returns a domstring containing the domain of the url.
... syntax string = object.hostname; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.hostname var result = window.self.hostname; // returns:'developer.mozilla.org' specifications specification status comment urlthe definition of 'urlutilsreadonly.hostname' in that specification.
URLUtilsReadOnly.href - Web APIs
the urlutilsreadonly.href read-only property is a stringifier that returns a domstring containing the whole url.
... syntax string = object.href; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.href; // returns:'https://developer.mozilla.org/urlutilsreadonly.href' specifications specification status comment urlthe definition of 'urlutilsreadonly.href' in that specification.
URLUtilsReadOnly.origin - Web APIs
the urlutilsreadonly.origin read-only property is a domstring containing the unicode serialization of the origin of the represented url, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified).
... syntax string = object.origin; examples // on this page, returns the origin var result = self.location.origin; // returns:'https://developer.mozilla.org:443' specifications specification status comment urlthe definition of 'urlutilsreadonly.origin' in that specification.
URLUtilsReadOnly.pathname - Web APIs
the urlutilsreadonly.pathname read-only property returns a domstring containing an initial '/' followed by the path of the url.
... syntax string = object.pathname; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.pathname var result = window.self.pathname; // returns:'/urlutilsreadonly.pathname' specifications specification status comment urlthe definition of 'urlutilsreadonly.pathname' in that specification.
URLUtilsReadOnly.port - Web APIs
the urlutilsreadonly.port read-only property returns a domstring containing the port number of the url.
... syntax string = object.port; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.port var result = window.self.port; // returns:'80' specifications specification status comment urlthe definition of 'urlutilsreadonly.port' in that specification.
URLUtilsReadOnly.protocol - Web APIs
the urlutilsreadonly.protocol read-only property returns a domstring containing the protocol scheme of the url, including the final ':'.
... syntax string = object.protocol; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.protocol; // returns:'https:' specifications specification status comment urlthe definition of 'urlutilsreadonly.protocol' in that specification.
URLUtilsReadOnly.search - Web APIs
the urlutilsreadonly.search read-only property returns a domstring containing a '?' followed by the parameters of the url.
... syntax string = object.search; examples // in a web worker, on the page https://developer.mozilla.org/docs/urlutilsreadonly.href?t=67 var result = window.self.search; // returns:'?t=67' specifications specification status comment urlthe definition of 'urlutilsreadonly.search' in that specification.
URL API - Web APIs
WebAPIURL API
in this case, those strings are developer.mozilla.org and /docs/web/api/url_api, respectively.
... queries the search property on a url contains the query string portion of the url.
Using the User Timing API - Web APIs
function clear_marks(obj) { if (performance.clearmarks === undefined) { log("clear marks: performance.clearmarks not supported", 0); return; } log("clear marks", 0); if (typeof obj == "string") { log("...
... function clear_measures(obj) { if (performance.clearmeasures === undefined) { log("clear mearsures: performance.clearmeasures not supported", 1); return; } log("clear measures", 1); if (typeof obj == "string") { log("...
VideoTrack.id - Web APIs
WebAPIVideoTrackid
the id property contains a string which uniquely identifies the track represented by the videotrack.
... syntax var trackid = videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an videotracklist such as the one specified by a media element's videotracks property.
Videotrack.language - Web APIs
the read-only videotrack property language returns a string identifying the language used in the video track.
... syntax var videotracklanguage = videotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the video track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
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.
... syntax sequence<domstring> ext.getsupportedprofiles(); return value an array of domstring elements indicating which astc profiles are supported by the implementation.
WEBGL_debug_renderer_info - Web APIs
constants ext.unmasked_vendor_webgl vendor string of the graphics driver.
... ext.unmasked_renderer_webgl renderer string of the graphics driver.
WEBGL_debug_shaders.getTranslatedShaderSource() - Web APIs
return value a string containing the translated shader source.
... an empty string is returned, if: no source has been defined or, webglrenderingcontext.compileshader() has not yet been called or, the translation for the shader failed.
WakeLockSentinel.type - Web APIs
the read-only type property of the wakelocksentinel interface returns a string representation of the currently acquired wakelocksentinel type.
... syntax var type = wakelocksentinel.type; value a string representation of the currently acquired wake lock type.
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
syntax domstring gl.getactiveuniformblockname(program, uniformblockindex); parameters program a webglprogram containing the uniform block.
... return value a domstring indicating the active uniform block name.
WebGLContextEvent.statusMessage - Web APIs
the read-only webglcontextevent.statusmessage property contains additional event status information, or is an empty string if no additional information is available.
... examples the statusmessage property can contain a platform dependent string with details of an event.
WebGLRenderingContext.getExtension() - Web APIs
syntax gl.getextension(name); parameters name a string for the name of the webgl extension to enable.
... return value a webgl extension object, or null if name does not match (case-insensitive) to one of the strings in webglrenderingcontext.getsupportedextensions.
WebGLRenderingContext.getParameter() - Web APIs
gl.renderer domstring gl.sample_buffers glint gl.sample_coverage_invert glboolean gl.sample_coverage_value glfloat gl.samples glint gl.scissor_box int32array (with 4 elements) gl.scissor_test glboolean gl.shading_language_version domstring gl.stencil_back_fail glenum gl.stencil_b...
... gl.subpixel_bits glint gl.texture_binding_2d webgltexture or null gl.texture_binding_cube_map webgltexture or null gl.unpack_alignment glint gl.unpack_colorspace_conversion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_premultiply_alpha_webgl glboolean gl.vendor domstring gl.version domstring gl.viewport int32array (with 4 elements) webgl 2 you can query the following pname parameters when using a webgl2renderingcontext.
WebGLRenderingContext.getProgramInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last linking or validation operation.
... when a webglprogram object is initially created, its information log will be a string of length 0.
WebGLRenderingContext.getShaderInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last compile operation.
... when a webglshader object is initially created, its information log will be a string of length 0.
WebGLRenderingContext.getUniformLocation() - Web APIs
name a domstring specifying the name of the uniform variable whose location is to be returned.
... the name can't have any whitespace in it, and you can't use this function to get the location of any uniforms starting with the reserved string "gl_", since those are internal to the webgl layer.
WebGLRenderingContext - Web APIs
webglrenderingcontext.getshadersource() returns the source code of a webglshader as a string.
... working with extensions these methods manage webgl extensions: webglrenderingcontext.getsupportedextensions() returns an array of domstring elements with all the supported webgl extensions.
WebGL constants - Web APIs
webgl_debug_renderer_info constant name value description unmasked_vendor_webgl 0x9245 passed to getparameter to get the vendor string of the graphics driver.
... unmasked_renderer_webgl 0x9246 passed to getparameter to get the renderer string of the graphics driver.
WebSocket.extensions - Web APIs
this is currently only the empty string or a list of extensions as negotiated by the connection.
... syntax var extensions = awebsocket.extensions; value a domstring.
WebSocket.protocol - Web APIs
the websocket.protocol read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the websocket object, or the empty string if no connection is established.
... syntax var protocol = awebsocket.protocol; value a domstring.
Fundamentals of WebXR - Web APIs
this is done by specifying the appropriate session mode string for the kind of session you want to create.
...the former, specified by the session mode string inline, presents the rendered scene within the context of a document in a web browser, and doesn't require special xr hardware to view.
Functions and classes available to Web Workers - Web APIs
in addition to the standard javascript set of functions (such as string, array, object, json, etc), there are a variety of functions available from the dom to workers.
... 40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, or respectively textdecoder, allowing to encode or decode strings into specific encodings.
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.
... some browsers used to display the returned string in the confirmation dialog, enabling the event handler to display a custom message to the user.
Window.localStorage - Web APIs
the keys and the values are always in the utf-16 domstring format, which uses two bytes per character.
... as with objects, integer keys are automatically converted to strings.
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.
... syntax mqlist = window.matchmedia(mediaquerystring) parameters mediaquerystring a string specifying the media query to parse into a mediaquerylist.
Window.name - Web APIs
WebAPIWindowname
syntax string = window.name; window.name = string; example <script> // open a tab with a specific browsing context name const othertab = window.open("url1", "_blank"); if (othertab) othertab.name = "other-tab"; </script> <a href="url2" target="other-tab">this link will be opened in the other tab.</a> notes the name of the window is used primarily for setting targets for hyperlinks and forms.
... window.name will convert all values to their string representations by using the tostring method.
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
opendialog() treats the absence of the features parameter the same way window.open() does; that is, an empty string sets all features to off) except chrome and dialog, which default to on.
... if the features parameter is a zero-length string, or contains only one or more of the behavior features (chrome, dependent, dialog and modal) the chrome features are assumed "os' choice." that is, window creation code is not given specific instructions, but is instead allowed to select the chrome that best fits a dialog on that operating system.
window.postMessage() - Web APIs
[1] targetorigin specifies what the origin of targetwindow must be for the event to be dispatched, either as the literal string "*" (indicating no preference) or as a uri.
...this string is the concatenation of the protocol and "://", the host name if one exists, and ":" followed by a port number if a port is present and differs from the default port for the given protocol.
Window.sessionStorage - Web APIs
the keys and the values are always in the utf-16 domstring format, which uses two bytes per character.
... as with objects, integer keys are automatically converted to strings.
WindowEventHandlers.onhashchange - Web APIs
'location1' : 'location2'; } the hashchange event the dispatched hashchange event has the following properties: field type description newurl domstring the new url to which the window is navigating.
... oldurl domstring the previous url from which the window was navigated.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
code an optional syntax allows you to include a string instead of a function, which is compiled and executed every delay milliseconds.
... browsers may enforce even more stringent minimum values for the interval under some circumstances, although these should not be common.
WritableStream.getWriter() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
WritableStream - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
WritableStreamDefaultWriter.close() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
WritableStreamDefaultWriter.write() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
WritableStreamDefaultWriter - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
...a foreach() call is used to write each chunk of the string to the stream.
XDomainRequest.responseText - Web APIs
returns the response body of an xdomainrequest as a string.
... syntax var response = xdr.responsetext; this sets response to contain the response body of the request, as a string.
XMLHttpRequest.responseXML - Web APIs
exceptions invalidstateerror the responsetype isn't either "document" or an empty string.
... example var xhr = new xmlhttprequest; xhr.open('get', '/server'); // if specified, responsetype must be empty string or "document" xhr.responsetype = 'document'; // force the response to be parsed as xml xhr.overridemimetype('text/xml'); xhr.onload = function () { if (xhr.readystate === xhr.done && xhr.status === 200) { console.log(xhr.response, xhr.responsexml); } }; xhr.send(); specifications specification status comment xmlhttprequestthe definition of 'responsexml' in that specification.
XMLHttpRequest.send() - Web APIs
an xmlhttprequestbodyinit, which per the fetch spec can be a blob, buffersource, formdata, urlsearchparams, or usvstring object.
...}; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes.
XMLHttpRequest.statusText - Web APIs
the read-only xmlhttprequest.statustext property returns a domstring containing the response's status message as returned by the http server.
...if the request's readystate is in unsent or opened state, the value of statustext will be an empty string.
XPathNSResolver.lookupNamespaceURI() - Web APIs
syntax domstring xpathnsresolver.lookupnamespaceuri(prefix); parameters prefix a domstring representing the prefix to look for.
... return value a domstring representing the associated namespace uri or null if none is found.
XPathResult - Web APIs
xpathresult.stringvalueread only a string representing the value of the result if resulttype is string_type.
... string_type 2 a result containing a single string.
XRInputSourcesChangeEvent() - Web APIs
syntax newinputsourceschangeevent = new xrinputsourceschangeevent(type, eventinitdict); parameters type a domstring indicating the type of event which has occurred.
... this string must always be inputsourceschange.
XRPermissionDescriptor.mode - Web APIs
the mode property of the xrpermissiondescriptor dictionary is a string taken from the xrsessionmode enumerated type, specifying which web xr session mode (inline, immersive-vr, or immersive-ar) the described permissions will be used for.
... syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
XRPermissionDescriptor - Web APIs
optionalfeatures an array of strings, each specifying the name of a webxr feature which is requested but not required for the app to function.
... requiredfeatures an array of strings giving the names of the webxr features for which permission must be obtained in order to use your app or site.
XRSession.environmentBlendMode - Web APIs
the value is a domstring which contains one of the values defined by the xrenvironmentblendmode enumerated type.
... syntax blendmode = xrsession.environmentblendmode; value a domstring whose value is one of the strings found in the enumerated type xrenvironmentblendmode, defining if—and if so, how—virtual, rendered content is overlaid atop the image of the real world.
XRSession.requestReferenceSpace() - Web APIs
syntax refspacepromise = xrsession.requestreferencespace(referencespacetype); parameters type a domstring specifying the type of reference space for which an instance is to be returned.
... the string must be one of those found in the xrreferencespacetype enumerated type.
XRSession.visibilityState - Web APIs
the read-only visibilitystate property of the xrsession interface is a string indicating whether the webxr content is currently visible to the user, and if it is, whether it's the primary focus.
... syntax visibilitystate = xrsession.visibilitystate; value a domstring containing one of the values defined in the enumerated type xrvisibilitystate; this string indicates whether or not the xr content is visible to the user and if it is, whether or not it's currently the primary focus.
XRView.eye - Web APIs
WebAPIXRVieweye
the xrview interface's read-only eye property is a string taken from the xreye enumerated type, indicating which eye's viewpoint the xrview represents: left or right.
... syntax let eye = xrview.eye; value a domstring whose value is one of the strings enumerated by the xreye type: left the xrview represents the point-of-view of the viewer's left eye.
Using the aria-label attribute - Accessibility
the aria-label attribute is used to define a string that labels the current element.
... value string possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique.
Using the aria-valuenow attribute - Accessibility
in this case, the values of aria-valuenow could range from 1 through 3, which indicate the position of each value in the value space, but the aria-valuetext would be one of the strings: small, medium, or large.
... value string representation of a number possible effects on user agents and assistive technology for elements with role progressbar and scrollbar, assistive technologies should render the actual value as a percentage, calculated as a position on the range from aria-valuemin to aria-valuemax if both are defined, otherwise the actual value with a percent indicator.
Using the aria-valuetext attribute - Accessibility
in this case, the values of aria-valuenow could range from 1 through 3, which indicate the position of each value in the value space, but thearia-valuetext would be one of the strings: small, medium, or large.
... value string representation of a number possible effects on user agents and assistive technology if the aria-valuetext attribute is absent, assistive technologies will rely solely on the aria-valuenow attribute for the current value.
ARIA annotations - Accessibility
for example: <p id="description-id">an extended text description of some kind...</p> <div aria-describedby="description-id"> <!-- some kind of ui feature that needs an accessible description --> </div> aria-details is appropriate when linking to descriptions or annotations that are a bit more complex — rather than a simple text string, it might contain multiple bits of semantic information: <div id="detail-id"> <h2>a heading</h2> <p>an extended text description of some kind…</p> <p><time datetime="...">a timestamp</time></p> </div> <div aria-details="detail-id"> <!-- some kind of ui feature that needs an accessible description --> </div> this difference really becomes apparent when you get to how the content is a...
...content marked up with aria-describedby is flattened into a simple string, whereas aria-details content is not — so use aria-details if you wat to preserve more complex semantics that go beyond a simple text string.
Architecture - Accessibility
in firefox, the results of getendindex will always be the startindex + 1, because links are always just represented by a single embedded object character (c) to get the next char fom a given offset in an accessible text: if current char is 0 (end of string), then we are on a hard line break: get next node (typical depth first search), and set the current offset = 0 iatext::ch = getcharacteratoffset(++offset); if ch == embedded object char (0xfffc) then get object for that offset (see a above), then set the current offset to -1, and go to step 2 if ch == 0 then we must determine whether we're on a hard line break: if the current acc...
... if the current character falls within a text substring, locate the line ending of that substring or the next embed, whichever comes first: get the current line start and end offsets.
Accessibility documentation index - Accessibility
its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name.
... 21 using the aria-label attribute aria, accessibility, codingscripting, html, needscontent, reference, référence(2), agent, aria-label, user, useragent the aria-label attribute is used to define a string that labels the current element.
@charset - CSS: Cascading Style Sheets
WebCSS@charset
assume that the document is utf-8 syntax @charset "utf-8"; @charset "iso-8859-15"; where: charset is a <string> denoting the character encoding to be used.
...alid charset declarations @charset "utf-8"; /* set the encoding of the style sheet to unicode utf-8 */ @charset 'iso-8859-15'; /* invalid, wrong quoting style used */ @charset "utf-8"; /* invalid, more than one space */ @charset "utf-8"; /* invalid, there is a character (a space) before the at-rule */ @charset utf-8; /* invalid, without ' or ", the charset is not a css <string> */ specifications specification status comment css level 2 (revision 1)the definition of '@charset' in that specification.
additive-symbols - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial valuen/acomputed valueas specified formal syntax [ <integer> && <symbol> ]#where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
negative - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial value"-" hyphen-minuscomputed valueas specified formal syntax <symbol> <symbol>?where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
pad - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial value0 ""computed valueas specified formal syntax <integer> && <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
@document - CSS: Cascading Style Sheets
WebCSS@document
to match a literal period, you would first need to escape it using regular expression rules (to \.), then escape that string using css rules (to \\.).
... formal syntax @document [ <url> | url-prefix(<string>) | domain(<string>) | media-document(<string>) | regexp(<string>) ]# { <group-rule-body> } examples specifying document for css rule @document url("http://www.w3.org/"), url-prefix("http://www.w3.org/style/"), domain("mozilla.org"), media-document("video"), regexp("https:.*") { /* css rules here apply to: - the page "http://www.w3.org/" - ...
font-family - CSS: Cascading Style Sheets
syntax /* <string> values */ font-family: "font family"; font-family: 'another font family'; /* <custom-ident> value */ font-family: examplefont; values <family-name> specifies the name of the font family.
... formal definition related at-rule@font-faceinitial valuen/a (required)computed valueas specified formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src: url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the definition of 'font-family' in that specification.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
these are created if you have a string of text inside your grid container, that is not wrapped in any other element.
... <div class="grid"> i am a string and will become an anonymous item <div>a grid item</div> <div>a grid item</div> </div> anonymous items are always auto-placed because there is no way to target them.
Using CSS counters - CSS: Cascading Style Sheets
the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'.
... the generated text is the value of all counters with the given name in scope at the given pseudo-element, from outermost to innermost, separated by the specified string.
Value definition syntax - CSS: Cascading Style Sheets
called basic data types, they are represented with their name surrounded by the symbol '<' and '>': <angle>, <string>, … non-terminal data types less common data types, called non-terminal data types, are also surrounded by '<' and '>'.
... summary sign name description example combinators juxtaposition components are mandatory and should appear in that order solid <length> && double ampersand components are mandatory but may appear in any order <length> && <string> || double bar at least one of the components must be present, and they may appear in any order.
animation - CSS: Cascading Style Sheets
WebCSSanimation
each individual animation is specified as: zero or one occurrences of the following values: <single-transition-timing-function> <single-animation-iteration-count> <single-animation-direction> <single-animation-fill-mode> <single-animation-play-state> an optional name for the animation, which may be none, a <custom-ident>, or a <string> zero, one, or two <time> values the order of values within each animation definition is important: the first value that can be parsed as a <time> is assigned to the animation-duration, and the second one is assigned to animation-delay.
...none | <keyframes-name> ]where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function><single-animation-iteration-count> = infinite | <number><single-animation-direction> = normal | reverse | alternate | alternate-reverse<single-animation-fill-mode> = none | forwards | backwards | both<single-animation-play-state> = running | paused<keyframes-name> = <custom-ident> | <string>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinato...
<color> - CSS: Cascading Style Sheets
html <div></div> <hr> <label for="color">enter a valid color value:</label> <input type="text" id="color"> css div { width: 100%; height: 200px; } javascript const inputelem = document.queryselector('input'); const divelem = document.queryselector('div'); function validtextcolor(stringtotest) { if (stringtotest === "") { return false; } if (stringtotest === "inherit") { return false; } if (stringtotest === "transparent") { return false; } const image = document.createelement("img"); image.style.color = "rgb(0, 0, 0)"; image.style.color = stringtotest; if (image.style.color !== "rgb(0, 0, 0)") { return true; } image.style.color = "rgb(255, 255, 255)"; image.st...
...yle.color = stringtotest; return image.style.color !== "rgb(255, 255, 255)"; } inputelem.addeventlistener('change', () => { if(validtextcolor(inputelem.value)) { divelem.style.backgroundcolor = inputelem.value; divelem.textcontent = ''; } else { divelem.style.backgroundcolor = 'white'; divelem.textcontent = 'invalid color value'; } }); result rgb syntax variations this example shows the many ways in which a single color can be created with the various rgb color syntaxes.
font-family - CSS: Cascading Style Sheets
valid family names font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace examples some common font families .serif { font-family: times, times new roman, georgia, serif; } .sansserif { font-family: verdana, arial, helvetica, sans-serif; } .monospace { font-family: lucida console, courier, monospace; } .cursive { font-family: cursive; } .fantasy { font-family: fanta...
font-feature-settings - CSS: Cascading Style Sheets
the tag is always a <string> of 4 ascii characters.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <feature-tag-value>#where <feature-tag-value> = <string> [ <integer> | on | off ]?
image() - CSS: Cascading Style Sheets
)where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
... image-src optional zero or more <url>s or <string>s specifying the image sources, with optional image fragment identifiers.
offset-path - CSS: Cascading Style Sheets
path() a path string defined with svg coordinate syntax.
...<string> )<basic-shape> = <inset()> | <circle()> | <ellipse()> | <polygon()> | <path()><geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <length-percentage> = <length> | <percentage><fill-rule> = nonzero | evenodd<inset()> = inset( <length-percentage>{1,4} [ round <'border-radius'> ]?
overflow-wrap - CSS: Cascading Style Sheets
the overflow-wrap css property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
... anywhere to prevent overflow, an otherwise unbreakable string of characters — like a long word or url — may be broken at any point if there are no otherwise-acceptable break points in the line.
shape-outside - CSS: Cascading Style Sheets
<string> )<image()> = image( <image-tags>?
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<fill-rule> = nonzero | evenodd<image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
exsl:object-type() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:object-type() returns a string that indicates the type of the specified object.
... returns the object's type, which will be one of the following: string number boolean node-set rtf external specifications exslt - exsl:object-type ...
set:distinct() - EXSLT
WebEXSLTsetdistinct
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.
... returns a node-set containing the nodes that have unique string values.
Video player styling basics - Developer guides
each image was then converted to a base64 encoded string (using an online base64 image encoder), since the images are quite small, the resultant encoded strings are quite short.
... for example, the play/pause button has the following background image definitions (the full base64 strings have been omitted for brevity): .controls button[data-state="play"] { background-image: url('data:image/png;base64,ivborw0kggoaaa ...
HTML attribute: pattern - HTML: Hypertext Markup Language
constraint validation if the input’s value is not the empty string and the value does not match the entire regular expression, there is a from a patternmismatch .
... the pattern's regular expression, when matched against the value, must have its start anchored to the start of the string and its end anchored to the end of the string, which is slightly different from javascript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
alt a text string alternative to display on browsers that do not display images.
... referrerpolicy a string indicating which referrer to use when fetching the resource: "no-referrer" meaning that the referer: header will not be sent.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
the default closed state displays only the triangle and the label inside <summary> (or a user agent-defined default string if no <summary>).
... an input device as well as some form of output device is recommended.</p> </details> in this situation, the browser will use a default summary string (usually "details").
<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.
...st, false); colorpicker.addeventlistener("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="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
<input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a domstring representing the value of the hidden data you want to pass back to the server.
... value the <input> element's value attribute holds a domstring that contains the hidden data you want to include when the form is submitted to the server.
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
if the attribute is present, its value must be an ascii case-insensitive match for the string "utf-8".
... the number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';url=', and a valid url.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported.
...if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade.
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
autocomplete a domstring providing a hint for a user agent's autocomplete feature.
... required a boolean attribute indicating that an option with a non-empty string value must be selected.
<time> - HTML: Hypertext Markup Language
WebHTMLElementtime
valid datetime values a valid year string 2011 a valid month string 2011-11 a valid date string 2011-11-18 a valid yearless date string 11-18 a valid week string 2011-w47 a valid time string 14:54 14:54:39 14:54:39.929 a valid local date and time string 2011-11-18t14:54:39.929 2011-11-18 14:54:39.929 a valid global date and time string 2011-11-18t14:54:39.929z 2011-11-18t14:54:39.929-0400 2011-11-18t14:54:39.929-04:00...
... 2011-11-18 14:54:39.929z 2011-11-18 14:54:39.929-0400 2011-11-18 14:54:39.929-04:00 a valid duration string pt4h18m3s examples simple example html <p>the concert starts at <time datetime="2018-07-07t20:00:00">20:00</time>.</p> output datetime example html <p>the concert took place on <time datetime="2001-05-15t19:00">may 15</time>.</p> output specifications specification status comment html living standardthe definition of '<time>' in that specification.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
empty string: synonym of the auto value.
... some media file types let you provide more specific information using the codecs parameter as part of the file's type string.
contenteditable - HTML: Hypertext Markup Language
the attribute must take one of the following values: true or an empty string, which indicates that the element is editable.
... if the attribute is given without a value, like <label contenteditable>example label</label>, its value is treated as an empty string.
Global attributes - HTML: Hypertext Markup Language
the attribute must take one of the following values: true or the empty string, which indicates that the element must be editable; false, which indicates that the element must not be editable.
...it can have the following values: empty string and yes, which indicates that the element will be translated.
Link types - HTML: Hypertext Markup Language
list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string.
... if used in combination with the alternate keyword, it defines an alternative style sheet; in that case the title attribute must be present and not be the empty string.
HTTP caching - HTTP
WebHTTPCaching
the revision version added to revved resources doesn't need to be a classical revision string like 1.1.3, or even a monotonously growing suite of number.
...that means that a http user-agent, such as the browser, does not know what this string represents and can't predict what its value would be.
CSP: style-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
... <style>#inline-style { background: red; }</style> unsafe style expressions the 'unsafe-eval' source expression controls several style methods that create style declarations from strings.
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
... syntax content-security-policy: trusted-types; content-security-policy: trusted-types <policyname>; content-security-policy: trusted-types <policyname> <policyname> 'allow-duplicates'; <domstring> any string can be a trusted type policy name.
Date - HTTP
WebHTTPHeadersDate
note that date is listed in the forbidden header names in the fetch spec - so this code will not send date header: fetch('https://httpbin.org/get', { 'headers': { 'date': (new date()).toutcstring() } }) header type general header forbidden header name yes syntax date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
... examples date: wed, 21 oct 2015 07:28:00 gmt new date().toutcstring() // "mon, 09 mar 2020 08:13:24 gmt" specifications specification title rfc 7231, section 7.1.1.2: date hypertext transfer protocol (http/1.1): semantics and content ...
WWW-Authenticate - HTTP
the only allowed value is the case insensitive string "utf-8".
... this does not relate to the encoding of the realm string.
206 Partial Content - HTTP
WebHTTPStatus206
a response containing several ranges: http/1.1 206 partial content date: wed, 15 nov 2015 06:25:24 gmt last-modified: wed, 15 nov 2015 04:58:08 gmt content-length: 1741 content-type: multipart/byteranges; boundary=string_separator --string_separator content-type: application/pdf content-range: bytes 234-639/8000 ...the first range...
... --string_separator content-type: application/pdf content-range: bytes 4590-7999/8000 ...the second range --string_separator-- specifications specification title rfc 7233, section 4.1: 206 partial content hypertext transfer protocol (http/1.1): range requests ...
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.
... css properties and values api reference css properties and values api guide css typed om converting cssom value strings into meaningfully typed javascript representations and back can incur a significant performance overhead.
Meta programming - JavaScript
the type of each result list element is either string or symbol.
... function.prototype.apply.call(math.floor, undefined, [1.75]) with reflect.apply this becomes less verbose and easier to understand: reflect.apply(math.floor, undefined, [1.75]) // 1 reflect.apply(string.fromcharcode, undefined, [104, 101, 108, 108, 111]) // "hello" reflect.apply(regexp.prototype.exec, /ab/, ['confabulation']).index // 4 reflect.apply(''.charat, 'ponies', [3]) // "i" checking if property definition has been successful with object.defineproperty, which returns an object if successful, or throws a typeerror otherwise, you would use a try...catch block to catch any error that o...
JavaScript technologies overview - JavaScript
among other things, ecmascript defines: language syntax (parsing rules, keywords, control flow, object literal initialization, ...) error handling mechanisms (throw, try...catch, ability to create user-defined error types) types (boolean, number, string, function, object, ...) the global object.
...the internationalization api provides collation (string comparison), number formatting, and date-and-time formatting for javascript applications, letting the applications choose the language and tailor the functionality to their needs.
Memory Management - JavaScript
var n = 123; // allocates memory for a number var s = 'azerty'; // allocates memory for a string var o = { a: 1, b: null }; // allocates memory for an object and contained values // (like object) allocates memory for the array and // contained values var a = [1, null, 'abra']; function f(a) { return a + 2; } // allocates a function (which is a callable object) // function expressions also allocate an object someelement.addeventlistener('click', function() { someelement.style.back...
... 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.
SyntaxError: illegal character - JavaScript
“this looks like a string”; // syntaxerror: illegal character // “ and ” are not " but look like this 42 – 13; // syntaxerror: illegal character // – is not - but looks like this var foo = 'bar'; // syntaxerror: illegal character // <37e> is not ; but looks like this this should work: "th...
...is is actually a string"; 42 - 13; var foo = 'bar'; some editors and ides will notify you or at least use a slightly different highlighting for it, but not all.
SyntaxError: missing formal parameter - JavaScript
in the declaration of a function, the parameters must be identifiers, not any value like numbers, strings, or objects.
...an identifier differs from a string in that a string is data, while an identifier is part of the code.
SyntaxError: missing ; before statement - JavaScript
however, oftentimes, this error is only a consequence of another error, like not escaping strings properly, or using var wrongly.
... examples unescaped strings this error can occur easily when not escaping strings properly and the javascript engine is expecting the end of your string already.
TypeError: invalid arguments - JavaScript
examples no strings in typed arrays typed arrays, for example a uint8array, can't be constructed from a string.
... in fact, strings can't be in typed arrays at all.
SyntaxError: Unexpected token - JavaScript
r (let i = 0; i < 5,; ++i) { console.log(i); } // syntaxerror: expected expression, got ')' correct would be omitting the comma or adding another expression: for (let i = 0; i < 5; ++i) { console.log(i); } not enough brackets sometimes, you leave out brackets around if statements: function round(n, upperbound, lowerbound){ if(n > upperbound) || (n < lowerbound){ throw 'number ' + string(n) + ' is more than ' + string(upperbound) + ' or less than ' + string(lowerbound); }else if(n < ((upperbound + lowerbound)/2)){ return lowerbound; }else{ return upperbound; } } // syntaxerror: expected expression, got '||' the brackets may look correct at first, but note how the || is outside the brackets.
... correct would be putting brackets around the ||: function round(n, upperbound, lowerbound){ if((n > upperbound) || (n < lowerbound)){ throw 'number ' + string(n) + ' is more than ' + string(upperbound) + ' or less than ' + string(lowerbound); }else if(n < ((upperbound + lowerbound)/2)){ return lowerbound; }else{ return upperbound; } } ...
JavaScript error reference - JavaScript
operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property listsyntaxerror: redeclaration of formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerror: "x" is (not) "y"typeerror: "x" is not a constructortypeerror: "x" is not a functiontypeerror: "x" is not a non-null objecttypeerror: "x" is read-onlytypeerror: 'x' is not iterabletypeerror: more arguments neededtypeerror: reduce of empty array with no initial valuetypeerror: x.prototype.y called on incompatible typetypeerror: can't access dead obj...
...configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return statement ...
Array.prototype[@@iterator]() - JavaScript
this could be a built-in object like string object or a custom object.
...oto__" or "it[symbol.iterator]" */)) { console.log(it, ' is not an iterable object...'); return; } var iterator = it[symbol.iterator](); // your browser must support for..of loop // and let-scoped variables in for loops // const and var could also be used for (let letter of iterator) { console.log(letter); } } // array logiterable(['a', 'b', 'c']); // a // b // c // string logiterable('abc'); // a // b // c logiterable(123); // 123 " is not an iterable object..." specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@iterator]()' in that specification.
Array.prototype.every() - JavaScript
if (typeof callbackfn !== 'function' && object.prototype.tostring.call(callbackfn) !== '[object function]') { throw new typeerror(); } // 5.
...let pk be tostring(k).
AsyncFunction - JavaScript
each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b".
... functionbody a string containing the javascript statements comprising the function definition.
Atomics.wait() - JavaScript
it returns a string which is either "ok", "not-equal", or "timed-out".
... return value a string which is either "ok", "not-equal", or "timed-out".
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.
... by default, the message property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the error constructor.
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.
... examples throwing a custom error var e = new error('malformed input'); // e.name is 'error' e.name = 'parseerror'; throw e; // e.tostring() would return 'parseerror: malformed input' specifications specification ecmascript (ecma-262)the definition of 'error.prototype.name' in that specification.
Error - JavaScript
instance methods error.prototype.tostring() returns a string representing the specified object.
... overrides the object.prototype.tostring() method.
Function() constructor - JavaScript
each must be a string that corresponds to a valid javascript identifier, or a list of such strings separated with a comma.
... functionbody a string containing the javascript statements comprising the function definition.
Function.name - JavaScript
a function object's read-only name property indicates the function's name as specified when it was created, or it may be rather anonymous or ''(an empty string) for functions created anonymously.
... (new function).name; // "anonymous" anonymous function expression anonymous function expressions that were created using the keyword function or arrow functions would have ""(an empty string) as their name.
Function - JavaScript
function.prototype.tostring() returns a string representing the source code of the function.
... overrides the object.prototype.tostring method.
GeneratorFunction - JavaScript
each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b".
... functionbody a string containing the javascript statements comprising the function definition.
Intl.Collator.supportedLocalesOf() - JavaScript
syntax intl.collator.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in collation without having to fall back to the runtime's default locale.
Intl.DateTimeFormat() constructor - JavaScript
syntax new intl.datetimeformat([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings.
... var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // tolocalestring without arguments depends on the implementation, // the default locale, and the default time zone console.log(new intl.datetimeformat().format(date)); // → "12/19/2012" if run with en-us locale (language) and time zone america/los_angeles (utc-0800) using timestyle and datestyle let o = new intl.datetimeformat("en" , { timestyle: "short" }); console.log(o.format(date.now())); // "13:31 am" ...
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
syntax intl.datetimeformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
Intl.DateTimeFormat - JavaScript
intl.datetimeformat.prototype.formattoparts() returns an array of objects representing the date string in parts that can be used for custom locale-aware formatting.
... var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // tolocalestring without arguments depends on the implementation, // the default locale, and the default time zone console.log(new intl.datetimeformat().format(date)); // → "12/19/2012" if run with en-us locale (language) and time zone america/los_angeles (utc-0800) using locales this example shows some of the variations in localized date and time formats.
Intl.DisplayNames() constructor - JavaScript
syntax new intl.displaynames([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings.
... "code" "none" examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned.
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.
... return value a language-specific formatted string.
Intl.DisplayNames.supportedLocalesOf() - JavaScript
syntax intl.displaynames.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
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​.List​Format​.prototype​.formatToParts() - JavaScript
description whereas intl.listformat.prototype.format() returns a string being the formated version of the list (according to the given locale and style options), formattoparts() returns an array of the different components of the formated string.
...the value property gives the content, as a string, of the token.
Intl.ListFormat.supportedLocalesOf() - JavaScript
syntax intl.listformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
Intl.Locale() constructor - JavaScript
syntax new intl.locale(tag [, options]) parameters tag the unicode locale identifier string.
... examples basic usage at its very simplest, the intl.locale constructor takes a locale identifier string as its argument: let us = new intl.locale('en-us'); using the locale constructor with an options object the constructor also takes an optional configuration object argument, which can contain any of several extension types.
Intl.Locale.prototype.maximize() - JavaScript
examples using maximize let mylocale = new intl.locale("fr", {hourcycle: "h24", calendar: "gregory"}); console.log(mylocale.basename); // prints "fr" console.log(mylocale.tostring()); // prints "fr-u-ca-gregory-hc-h24" let mylocmaximized = mylocale.maximize(); // prints "fr-latn-fr".
...console.log(mylocmaximized.tostring()); specifications specification ecmascript internationalization api (ecma-402) ...
Intl.Locale.prototype.minimize() - JavaScript
examples using minimize let mylocale = new intl.locale("fr-latn-fr", {hourcycle: "h24", calendar: "gregory"}); console.log(mylocale.basename); // prints "fr-latn-fr" console.log(mylocale.tostring()); // prints "fr-latn-fr-u-ca-gregory-hc-h24" let mylocminimized = mylocale.minimize(); // prints "fr", since french is only written in the latin script // and is most likely to be spoken in france.
...console.log(mylocminimized.tostring()); specifications specification ecmascript internationalization api (ecma-402) ...
Intl.NumberFormat.supportedLocalesOf() - JavaScript
syntax intl.numberformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in number formatting without having to fall back to the runtime's default locale.
Intl.PluralRules() constructor - JavaScript
a string with a bcp 47 language tag, or an array of such strings.
... examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned.
Intl.PluralRules.select() - JavaScript
the intl.pluralrules.prototype.select method returns a string indicating which plural rule to use for locale-aware formatting.
... return value a string representing the pluralization category of the number, can be one of zero, one, two, few, many or other.
Intl.PluralRules.supportedLocalesOf() - JavaScript
syntax intl.pluralrules.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in plural formatting without having to fall back to the runtime's default locale.
Intl.RelativeTimeFormat() constructor - JavaScript
a string with a bcp 47 language tag, or an array of such strings.
...rtf.format(1, "day"); // > "in 1 day" using the auto option if numeric:auto option is passed, it will produce the string yesterday or tomorrow instead of 1 day ago or in 1 day.
Intl.RelativeTimeFormat.prototype.format() - JavaScript
description the function returned by the format getter formats a value and a unit into a string according to the locale and formatting options of this intl.relativetimeformat object.
...rtf.format(1, "day"); // > "in 1 day" using the auto option if numeric:auto option is passed, it will produce the string yesterday or tomorrow instead of 1 day ago or in 1 day.
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
syntax intl.relativetimeformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
Number.prototype.toExponential() - JavaScript
the toexponential() method returns a string representing the number object in exponential notation.
... return value a string representing the given number object in exponential notation with one digit before the decimal point, rounded to fractiondigits digits after the decimal point.
Object.defineProperty() - JavaScript
var pattern = { get() { return 'i always return this string, ' + 'whatever you have assigned'; }, set() { this.myname = 'this is my name string'; } }; function testdefinesetandget() { object.defineproperty(this, 'myproperty', pattern); } var instance = new testdefinesetandget(); instance.myproperty = 'test'; console.log(instance.myproperty); // i always return this string, whatever you have assigned console.log(in...
...stance.myname); // this is my name string inheritance of properties if an accessor property is inherited, its get and set methods will be called when the property is accessed and modified on descendant objects.
Object.getOwnPropertyNames() - JavaScript
return value an array of strings that corresponds to the properties found directly in the given object.
... description object.getownpropertynames() returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object obj.
handler.ownKeys() - JavaScript
the type of each array element is either a string or a symbol.
... const obj = {}; object.defineproperty(obj, 'a', { configurable: false, enumerable: true, value: 10 } ); const p = new proxy(obj, { ownkeys: function(target) { return [123, 12.5, true, false, undefined, null, {}, []]; } }); console.log(object.getownpropertynames(p)); // typeerror: proxy [[ownpropertykeys]] must return an array // with only string and symbol elements specifications specification ecmascript (ecma-262)the definition of '[[ownpropertykeys]]' in that specification.
RegExp.prototype.flags - JavaScript
the flags property returns a string consisting of the flags of the current regular expression object.
... polyfill if (regexp.prototype.flags === undefined) { object.defineproperty(regexp.prototype, 'flags', { configurable: true, get: function() { return this.tostring().match(/[gimsuy]*$/)[0]; } }); } examples using flags /foo/ig.flags; // "gi" /bar/myu.flags; // "muy" specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.flags' in that specification.
RegExp.input ($_) - JavaScript
the non-standard input property is a static property of regular expressions that contains the string against which a regular expression is matched.
... the value of the input property is modified whenever the searched string on the regular expression is changed and that string is matching.
RegExp.leftContext ($`) - JavaScript
the non-standard leftcontext property is a static and read-only property of regular expressions that contains the substring preceding the most recent match.
... you can not use the shorthand alias with the dot property accessor (regexp.$`), because the parser expects a starting template string in that case and a syntaxerror is thrown.
RegExp.prototype.multiline - JavaScript
the "m" flag indicates that a multiline input string should be treated as multiple lines.
... for example, if "m" is used, "^" and "$" change from matching at only the start or end of the entire string to the start or end of any line within the string.
RegExp.rightContext ($') - JavaScript
the non-standard rightcontext property is a static and read-only property of regular expressions that contains the substring following the most recent match.
... you can not use the shorthand alias with the dot property accessor (regexp.$'), because the parser expects a starting string in that case and a syntaxerror is thrown.
WebAssembly.Module.customSections() - JavaScript
the webassembly.customsections() function returns a copy of the contents of all custom sections in the given module with the given string name.
... sectionname the string name of the desired custom section.
Standard built-in objects - JavaScript
number bigint math date text processing these objects represent strings and support manipulating them.
... string regexp indexed collections these objects represent collections of data which are ordered by an index value.
Addition (+) - JavaScript
the addition operator (+) produces the sum of numeric operands or string concatenation.
... syntax operator: x + y examples numeric addition // number + number -> addition 1 + 2 // 3 // boolean + number -> addition true + 1 // 2 // boolean + boolean -> addition false + false // 0 string concatenation // string + string -> concatenation 'foo' + 'bar' // "foobar" // number + string -> concatenation 5 + 'foo' // "5foo" // string + boolean -> concatenation 'foo' + false // "foofalse" specifications specification ecmascript (ecma-262)the definition of 'addition operator' in that specification.
Nullish coalescing operator (??) - JavaScript
0; console.log(vala); // "default for a" console.log(valb); // "" (as the empty string is not null or undefined) console.log(valc); // 42 assigning a default value to a variable earlier, when one wanted to assign a default value to a variable, a common pattern was to use the logical or operator (||): let foo; // foo is never assigned any value so it is still undefined let somedummytext = foo || 'hello!'; however, due to || being a boolean logical operator, the left hand-side ...
... let count = 0; let text = ""; let qty = count || 42; let message = text || "hi!"; console.log(qty); // 42 and not 0 console.log(message); // "hi!" and not "" the nullish coalescing operator avoids this pitfall by only returning the second operand when the first one evaluates to either null or undefined (but no other falsy values): let mytext = ''; // an empty string (which is also a falsy value) let notfalsytext = mytext || 'hello world'; console.log(notfalsytext); // hello world let preservingfalsy = mytext ??
Spread syntax (...) - JavaScript
spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
... syntax for function calls: myfunction(...iterableobj); for array literals or strings: [...iterableobj, '4', 'five', 6]; for object literals (new in ecmascript 2018): let objclone = { ...obj }; rest syntax (parameters) rest syntax looks exactly like spread syntax.
this - JavaScript
primitives like 7 or 'foo' will be converted to an object using the related constructor, so the primitive number 7 is converted to an object as if by new number(7) and the string 'foo' to an object as if by new string('foo'), e.g.
... function bar() { console.log(object.prototype.tostring.call(this)); } bar.call(7); // [object number] bar.call('foo'); // [object string] bar.call(undefined); // [object global] the bind method ecmascript 5 introduced function.prototype.bind().
for...of - JavaScript
the for...of statement creates a loop iterating over iterable objects, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined iterables.
... const iterable = [10, 20, 30]; for (let value of iterable) { value += 1; console.log(value); } // 11 // 21 // 31 iterating over a string const iterable = 'boo'; for (const value of iterable) { console.log(value); } // "b" // "o" // "o" iterating over a typedarray const iterable = new uint8array([0x00, 0xff]); for (const value of iterable) { console.log(value); } // 0 // 255 iterating over a map const iterable = new map([['a', 1], ['b', 2], ['c', 3]]); for (const entry of iterable) { console.log(entry); } // ['a', 1...
import - JavaScript
only single quoted and double quoted strings are allowed.
... when the module you are importing does not exist at load time when the import specifier string needs to be constructed dynamically.
Strict mode - JavaScript
eval code, function code, event handler attributes, strings passed to windowtimers.settimeout(), and related functions are entire scripts, and invoking strict mode in them works as expected.
...for a normal function, this is always an object: either the provided object if called with an object-valued this; the value, boxed, if called with a boolean, string, or number this; or the global object if called with an undefined or null this.
JavaScript
the complete modules available there are as follows: javascript first steps answers some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?", along with discussing key javascript features such as variables, strings, numbers, and arrays.
... standard objects get to know standard built-in objects array, boolean, date, error, function, json, math, number, object, regexp, string, map, set, weakmap, weakset, and others.
Authoring MathML - MathML
h mpadded): function hasmathmlsupport() { var div = document.createelement("div"), box; div.innerhtml = "<math><mspace height='23px' width='77px'/></math>"; document.body.appendchild(div); box = div.firstchild.firstchild.getboundingclientrect(); document.body.removechild(div); return math.abs(box.height - 23) <= 1 && math.abs(box.width - 77) <= 1; } alternatively, the following ua string sniffing will allow to detect the rendering engines with native mathml support (gecko and webkit).
... 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.
<mfenced> - MathML
close a string for the closing delimiter.
... open a string for the opening delimiter.
SVG Styling Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeStyling
value: any valid id string; animatable: yes style it specifies style information for its element.
... value: any valid style string; animatable: no ...
format - SVG: Scalable Vector Graphics
WebSVGAttributeformat
two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the format of the given font.
... here is a list of font formats and their strings that can be used as values for this attribute: format string format truedoc-pfr truedoc™ portable font resource embedded-opentype embedded opentype type-1 postscript™ type 1 truetype truetype opentype opentype, including truetype open truetype-gx truetype with gx extensions speedo speedo intellifont intellifont specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'format for <glyphref>' in that specification.
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
value type: <string> ; default value: none; animatable: no format the format of the given font.
... value type: <string> ; default value: none; animatable: no xlink:href an <iri> reference either to a <glyph> element in an svg document or to an <altglyphdef> element.
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
several bézier curves can be stringed together to create extended, smooth shapes.
... q x1 y1, x y (or) q dx1 dy1, dx dy <svg width="190" height="160" xmlns="http://www.w3.org/2000/svg"> <path d="m 10 80 q 95 10 180 80" stroke="black" fill="transparent"/> </svg> as with the cubic bézier curve, there is a shortcut for stringing together multiple quadratic béziers, called with t.
Subresource Integrity - Web security
an integrity value begins with at least one string, with each string including a prefix indicating a particular hash algorithm (currently the allowed prefixes are sha256, sha384, and sha512), followed by a dash, and ending with the actual base64-encoded hash.
... example integrity string with base64-encoded sha384 hash: sha384-oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc so oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc is the "hash" part, and the prefix sha384 indicates that it's a sha384 hash.
Tutorials
after that, we discuss some key javascript features in detail, such as variables, strings, numbers and arrays.
... intermediate level introducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis built on top of javascript.
Using custom elements - Web Components
this takes as its arguments: a domstring representing the name you are giving to the element.
...this takes an image icon and a text string, and embeds the icon into the page.
Using shadow DOM - Web Components
high-level view this article assumes you are already familiar with the concept of the dom (document object model) — a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an html document in the case of web documents).
...this takes an image icon and a text string, and embeds the icon into the page.
contains - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the contains function determines whether the first argument string contains the second argument string and returns boolean true or false.
... syntax contains(haystack, needle) arguments haystack the string to be searched needle the string to look for as a substring of haystack returns true if haystack contains needle.
generate-id - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the generate-id function generates a unique id for the first node in a given node-set and returns a string containing that id.
... returns a string containing the generated id.
id - XPath
WebXPathFunctionsid
syntax id(expression ) arguments expression if expression is a node-set, then the string value of each node in the node-set is treated as an individual id.
... if expression is a string, or anything other than a node-set, then expression is treated as a space-separated list of ids.
lang - XPath
WebXPathFunctionslang
syntax lang(string ) arguments string the language code or localization (language and country) code to be matched.
... if the given string does not specify a country code, this function will match nodes of that language with any country code.
local-name - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the local-name function returns a string representing the local name of the first node in a given node-set.
... returns a string.
name - XPath
WebXPathFunctionsname
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the name function returns a string representing the qname of the first node in a given node-set.
... returns a string representing the qname of a node.
XPath snippets - XPath
the first argument is a dom node or document object, while the second is a string defining an xpath expression.
...t : document); resolver = resolver || null; context = context || doc; result = doc.evaluate(expr, context, resolver, xpathresult.ordered_node_snapshot_type, null); for(i = 0; i < result.snapshotlength; i++) { a[i] = result.snapshotitem(i); } return a; } getxpathforelement the following function allows one to pass an element and an xml document to find a unique string xpath expression leading back to that element.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
29 <xsl:decimal-format> element, reference, xslt, decimal-format the <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function.
... 51 <xsl:value-of> element, reference, xslt, value-of the <xsl:value-of> element evaluates an xpath expression, converts it to a string, and writes that string to the result tree.
An Overview - XSLT: Extensible Stylesheet Language Transformations
the string "http://www.w3.org/1999/xsl/transform" is a constant that designates the elements so marked as belonging to the set of tags designated by the w3c in the 1999 xslt recommendation.
... another string that is occasionally seen in stylesheets, "http://www.w3.org/tr/wd-xsl", indicates compliance with an earlier working draft (hence the wd) of the w3c document.
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
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.
... var parser = new domparser(); var doc = parser.parsefromstring(astr, "text/xml"); figure 3 : performing the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); ...
Exported WebAssembly functions - WebAssembly
testfunc.tostring() returns an interesting result: function 0() { [native code] } this gives you more of an idea of its wrapper-type nature.
... their name property is the tostring() result of the function's index in the wasm module.
Communicating With Other Scripts - Archive of obsolete content
ddon-message", true, true, { hello: 'world' }); document.documentelement.dispatchevent(event); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content script "listen.js" listens for the new event and retrieves the payload from its detail attribute: window.addeventlistener("addon-message", function(event) { console.log(json.stringify(event.detail)); }, false); ...
Reddit Example - Archive of obsolete content
event.stoppropagation(); event.preventdefault(); self.port.emit('click', t.tostring()); }); this script uses jquery to interact with the dom of the page and the self.port.emit function to pass urls back to the add-on script.
Two Types of Scripts - Archive of obsolete content
content scripts may be supplied as literal strings or maintained in separate files and referenced by filename.
hotkeys - Archive of obsolete content
parameters options : object required options: name type combo string any function key: "f1, f2, ..., f24" or key combination in the format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys require at least one modifier as well as the key.
windows - Archive of obsolete content
parameters options : object required options: name type url string string url to be opened in the new window.
content/loader - Archive of obsolete content
any kind of jsonable value (object, array, string, etc.) can be used here.
preferences/event-target - Archive of obsolete content
globals constructor prefstarget(options) parameters options : object required options: name type branchname string by default this is "", the root.
remote/parent - Archive of obsolete content
parameters id : string the module to load.
ui/id - Archive of obsolete content
returns string : returns a uuid by default (or domain specific id based on a provided definition).
util/collection - Archive of obsolete content
propname : string the name of the property.
Low-Level APIs - Archive of obsolete content
util/match-pattern test strings containing urls against simple patterns.
Release notes - Archive of obsolete content
removed tab-browser, app-strings and api-utils.publicconstructor details github commits made between firefox 28 and firefox 29.
cfx to jpm - Archive of obsolete content
add-on ids need to be one of two types: a guid or a string that includes an "@" symbol.
console - Archive of obsolete content
the value for each preference is the desired logging level, given as a string.
Creating annotations - Archive of obsolete content
resetmatchedelement(); ancestor = $(this).closest("[id]"); matchedelement = $(this).first(); originalbgcolor = $(matchedelement).css('background-color'); $(matchedelement).css('background-color', 'yellow'); $(matchedelement).bind('click.annotator', function(event) { event.stoppropagation(); event.preventdefault(); self.port.emit('show', [ document.location.tostring(), $(ancestor).attr("id"), $(matchedelement).text() ] ); }); }); conversely, the add-on resets the matched element on mouseout: $('*').mouseout(function() { resetmatchedelement(); }); save this code in a new file called selector.js in your add-on's data directory.
Displaying annotations - Archive of obsolete content
the complete content script is here: self.on('message', function onmessage(annotations) { annotations.foreach( function(annotation) { if(annotation.url == document.location.tostring()) { createanchor(annotation); } }); $('.annotated').css('border', 'solid 3px yellow'); $('.annotated').bind('mouseenter', function(event) { self.port.emit('show', $(this).attr('annotation')); event.stoppropagation(); event.preventdefault(); }); $('.annotated').bind('mouseleave', function() { self.port.emit('hide'); }); }); function createanchor(annot...
Modifying the Page Hosted by a Tab - Archive of obsolete content
you should see a red border appear around the page, like this: keeping content scripts in a separate file in the example above, we've passed in content script as a string.
Bookmarks - Archive of obsolete content
arlier creating a new bookmark var win = mybrowser.contentwindow; // get the bookmarks service const bmsvc = components.classes["@mozilla.org/browser/bookmarks-service;1"] .getservice(components.interfaces.nsibookmarksservice); // create the bookmark bmsvc.createbookmarkincontainer(win.document.title, // bookmark name win.location.href.tostring(), // uri of the bookmark null, // shortcut win.document.title, // description win.document.characterset, // charset null, // postdata bookmarksservice.getbookmarkstoolbarfolder(), // bookmark folder 0); // ...
Drag & Drop - Archive of obsolete content
vor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numdropitems; i++) { var uri = null; dragsession.getdata(trans, i); var flavor = {}, data = {}, length = {}; trans.getanytransferdata(flavor, data, length); if (data) { try { var str = data.value.queryinterface(components.interfaces.nsisupportsstring); } catch(ex) { } if (str) { uri = _ios.newuri(str.data.split("\n")[0], null, null); } else { var file = data.value.queryinterface(components.interfaces.nsifile); if (file) uri = _ios.newfileuri(file); } } if (uri) uris.push(uri); } // use the array of file uris } t...
JavaScript Debugger Service - Archive of obsolete content
jsd.clearfilters(); // clear the list of filters // we exclude the scripts with the following filenames from being tracked jsd.appendfilter(createfilter("*/firefox/components/*")); jsd.appendfilter(createfilter("*/firefox/modules/*")); jsd.appendfilter(createfilter("xstringbundle")); jsd.appendfilter(createfilter("chrome://*")); jsd.appendfilter(createfilter("x-jsd:ppbuffer*")); jsd.appendfilter(createfilter("xpcsafejsobjectwrapper.cpp")); jsd.appendfilter(createfilter("file://*")); note that appendfilter adds the filter to the end of the list.
JavaScript timers - Archive of obsolete content
functions available to workers in addition to the standard javascript set of functions (such as string, array, object, json etc), there are a variety of functions available from the dom to workers.
Default Preferences - Archive of obsolete content
inside your file you set preferences using the pref() function: pref("name", "value") example: pref('extensions.defaultprefs.example.int', 1); pref('extensions.defaultprefs.example.float', 0.1); pref('extensions.defaultprefs.example.string', 'fadf'); pref('extensions.defaultprefs.example.bool', true); notice that unlike when you're reading preferences, writing default preferences uses the same function no matter the data type of the preference.
Downloading JSON and JavaScript in extensions - Archive of obsolete content
once the content has been downloaded, the extension authors proceed to use eval() to decode the string content into javascript objects.
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.
Adding sidebars - Archive of obsolete content
using a .properties file and a string bundle is a viable option, but it involves a lot of code for something so simple, specially if that's the only case where you need dynamic text.
Adding windows and dialogs - Archive of obsolete content
getservice(ci.nsipromptservice); prompts.alert(window, "alert title", "hello!"); you should of course use localized strings instead of hard-coded ones.
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
instead of a boolean preference, it would be best to use a string preference with the last-installed add-on version.
Appendix F: Monitoring DOM changes - Archive of obsolete content
* * @param {string} selector the css selector of nodes about which you * want to be notified.
Handling Preferences - Archive of obsolete content
if you need to refer to the term "preference" in any of your locale files, you must change the string depending on the operating system.
Intercepting Page Loads - Archive of obsolete content
in most cases you'll need to compare the page url with some string or regular expression: if (some_regular_expression.test(doc.defaultview.location.href)) you can access and modify the dom of the loaded page, just like you normally would for xul and html documents.
Session store API - Archive of obsolete content
tore data when tabs are restored, you can install a listener like this: function myextensionhandlerestore(aevent) { var tab = event.originaltarget; /* the tab being restored */ var uri = tab.linkedbrowser.contentdocument.location; /* the tab's uri */ components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage("restoring tab: " + uri); }; document.addeventlistener("sstabrestoring", myextensionhandlerestore, false); simply replace the contents of the function myextensionhandlerestore() with whatever you need to do when the tab is restored.
Signing an XPI - Archive of obsolete content
i found mine in c:\documents and settings\tj\application data\mozilla\firefox\profiles\xxxxxxxx.default\ where xxxxxxxx is a random string of characters.
Tabbed browser - Archive of obsolete content
var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsessionstore.settabstate(tab, json.stringify({ entries: [ { title: url } ], usertypedvalue: url, usertypedclear: 2, lastaccessed: tab.lastaccessed, index: 1, hidden: false, attributes: {}, image: null })); reusing tabs rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if one is already open.
Using the Stylesheet Service - Archive of obsolete content
using the api the string "chrome://myext/content/myext.css" in the examples below is just an example.
Underscores in class and ID Names - Archive of obsolete content
for example, a function whose job is to "get the length of a string" might be called get_string_length, and a variable representing the number of people who voted republican might be voted_republican.
XUL user interfaces - Archive of obsolete content
s(); } function showstatus(adate) { if (adate == null) { status.removeattribute("warning") status.setattribute("label", "") } else if (adate === false || isnan(adate.gettime())) { status.setattribute("warning", "true") status.setattribute("label", "date is not valid") } else { status.removeattribute("warning") status.setattribute("label", adate.tolocaledatestring()) } } to see the result exactly as intended, use the default theme in your browser.
MozAudioAvailable - Archive of obsolete content
type read only domstring the type of event.
MozBeforeResize - Archive of obsolete content
type read only domstring the type of event.
cached - Archive of obsolete content
type string the type of event.
checking - Archive of obsolete content
type string the type of event.
downloading - Archive of obsolete content
type string the type of event.
error - Archive of obsolete content
type string the type of event.
noupdate - Archive of obsolete content
type string the type of event.
obsolete - Archive of obsolete content
type string the type of event.
progress - Archive of obsolete content
type string the type of event.
updateready - Archive of obsolete content
type string the type of event.
Install.js - Archive of obsolete content
stall.skin | installtype, jarpath, regpath); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.extpostinstallmessage) { install.alert(this.extpostinstallmessage); } } else { this.handleerror(err); return; } }, parsearguments: function() { // can't use string handling in install, so use if statement instead var args = install.arguments; if (args == 'p=0') { this.profileinstall = false; this.silentinstall = true; } else if (args == 'p=1') { this.profileinstall = true; this.silentinstall = true; } }, handleerror: function(err) { if (!this.silentinstall) { install.alert('error: could not install ' + this.extfullname ...
cert_override.txt - Archive of obsolete content
.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid issuer cert) t : allow errors in the validity time, for example, for expired or not yet valid certs certificate's serial number and the issuer name as a base64 encoded string ...
Source Navigator - Archive of obsolete content
searching a string ...
Source code directories overview - Archive of obsolete content
the "c" runtime library contains basic non-visual c functions to allocate and deallocate memory, get the time and date, read and write files, handle threads and handling and compare strings across all platforms.
Bookmark Keywords - Archive of obsolete content
replace the bug's number (82839) with the string %s.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
in fact, all win32 api functions dealing with character strings can be added an 'a' to the end to avoid unicode cast errors.
Enabling the behavior - updating the status periodically - Archive of obsolete content
"/> <script type="application/javascript" src="chrome://navigator/content/navigator.js"/> <script type="application/javascript" src="chrome://navigator/content/navigatordd.js"/> <script type="application/javascript" src="chrome://navigator/content/sessionhistoryui.js"/> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js"/> <!-- hook for stringbundle overlays --> ...
Making it into a static overlay - Archive of obsolete content
ipt type="application/javascript" src="chrome://navigator/content/navigator.js"/> <script type="application/javascript" src="chrome://navigator/content/navigatordd.js"/> <script type="application/javascript" src="chrome://navigator/content/sessionhistoryui.js"/> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js"/> <!-- hook for stringbundle overlays --> ...
Embedding FAQ - Archive of obsolete content
here is the code : import org.eclipse.swt.swt; import org.eclipse.swt.browser.mozillabrowser; import org.eclipse.swt.browser.progressevent; import org.eclipse.swt.browser.progresslistener; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.shell; import org.mozilla.xpcom.nsidomdocument; public class test { public static void main(string args[]) { display display = new display(); shell shell = new shell(display); final mozillabrowser browser = new mozillabrowser(shell,wt.border); browser.seturl("http://www.google.com"); browser.addprogresslistener(new progresslistener() { public void changed(progressevent event) { ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
these api calls will typically pass in a uri string or object to load, and may include information like the name of the target frame (for <a target="something">, e.g.).
Layout FAQ - Archive of obsolete content
this function converts an nsastring to an nsacstring by assuming that all the 16-bit units are ascii and just dropping the high byte on them all.
Hidden prefs - Archive of obsolete content
see nsabquerystringtoexpression::createbooleanconditionstring() for other operators.
JavaScript OS.Shared - Archive of obsolete content
global object os.shared.type properties void_t voidptr_t char jschar int unsigned_int int32_t uint32_t int64_t uint64_t long bool off_t size_t ssize_t fd (unix only) negativeone_or_fd (unix only) negativeone_or_nothing (unix only) string (unix only) null_or_string (unix only) handle (windows only) maybe_handle (windows only) dword (windows only) negative_or_dword (windows only) zero_or_dword (windows only) zero_or_nothing (windows only) declareffi() intn_t() uintn_t()instances of os.shared.type convert_from_c() releasewith() attributes global object os.shared.hollowstructure in_ptr out_ptr inout_ptr ...
statusBar - Archive of obsolete content
syntax jetpack.statusbar.append(options); possible options are: url width (string/length) the width of the panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended.
Modularization techniques - Archive of obsolete content
for those who like gory details, their structure is this: struct nsid { pruint32 m0; pruint16 m1, m2; pruint8 m3[8]; }; frequently you see them represented as strings, like this: {221ffe10-ae3c-11d1-b66c-00805f8a2676} to initialize an id struct you declare them like this: id = {0x221ffe10, 0xae3c, 0x11d1, {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}}; why the b66c couplet gets broken up and grouped with the last set of bytes is probably a footnote somewhere.
Mozilla Application Framework in Detail - Archive of obsolete content
tools including various xpcom manager interfaces, smart pointers, special string classes, and an extensive collection of macros that make your c++ implementations easy to write and extend.
BundleLibrary - Archive of obsolete content
mail: ymail.webapp (note that this fakes a firefox user agent string while running, which may affect other running web applications.) ...
Configuration - Archive of obsolete content
an asterisk is used to match any string.
RDF Datasource How-To - Archive of obsolete content
replace "my data source" with a descriptive string that should appear in the registry.
open - Archive of obsolete content
type a string describing the type of file being opened.
Tamarin Acceptance Test Template - Archive of obsolete content
addtestcase is a function that is defined * in shell.as and takes three arguments: * - a string representation of what is being tested * - the expected result * - the actual result * * for example, a test might look like this: * * var helloworld = "hello world"; * * addtestcase( * "var helloworld = 'hello world'", // description of the test * "hello world", // expected result * helloworld ); // actual result * */ // add your tests h...
Running Tamarin performance tests - Archive of obsolete content
rks - use builtin.abc (used to be location of global.abc) -b --builtinabc location of builtin.abc -s --shellabc location of shell_toplevel.abc -x --exclude comma separated list of directories to skip -h --help display help and exit -t --notime do not generate timestamps (cleaner diffs) -f --forcerebuild force rebuild all test files -c --config sets the config string [default os-tvm] -q --quiet display minimum output during testrun -l --log also log all output to given logfile --summaryonly only display final summary --rebuildtests rebuild the tests only - do not run against vm --showtimes shows the time for each test --ascargs args to pass to asc on rebuild of test files --vmargs args to pass to vm ...
Tamarin build documentation - Archive of obsolete content
export avm=release/ceremoteshell.exe, the ceremoteshell.exe behaves as a proxy copying and running abc files on the windows mobile device build a windows mobile tamarin shell, copy the shell to the windows mobile device in \program files\shell\avmshell.exe (optional) can sanity check the windows mobile shell is functioning by running $avm hello.abc (where hello.abc is a simple abc to print a string, or can substitute with any test abc) now any acceptance or performance tests can be run as on desktop using test/acceptance/runtests.py or tests/performance/runtests.py tamarin buildbot adobe maintains a continuous build and test system for tamarin redux, similar to tinderbox.
Tamarin Roadmap - Archive of obsolete content
tc jan '09 feature links status integrate the tt string class tamarin:string implementation tamarin:strings bug 465506 complete enhanced c++ profiler enhance memory profiler to work in release builds and be more performant in progress enable lir for arm targets bug 460764 complete amd64 nanojit bug 464476 in progress port nanojit to powerpc bug 458077 complete add mac-x64 and linux-x64 buildbots complete fail build on assertion in acceptance tests complete merge tracking bug bug 469836 in progres...
Tamarin - Archive of obsolete content
tamarin strings documentation the implementation of tamarin strings has changed.
Venkman Introduction - Archive of obsolete content
icon data type icon data type void (undefined) value null value boolean value string value integer value double value object value function value figure 9.
Using Breakpoints in Venkman - Archive of obsolete content
if the breakpoint script returns a true value (it doesn't have to strictly be a boolean true, any non-null, non-empty string, non-zero, non-undefined, and non-false value will do), execution will continue normally.
Binding Attachment and Detachment - Archive of obsolete content
respectively bindings can be detached by setting element.style.mozbinding to empty string.
XML in Mozilla - Archive of obsolete content
this feature is used mainly to localize mozilla to different languages (the ui strings are stored in external dtd files).
Mac stub installer - Archive of obsolete content
note that there are two macro strings in the .jsts: $version$ which is replaced at packages time with the browser version.
Unix stub installer - Archive of obsolete content
note that there are two macro strings in the .jsts: $version$ which is replaced at packages time with the browser version.
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.
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.
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.
Methods - Archive of obsolete content
tostring converts an installversion init to a string.
InstallVersion Object - Archive of obsolete content
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.
deleteRegisteredFile - Archive of obsolete content
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.
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.
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.
setPackageFolder - Archive of obsolete content
you create this object by passing a string representing the directory to the getfolder or getcomponentfolder method.
Methods - Archive of obsolete content
loadresources returns an object whose properties are localized strings loaded from the specified property file.
WinProfile Object - Archive of obsolete content
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.
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".
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.
WinRegValue - Archive of obsolete content
description advanced windows developers can use this object to manipulate non-string values for the windows registry.
browserid - Archive of obsolete content
« xul reference home browserid type: string the id of the browser element to which the findbar is attached.
findnextaccesskey - Archive of obsolete content
« xul reference home findnextaccesskey type: string the access key for the "find next" toolbar button in the findbar.
findpreviousaccesskey - Archive of obsolete content
« xul reference home findpreviousaccesskey type: string the access key for the "find previous" toolbar button in the findbar.
highlightaccesskey - Archive of obsolete content
« xul reference home highlightaccesskey type: string the access key for the "highlight" toolbar button in the findbar.
matchcaseaccesskey - Archive of obsolete content
« xul reference home matchcaseaccesskey type: string the access key for the "match case" checkbox in the findbar.
acceltext - Archive of obsolete content
« xul reference home acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.
activetitlebarcolor - Archive of obsolete content
« xul reference home activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground).
autocompletesearchparam - Archive of obsolete content
« xul reference home autocompletesearchparam new in thunderbird 3 requires seamonkey 1.1 type: string a string which is passed to the search component.
bottom - Archive of obsolete content
« xul reference home bottom type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the bottom edge of the element relative to the bottom edge of the stack.
buttonaccesskeyaccept - Archive of obsolete content
« xul reference home buttonaccesskeyaccept type: string the access key to use for the "accept" button.
buttonaccesskeycancel - Archive of obsolete content
« xul reference home buttonaccesskeycancel type: string the access key to use for the "cancel" button.
buttonaccesskeydisclosure - Archive of obsolete content
« xul reference home buttonaccesskeydisclosure type: string the access key to use for the "disclosure" button.
buttonaccesskeyextra1 - Archive of obsolete content
« xul reference home buttonaccesskeyextra1 type: string the access key to use for the first extra button.
buttonaccesskeyextra2 - Archive of obsolete content
« xul reference home buttonaccesskeyextra2 type: string the access key to use for the second extra button.
buttonaccesskeyhelp - Archive of obsolete content
« xul reference home buttonaccesskeyhelp type: string the access key to use for the "help" button.
buttonalign - Archive of obsolete content
« xul reference home buttonalign type: string the value of the align attribute for the box containing the buttons.
buttondir - Archive of obsolete content
« xul reference home buttondir type: string the value of the dir attribute for the box containing the buttons.
buttonlabelaccept - Archive of obsolete content
« xul reference home buttonlabelaccept type: string the label to appear on the "accept" button.
buttonlabelcancel - Archive of obsolete content
« xul reference home buttonlabelcancel type: string the label to appear on the "cancel" button.
buttonlabeldisclosure - Archive of obsolete content
« xul reference home buttonlabeldisclosure type: string the label to appear on the "disclosure" button.
buttonlabelextra1 - Archive of obsolete content
« xul reference home buttonlabelextra1 type: string the label to appear on the first extra button.
buttonlabelextra2 - Archive of obsolete content
« xul reference home buttonlabelextra2 type: string the label to appear on the second extra button.
buttonlabelhelp - Archive of obsolete content
« xul reference home buttonlabelhelp type: string the label to appear on the "help" button.
buttonorient - Archive of obsolete content
« xul reference home buttonorient type: string the value of the orient attribute for the box containing the buttons.
buttonpack - Archive of obsolete content
« xul reference home buttonpack type: string the value of the pack attribute for the box containing the buttons.
class - Archive of obsolete content
« xul reference home class type: string the style class of the element.
colorpicker.type - Archive of obsolete content
« xul reference home type type: string if this attribute is not present, the colorpicker is displayed inside the window.
datepicker.value - Archive of obsolete content
« xul reference home value type: string the initial value of the datepicker in the form yyyy-mm-dd.
defaultButton - Archive of obsolete content
« xul reference home defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
description - Archive of obsolete content
« xul reference home description type: string descriptive text to appear in addition to the dialog title.
droppedLinkHandler - Archive of obsolete content
droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface ...
editor.type - Archive of obsolete content
« xul reference home type type: string if set to the string content-primary, this editor becomes the primary content for the page.
emptytext - Archive of obsolete content
« xul reference home emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value.
expr - Archive of obsolete content
ArchiveMozillaXULAttributeexpr
« xul reference home expr type: string for xml queries, an xpath expression which returns results.
flex - Archive of obsolete content
ArchiveMozillaXULAttributeflex
« xul reference home flex type: string (representing an integer) indicates the flexibility of the element, which indicates how an element's container distributes remaining empty space among its children.
grippytooltiptext - Archive of obsolete content
« xul reference home grippytooltiptext seamonkey only type: string the text to appear on the tooltip for the toolbar's grippy when the toolbar is collapsed.
group - Archive of obsolete content
« xul reference home group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group.
height - Archive of obsolete content
« xul reference home height type: string (representing an integer) the preferred height of the element in pixels.
href - Archive of obsolete content
ArchiveMozillaXULAttributehref
« xul reference home href type: string defines a url to open when this element is clicked.
icon - Archive of obsolete content
ArchiveMozillaXULAttributeicon
« xul reference home icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons.
iconsize - Archive of obsolete content
« xul reference home iconsize type: string indicates whether the toolbar should display large icons or small icons; this should be the string "large" or "small", respectively.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
abstract version of the above would be a <button id="foo" label="click me" oncommand="setwidgetlabel(this, 'i was pressed')"/> <script> function setwidgetlabel(idname, newcaption){ document.getelementbyid( idname.id ).setattribute('label',newcaption) } </script> not specifying the id attribute for a window or a prefwindow fills the console with the following warning message: warning: empty string passed to getelementbyid() see also name ...
inactivetitlebarcolor - Archive of obsolete content
« xul reference home inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background).
inputtooltiptext - Archive of obsolete content
« xul reference home inputtooltiptext type: string the tooltip text for the textbox.
keycode - Archive of obsolete content
« xul reference home keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute.
keytext - Archive of obsolete content
« xul reference home keytext type: string a label for the keyboard shortcut.
label - Archive of obsolete content
« xul reference home label type: string the label that will appear on the element.
label.value - Archive of obsolete content
« xul reference home value type: string the text to be used for the label.
lastSelected - Archive of obsolete content
« xul reference home lastselected type: string set this to the id of the last selected pane.
left - Archive of obsolete content
ArchiveMozillaXULAttributeleft
« xul reference home left type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the left edge of the element relative to the left edge of the stack.
listcell.type - Archive of obsolete content
« xul reference home type type: string this attribute is reserved for use by anonymous children of listitem; do not use.
listitem.type - Archive of obsolete content
« xul reference home type type: string you can make an item in a listbox a checkbox by setting this attribute to the value checkbox.
maxheight - Archive of obsolete content
« xul reference home maxheight type: string (representing an integer) the maximum height of the element.
maxwidth - Archive of obsolete content
« xul reference home maxwidth type: string (representing an integer) the maximum width of the element.
member - Archive of obsolete content
« xul reference home member type: string may optionally be set to the variable to use as the member variable.
menuitem.name - Archive of obsolete content
« xul reference home name type: string name radio menuitems with the same name as put into a group.
minheight - Archive of obsolete content
« xul reference home minheight type: string (representing an integer) the minimum height of the element.
minwidth - Archive of obsolete content
« xul reference home minwidth type: string (representing an integer) the minimum width of the element.
multiple - Archive of obsolete content
otherwise, the entire value string is compared.
object - Archive of obsolete content
« xul reference home object type: string the object of the element.
ordinal - Archive of obsolete content
« xul reference home ordinal type: string (representing an integer) an integer which specifies the position of the element within its parent.
pageid - Archive of obsolete content
« xul reference home pageid type: id this attribute should be set to a string that identifies the page's identifer in the wizard.
panel.flip - Archive of obsolete content
« xul reference home flip type: string normally, when a popup opens near the edge of the screen, it flips over to open on the opposite side of the anchor, so that it doesn't extend off the screen.
panel.label - Archive of obsolete content
« xul reference home label type: string for panels with titlebars, the label on the titlebar.
panel.type - Archive of obsolete content
« xul reference home type type: string the panel type.
parsetype - Archive of obsolete content
« xul reference home parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer.
phase - Archive of obsolete content
« xul reference home phase type: string the event phase where the handler is invoked.
pickertooltiptext - Archive of obsolete content
« xul reference home pickertooltiptext type: string the text for the tooltip on the column picker.
placeholder - Archive of obsolete content
« xul reference home placeholder type: string a string that appears in the textbox when it has no value.
position - Archive of obsolete content
« xul reference home position type: string (representing an integer) when an element is in an overlay, the position is an index where the child is inserted.
preference.name - Archive of obsolete content
« xul reference home name type: string the name of the preference to change.
preference.type - Archive of obsolete content
int an integer string a string unichar a unicode string wstring a localized string.
prefwindow.type - Archive of obsolete content
« xul reference home type type: string set this attribute to child for preference dialogs that are child dialogs of a main preferences window.
query.name - Archive of obsolete content
« xul reference home name type: string the name of a parameter within the sql statement.
query.type - Archive of obsolete content
« xul reference home type type: one of the values below the type of the parameter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value ...
querytype - Archive of obsolete content
« xul reference home querytype type: string indicates the type of datasource used in a template.
rel - Archive of obsolete content
ArchiveMozillaXULAttributerel
less the numeric value of the subject must be less than the value greater the numeric value of the subject must be greater than the value before the string value of subject must come before value alphabetically after the string value of subject must come after value alphabetically startswith the value of subject must start with the value endswith the value of subject must end with the value contains the value of subject must contain the value as a substring ...
reserved - Archive of obsolete content
« xul reference home reserved type: string this attribute applies to a command element.
resizer.type - Archive of obsolete content
« xul reference hometypetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window.
right - Archive of obsolete content
« xul reference home right type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the right edge of the element relative to the right edge of the stack.
searchlabel - Archive of obsolete content
« xul reference home searchlabel type: string text used for 'find-as-you-type' (fayt) searching.
src - Archive of obsolete content
ArchiveMozillaXULAttributesrc
examples <iframe id="content-body" src="http://www.mozilla.org/"/> <browser src="http://www.mozilla.org" flex="1"/> <image src='firefoxlogo.png' width='135' height='130'/> see also prefpane.src treecell.src treecol.src script.src stringbundle.src checkbox.src ...
statustext - Archive of obsolete content
« xul reference home statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element.
subject - Archive of obsolete content
« xul reference home subject type: string the subject of the element.
template.container - Archive of obsolete content
« xul reference home container type: string may optionally be set to the variable to use as the container or reference variable.
textbox.label - Archive of obsolete content
« xul reference home label type: string if present and not empty, this will be exposed to screen readers through the label property.
textbox.value - Archive of obsolete content
« xul reference home value type: string the default value entered in a textbox.
timepicker.value - Archive of obsolete content
« xul reference home value type: string the initial value of the timepicker in either the form hh:mm:ss or hh:mm.
title - Archive of obsolete content
« xul reference home title type: string the text to appear in the title bar of the window.
titlebar - Archive of obsolete content
« xul reference home titlebar type: string set the panel's titlebar attribute to the value normal to display a panel with a titlebar.
toolbarbutton.title - Archive of obsolete content
« xul reference home title type: string this functionality only applies when toolbarbutton is used in the customize toolbar dialog.
toolbarbutton.type - Archive of obsolete content
« xul reference home type type: string the type of button.
toolbarname - Archive of obsolete content
« xul reference home toolbarname not in seamonkey 1.x type: string the name of the toolbar, which is listed on the show/hide toolbars menu.
tooltiptext - Archive of obsolete content
« xul reference home tooltiptext type: string used to set the text which appears in the tooltip when the user moves the mouse over the element.
tooltiptextnew - Archive of obsolete content
« xul reference home tooltiptextnew not in firefox type: string used to set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row.
top - Archive of obsolete content
ArchiveMozillaXULAttributetop
« xul reference home top type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the top edge of the element relative to the top edge of the stack.
treecol.width - Archive of obsolete content
« xul reference home width type: string (representing an integer) the preferred width of the tree column.
treeitem.label - Archive of obsolete content
« xul reference home label tipo: string (concatenación de caracteres) para un árbol tree con columnas simples, la etiqueta puede ser colocada directamnete sobre el elemeto "treeitem" sin la necesidad de una fila "row" y un elemento "treeitem" dentro.
uri - Archive of obsolete content
ArchiveMozillaXULAttributeuri
« xul reference home uri type: string for template-generated content, the attribute should be placed on the element where content generation should begin.
value - Archive of obsolete content
« xul reference home value type: string the string attribute allows you to associate a data value with an element.
var - Archive of obsolete content
ArchiveMozillaXULAttributevar
« xul reference home var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name".
where.subject - Archive of obsolete content
« xul reference home subject type: string the variable or string to compare.
where.value - Archive of obsolete content
« xul reference home value type: string the value to compare.
width - Archive of obsolete content
« xul reference home width type: string (representing an integer) the preferred width of the element.
wrap - Archive of obsolete content
ArchiveMozillaXULAttributewrap
« xul reference home wrap type: string set this attribute to the value off to disable word wrapping in the textbox.
CheckboxStateChange - Archive of obsolete content
type read only domstring the type of event.
DOMMenuItemActive - Archive of obsolete content
type read only domstring the type of event.
DOMMenuItemInactive - Archive of obsolete content
type read only domstring the type of event.
RadioStateChange - Archive of obsolete content
type read only domstring the type of event.
ValueChange - Archive of obsolete content
type read only domstring the type of event.
broadcast - Archive of obsolete content
type read only domstring the type of event.
close - Archive of obsolete content
type read only domstring the type of event.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
type read only domstring the type of event.
commandupdate - Archive of obsolete content
type read only domstring the type of event.
popuphidden - Archive of obsolete content
type read only domstring the type of event.
popuphiding - Archive of obsolete content
type read only domstring the type of event.
popupshowing - Archive of obsolete content
type read only domstring the type of event.
popupshown - Archive of obsolete content
type read only domstring the type of event.
Working With Directories - Archive of obsolete content
you can access a subdirectory by supplying a directory name as the second argument, or refer to one of the special directories by supplying a null string for the second argument.
International characters in XUL JavaScript - Archive of obsolete content
however, you can use unicode escapes – the earlier example rewritten using them would be: var text = "ein sch\u00f6nes beispiel eines mehrsprachigen textes: \u65e5\u672c\u8a9e"; an alternative might be to use property files via nsistringbundle or the xul <stringbundle> element; this would allow for localization of the xul.
addTab - Archive of obsolete content
ArchiveMozillaXULMethodaddTab
see preprocessing post data for preparing postdata out of a string.
getIcon - Archive of obsolete content
ArchiveMozillaXULMethodgetIcon
« xul reference home geticon( atab ) return type: string returns the url of the specified tab's favicon.
getSearchAt - Archive of obsolete content
« xul reference home getsearchat( index ) return type: string returns the search component with the given index.
insertItemAt - Archive of obsolete content
ends, then selects the newly created item --> <script language="javascript"> function insertitemtolist(){ var mylistbox = document.getelementbyid('mylistbox'); // create a date to get some labels and values var somedate = new date(); if(mylistbox.selectedindex == -1){ // no item was selected in list so append to the end mylistbox.appenditem( somedate.tolocaletimestring(), somedate.gettime() ); var newindex = mylistbox.getrowcount() -1 }else{ // item was selected so insert at the selected item var newindex = mylistbox.selectedindex; mylistbox.insertitemat(newindex, somedate.tolocaletimestring(), somedate.gettime()); } // select the newly created item mylistbox.selectedindex = newindex; } </script> <button label...
openPopup - Archive of obsolete content
to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored.
openWindow - Archive of obsolete content
the windowtype is a string specifying a window type.
showPopup - Archive of obsolete content
the popuptype should be one of the strings popup, context, or tooltip.
Methods - Archive of obsolete content
close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirstvisiblerow getindexofitem getitematindex getnextitem getnotificationbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring ...
Node - Archive of obsolete content
ArchiveMozillaXULNode
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 ) ...
Positioning - Archive of obsolete content
simple alignment values positions specified as a single word string are shortcuts for the values above.
align - Archive of obsolete content
ArchiveMozillaXULPropertyalign
« xul reference align type: string gets and sets the value of the align attribute.
amIndicator - Archive of obsolete content
« xul reference amindicator type: string the string value displayed for hours between midnight and noon, defaulting to am.
className - Archive of obsolete content
« xul reference classname type: string gets and sets the value of the class attribute.
contentTitle - Archive of obsolete content
« xul reference contenttitle type: string this read-only property contains the title of the document object in the browser.
crop - Archive of obsolete content
ArchiveMozillaXULPropertycrop
« xul reference crop type: string gets and sets the value of the crop attribute.
datepicker.value - Archive of obsolete content
« xul reference value type: string the currently selected date in the form yyyy-mm-dd.
decimalSymbol - Archive of obsolete content
« xul reference decimalsymbol type: string the character used for the decimal place indicator.
defaultButton - Archive of obsolete content
« xul reference defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
defaultValue - Archive of obsolete content
« xul reference defaultvalue type: string gets and sets the the default value in a textbox.
description - Archive of obsolete content
« xul reference description type: string set to the description of the currently selected menuitem.
dir - Archive of obsolete content
ArchiveMozillaXULPropertydir
« xul reference dir type: string gets and sets the value of the dir attribute.
dlgType - Archive of obsolete content
« xul reference dlgtype type: string gets and sets the value of the dlgtype attribute.
emptyText - Archive of obsolete content
« xul reference emptytext deprecated since gecko 2 type: string gets and sets a string that appears in the textbox when it has no value.
group - Archive of obsolete content
ArchiveMozillaXULPropertygroup
« xul reference group type: string group name gets and sets the value of the group attribute.
homePage - Archive of obsolete content
« xul reference homepage type: string home page url this property holds the value of the user's home page setting.
label - Archive of obsolete content
ArchiveMozillaXULPropertylabel
« xul reference label type: string gets and sets the value of the label attribute.
lastSelected - Archive of obsolete content
« xul reference lastselected type: string set this to the id of the last selected pane.
mode - Archive of obsolete content
ArchiveMozillaXULPropertymode
« xul reference mode type: string gets and sets the value of the mode attribute.
name - Archive of obsolete content
ArchiveMozillaXULPropertyname
« xul reference name type: string the name of the preference to change.
next - Archive of obsolete content
ArchiveMozillaXULPropertynext
« xul reference next type: string wizardpage id set to the pageid of the next page after this one.
object - Archive of obsolete content
« xul reference object type: string the object of the element.
orient - Archive of obsolete content
« xul reference orient type: string gets and sets the value of the orient attribute.
pack - Archive of obsolete content
ArchiveMozillaXULPropertypack
« xul reference pack type: string gets and sets the value of the pack attribute.
pageid - Archive of obsolete content
« xul reference pageid type: string wizardpage id this attribute should be set to a string that identifies the page's identifer in the wizard.
placeholder - Archive of obsolete content
« xul reference placeholder type: string gets and sets a string that appears in the textbox when it has no value.
pmIndicator - Archive of obsolete content
« xul reference pmindicator type: string the string value displayed for hours between noon and midnight, defaulting to pm.
position - Archive of obsolete content
« xul reference position type: string gets and sets the value of the position attribute.
priority - Archive of obsolete content
« xul reference priority type: string gets and sets the value of the priority attribute.
richlistitem.label - Archive of obsolete content
« xul reference label type: string gets the concatentation of text from any child label elements.
searchLabel - Archive of obsolete content
« xul reference searchlabel type: string gets and sets the value of the searchlabel attribute.
searchParam - Archive of obsolete content
« xul reference searchparam new in thunderbird 15 requires seamonkey 2.12 type: string gets and sets the value of the autocompletesearchparam attribute.
selType - Archive of obsolete content
« xul reference seltype type: string gets and sets the value of the seltype attribute.
selstyle - Archive of obsolete content
« xul reference selstyle type: string if set to the value primary, only the label of the primary column will be highlighted when an item in the tree is selected.
state - Archive of obsolete content
ArchiveMozillaXULPropertystate
« xul reference state type: string this read only property indicates whether the popup is open or not.
statusText - Archive of obsolete content
« xul reference statustext type: string gets and sets the value of the statustext attribute.
subject - Archive of obsolete content
« xul reference subject type: string the subject of the element.
textValue - Archive of obsolete content
« xul reference textvalue new in thunderbird 15 requires seamonkey 2.12 type: string returns the content of the textbox.
textbox.label - Archive of obsolete content
« xul reference label type: string sets the label attribute.
textbox.type - Archive of obsolete content
« xul reference type type: string set to the value autocomplete to have an autocomplete textbox.
textbox.value - Archive of obsolete content
« xul reference value type: string holds the current value of the textbox as a string.
timepicker.value - Archive of obsolete content
« xul reference value type: string the currently entered time of the form hh:mm:ss.
title - Archive of obsolete content
ArchiveMozillaXULPropertytitle
« xul reference title type: string the title that appears at the top of the wizard.
toolbarName - Archive of obsolete content
« xul reference toolbarname not in seamonkey 1.x type: string the name of the toolbar.
toolboxid - Archive of obsolete content
« xul reference toolboxid type: string the id of the toolbox this toolbar is a member of.
tooltipText - Archive of obsolete content
« xul reference tooltiptext type: string gets and sets the value of the tooltiptext attribute.
type - Archive of obsolete content
ArchiveMozillaXULPropertytype
« xul reference type type: string gets and sets the value of the type attribute.
userAction - Archive of obsolete content
« xul reference useraction type: string gets and sets the value of the useraction attribute.
value - Archive of obsolete content
ArchiveMozillaXULPropertyvalue
« xul reference value type: string gets and sets the value of the value attribute.
valueNumber - Archive of obsolete content
« xul reference valuenumber type: number in contrast to the value property which holds a string representation, the valuenumber property is a number containing the current value of the number box.
Property - Archive of obsolete content
earchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view webbrowserefind webnavigation webprogress width wizardpages wraparound year yearleadingzero ...
Actions - Archive of obsolete content
that is, the text ?relateditem in the label attribute will be replaced with the string 'http://www.xulplanet.com/rdf/b' for the first result.
Additional Navigation - Archive of obsolete content
however, a string value may be used instead.
Bindings - Archive of obsolete content
that is, the ?description variable will be replaced with an empty string when analyzing the attributes in the action body.
Multiple Rules - Archive of obsolete content
othermatch a specific value lessmatch if a number is less than anothermatch only negative values with one rule, positive values with another greatermatch if a number is greater than anotherdisplay values greater than 1000 differently beforematch if a value comes before another alphabetically aftermatch if a value comes after another alphabetically startswithmatch if a value starts with a specific string endswithmatch if a value ends with a specific string containsmatch if a value contains a substringto highlight results that contain a search term here is an example using the 'contains' operator: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?letters" expr="string-length(@name) - 1"/> </query> <rule> <where subjec...
Sorting Results - Archive of obsolete content
this marks a literal as being a date value rather than a string.
The Joy of XUL - Archive of obsolete content
xul provides a clear separation among the client application definition and programmatic logic ("content" consisting of xul, xbl, and javascript), presentation ("skin" consisting of css and images), and language-specific text labels ("locale" consisting of dtds and string bundles in .properties files).
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
document.getanonymousnodes(this)[0].value='' the text of the textbox is then assigned a value of a null string.
Advanced Rules - Archive of obsolete content
if a city does not have a temperature, the 'temp' variable will be set to an empty string.
Box Objects - Archive of obsolete content
these properties will return an empty string if the width or height attributes or properties were not set already.
Document Object Model - Archive of obsolete content
there are differences, of course, for example, while getattribute("hidden") will return the string 'true' for a hidden element, whereas the hidden property returns a boolean true value.
Element Positioning - Archive of obsolete content
this is useful if the user wants to enter a long string of text.
Focus and Selection - Archive of obsolete content
once you have the start and end positions, you can pull out the substring from the whole text.
Install Scripts - Archive of obsolete content
for maximum portability, you can't specify a string name for the directory.
Manipulating Lists - Archive of obsolete content
similar to the dom appendchild() function except that it takes a string label, and you do not have to worry about where to add it in the list structure.
Modifying a XUL Interface - Archive of obsolete content
note that while the label and value properties are strings, the checked property is a boolean property which will be set either true or false.
More Menu Features - Archive of obsolete content
set the value to the same string.
Templates - Archive of obsolete content
if a particular one is not found, the value of the attribute will be set to an empty string.
Using multiple DTDs - Archive of obsolete content
single dtd to make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element.
XUL Changes for Firefox 1.5 - Archive of obsolete content
<stringbundle> the <stringbundle> element has a strings property which may be used to retrieve an enumeration of all of the strings in the bundle.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
see tree treechildren see tree treecol see tree treecols see tree treeitem see tree treerow see tree elements that do not expose anything to screen readers/have no discovered accessibility issues yet: arrowscrollbox bbox box grippy hbox menuseparator overlay page script spacer splitter stringbundle stringbundleset vbox window elements not processed yet: action binding bindings broadcaster broadcasterset conditions content dialog dialogheader editor listcell member observes preference preferences prefpane prefwindow resizer richlistbox richlistitem resizer rule scrollbar scrollbox scrollcorner separator template textnode titlebar toolbar toolbarb...
The Implementation of the Application Object Model - Archive of obsolete content
we could do this using a registry that can map strings to cids, so we have a story for instantiating our different content nodes.
XUL Coding Style Guidelines - Archive of obsolete content
they are placed above the actual entity string in the format: <!-- localization note (entity.name): content --> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content provides helpful hints to the localizers.
elements - Archive of obsolete content
menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorner separator spacer splitter stack statusbar statusbarpanel stringbundle stringbundleset t tab tabbrowser tabbox tabpanel tabpanels tabs template textnode textbox titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple v vbox w...
listheader - Archive of obsolete content
label type: string the label that will appear on the element.
query - Archive of obsolete content
ArchiveMozillaXULquery
attributes expr examples (example needed) attributes expr type: string for xml queries, an xpath expression which returns results.
resizer - Archive of obsolete content
typetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window.
rule - Archive of obsolete content
ArchiveMozillaXULrule
parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer.
treecols - Archive of obsolete content
attributes pickertooltiptext properties accessibletype examples (example needed) attributes pickertooltiptext type: string the text for the tooltip on the column picker.
Building XULRunner - Archive of obsolete content
you can also check the user agent string in firefox help/about menu to get the mapping from a certain binary firefox version to the corresponding xulrunner version.
Building XULRunner with Python - Archive of obsolete content
.getservice(components.interfaces.nsiwindowwatcher); wwatch.openwindow(null, "chrome://global/content/console.xul", "_blank", "chrome,dialog=no,all", null); } // dump to the js console (xulrunner -jsconsole) function jsdump(str) { components.classes['@mozilla.org/consoleservice;1'] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage(str); } function jserror(str) { components.utils.reporterror(str); } a final tip is to use task manager to check for a zombie xulrunner process after a crash.
Debugging a XULRunner Application - Archive of obsolete content
jsdump(str) (function defined below) will output str as a "message" with a speech bubble icon next to it: function jsdump(str) { components.classes['@mozilla.org/consoleservice;1'] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage(str); } for more information about the error console see the error console and browser console article.
MacFAQ - Archive of obsolete content
dow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="myxul_hidden" windowtype="myxul:hiddenwindow" title="" width="0" height="0" persist="screenx screeny width height sizemode" > <!-- load the mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.logstringmessage("myxul: " + alogstring + "\n"); } function checkotherwindows() { var singletonwindowtype = nspreferences.copyunicharpref("toolkit.singletonwindowtype"); var windowmediator ...
XULRunner tips - Archive of obsolete content
some xulrunner components (in particular, the extension manager) depend on branding, in the sense that they expect to find certain strings in chrome://branding/locale/brand.dtd and chrome://branding/locale/brand.properties.
Windows and menus in XULRunner - Archive of obsolete content
the dtd is used to create entity references so strings for titles and labels are not stored directly in the xul file; this makes updating the text -- and localization of the application -- much easier.
toolkit.defaultChromeFeatures - Archive of obsolete content
type: string specified by: default prefs of xulrunner applications default: "chrome,dialog=no,all" example: pref("toolkit.defaultchromefeatures", "chrome,resizable=no,dialog=no"); the toolkit.defaultchromefeatures preference allows simple xulrunner-based applications to specify what features are passed to window.open() when the main application window is opened.
toolkit.defaultChromeURI - Archive of obsolete content
type: string specified by: default prefs of xulrunner applications default: none example: pref("toolkit.defaultchromeuri", "chrome://myapp/content/"); the toolkit.defaultchromeuri preference allows simple xulrunner-based applications to open a new window when the application is launched.
toolkit.singletonWindowType - Archive of obsolete content
preference type: string specified by: default prefs of xulrunner applications default: none example: pref("toolkit.singletonwindowtype", "xulmine"); by default, the toolkit.defaultchromeuri preference will cause xulrunner to open a new main application window each time an application is invoked.
XUL Explorer - Archive of obsolete content
support attribute value checking where appropriate (boolean and enumerated values) - xul checker support “best practice” checks such as: using of commands and keys, strings in dtds and so on - xul checker multi-tabbed editor support support wizards to generate common projects - extensions support extension testing using firefox extension test mode venkman support dom inspector support future: support more “best practice” checks such as: more a11y checks, strings in dtds and so on - xul checker allow users to add snippets on the fly add sidebars for ...
calIFileType - Archive of obsolete content
defined in calendar/base/public/caliimportexport.idl interface code [scriptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring description; }; attributes defaultextension the default extension that should be associated with files of this type.
xbDesignMode.js - Archive of obsolete content
* * contributor(s): doron rosenberg <doron@netscape.com> (original author) * * * * ***** end license block ***** */ /* xbdesignmode a javascript wrapper for browsers that support designmode */ function xbdesignmode(aiframe){ this.meditordocument = null; this.miframeelement = null; // argument is a string, therefore an id if ( (typeof(aiframe) == "string") && (document.getelementbyid(aiframe).tagname.tolowercase()=="iframe") ){ this.miframeelement = document.getelementbyid(aiframe); } else if( (typeof(aiframe)=="object") && (aiframe.tagname.tolowercase() == "iframe") ){ this.miframeelement = aiframe; } else { throw "argument isn't an id of an iframe or an iframe reference"; } ...
2006-10-26 - Archive of obsolete content
ubuntu firefox ua string a user questions ubuntu 6.10 and their firefox's ua string, the zeros seem to be wrong.
2006-10-27 - Archive of obsolete content
ubuntu firefox ua string a user questions ubuntu 6.10 and their firefox's ua string, the zeros seem to be wrong.
2006-11-03 - Archive of obsolete content
problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1.
2006-12-08 - Archive of obsolete content
new strings in thunderbird new strings in thunderbird new bugzilla-staging.mozilla.org a staging server for a new bugzilla upgrade.
JS-Engine FAQ - Archive of obsolete content
you can call getimplementationversion() on a context instance and it gives you a string, e.g.
External resources for plugin creation - Archive of obsolete content
feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more.
NPN_Evaluate - Archive of obsolete content
syntax #include <npruntime.h> bool npn_evaluate(npp npp, npobject *npobj, npstring *script, npvariant *result); parameters the function has the following parameters: npp the npp indicating which plugin instance's window to evaluate the script in.
NPN_GetProperty - Archive of obsolete content
<tt>propertyname</tt> a string identifier indicating the name of the property whose value is to be retrieved.
NPN_GetValue - Archive of obsolete content
memory for this string must be freed by the plugin via npn_memfree().
NPN_HasMethod - Archive of obsolete content
methodname a string identifier indicating the name of the method to look for.
NPN_HasProperty - Archive of obsolete content
<tt>propertyname</tt> a string identifier indicating the name of the property to look for.
NPN_Invoke - Archive of obsolete content
methodname a string identifier indicating the name of the method to invoke.
NPN_PostURL - Archive of obsolete content
to post to a temporary file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path string.
NPN_ReleaseVariantValue - Archive of obsolete content
npn_releasevariantvalue() will call npn_releaseobject() on npvariants of type npvarianttype_object, and npn_memfree() on npvariants of type npvarianttype_string.
NPN_RemoveProperty - Archive of obsolete content
propertyname a string identifier indicating the name of the property to remove.
NPN_SetException - Archive of obsolete content
<tt>message</tt> a utf-8 string describing the error that occurred.
NPN_SetProperty - Archive of obsolete content
<tt>propertyname</tt> a string identifier indicating the name of the property whose value is to be set.
NPN_Status - Archive of obsolete content
message pointer the buffer that contains the status message string to display.
NPN_UserAgent - Archive of obsolete content
see also npn_status() npn_version() gecko user agent string reference ...
NPUTF8 - Archive of obsolete content
syntax typedef char nputf8; description the nputf8 type is used in constructing utf-8 strings for use by the plugin scripting api extension.
NPVariantType - Archive of obsolete content
syntax typedef enum { npvarianttype_void, npvarianttype_null, npvarianttype_bool, npvarianttype_int32, npvarianttype_double, npvarianttype_string, npvarianttype_object } npvarianttype; description each type is self-explanatory.
NP_GetValue - Archive of obsolete content
values: nppvpluginnamestring: gets the name of the plug-in nppvplugindescriptionstring: gets the description string of the plug-in value plug-in name, returned by the function.
Vulnerabilities - Archive of obsolete content
an example is an input validation error, such as user-provided input not being properly evaluated for malicious character strings and overly long values associated with known attacks.
Building a Theme - Archive of obsolete content
that form the structure and behavior of an application ui), locale (dtd, .properties files etc that contain strings for the ui's localization), and skin (css and images that form the theme of the ui) finally, the path of a file to load.
-ms-accelerator - Archive of obsolete content
the -ms-accelerator css property is a microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut.
CSS - Archive of obsolete content
ArchiveWebCSS
it only works on mac os x.-ms-acceleratorthe -ms-accelerator css property is a microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut.-ms-block-progressionthe -ms-block-progression css property is a microsoft extension that specifies the block progression and layout orientation.-ms-content-zoom-chainingthe -ms-content-zoom-chaining css property is a microsoft extension specifying the zoom behavior that occurs when a user hits the zoom limit during page manipulation.-m...
E4X - Archive of obsolete content
ArchiveWebE4X
you may get syntaxerror "xml is a reserved identifier" (despite the xml being in a string).
Array.observe() - Archive of obsolete content
type: a string indicating the type of change taking place.
Array comprehensions - Archive of obsolete content
even strings may be used as input; to achieve the filter and map actions (under array-like objects) above: var str = 'abcdef'; var consonantsonlystr = [for (c of str) if (!(/[aeiouaeiou]/).test(c)) c].join(''); // 'bcdf' var interpolatedzeros = [for (c of str) c + '0' ].join(''); // 'a0b0c0d0e0f0' again, the input form is not preserved, so we have to use join() to revert back to a string.
@set - Archive of obsolete content
strings are not.
New in JavaScript 1.5 - Archive of obsolete content
both assert a match depending on what follows the string being matched.
New in JavaScript 1.8.1 - Archive of obsolete content
new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array initializers no longer execute setters in javascript.
New in JavaScript - Archive of obsolete content
includes ecmascript for xml (e4x), new array methods plus string and array generics.
Object.observe() - Archive of obsolete content
type: a string indicating the type of change taking place.
Object.prototype.watch() - Archive of obsolete content
class person { constructor(name, age) { this.watch('age', this._isvalidassignment.bind(this)); this.watch('name', this._isvalidassignment.bind(this)); this.name = name; this.age = age; } tostring() { return this.name + ', ' + this.age; } _isvalidassignment(id, oldval, newval) { if (id === 'name' && (!newval || newval.length > 30)) { throw new rangeerror('invalid name for ' + this); } if (id === 'age' && (newval < 0 || newval > 200)) { throw new rangeerror('invalid age for ' + this); } return newval; } } const will = new person('will', 29); cons...
for each...in - Archive of obsolete content
string's indexof method.
JavaClass - Archive of obsolete content
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 ...
Server-Side JavaScript - Archive of obsolete content
sounds obvious, but for at least the first twelve years of the web's evolution, developers have pretty much had to use different languages on the server from those available in the browser, leading to segregated teams, disparate and inconsistent know-how, and plenty of server-side string manipulation gymnastics to generate html or ajax pages.
Sharp variables in JavaScript - Archive of obsolete content
you cannot assign primitives (including strings) to sharp variables.
Reference - Archive of obsolete content
a subset of the "object > (function, everything else)" chain could be object > function > (object, function, array, string, boolean, number, date, regexp, error).
XForms Input Element - Archive of obsolete content
representations the xforms input element can be represented by the following widgets for the spcified data types (or types derived from these data types): text field - the default widget when no type is specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data.
XForms Textarea Element - Archive of obsolete content
type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it.
Describing microformats in JavaScript - Archive of obsolete content
classname a string specifying the name of the microformat's class as referenced in html (class="classname").
Mozilla's DOCTYPE sniffing - Archive of obsolete content
(this is technically incorrect, since the strings are case sensitive.) see also web development mozilla's quirks mode mozilla quirks mode behavior original document information author(s): david baron last updated date: august 2, 2005 copyright information: copyright (c) david baron ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
,0,0,0" width="366" height="142" id="myflash"> <param name="movie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> </object> in the above example, the classid attribute that goes along with the object element points to a "clsid:" urn followed by the unique identifier of an activex control (in the above example, the string beginning with "d27...").
XUL Parser in Python - Archive of obsolete content
the parser provides the tag name itself as a string and the attributes and their values in a dictionary, "a".
Using the DOM File API in chrome code - Extensions
in bootstrap scope, this must be imported in like so: cu.importglobalproperties( [ "file" ] ) accessing a file by hard-coded pathname to reference a file by its path, you can simply use a string literal: var file = file.createfromfilename("path/to/some/file"); cross platform note: however using hard-coded paths raises cross platform issues since it uses a platform-dependent path separator (here "/").
asm.js - Game development
it does not allow objects, strings, closures, and basically anything that requires heap allocation.
Visual JS GE - Game development
ml_sys.exe — multilanguage tool for string labels (smart xml operation; no empty tags).
Gecko FAQ - Gecko Redirect 1
xml 1.0: full support, except for processing to manipulate default attributes rdf: full support, except for abouteach, abouteachprefix, and parsetype javascript 1.5, including ecma-262 edition 3 (ecmascript) compliance, except for date.todatestring and date.totimestring, which are not implemented transfer protocols: http 1.1 (including gzip compression), ftp ssl unicode oji (open java interface) image formats png gif jpeg, pjpeg does "full support" mean that gecko has zero bugs today or will have zero bugs at some point in the future?
Attribute - MDN Web Docs Glossary: Definitions of Web-related terms
that is a shorthand for providing the empty string in html, or the attribute’s name in xml.
DOM (Document Object Model) - MDN Web Docs Glossary: Definitions of Web-related terms
an element, text string, or comment).
Deserialization - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, for example, you can deserialize a json string to an object by calling the function json.parse().
Entity - MDN Web Docs Glossary: Definitions of Web-related terms
an html entity is a piece of text ("string") that begins with an ampersand (&) and ends with a semicolon (;) .
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
"" empty string value null null - the absence of any value undefined undefined - the primitive value nan nan - not a number objects are falsy if and only if they have the [[ishtmldda]] internal slot.
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
in html, <a> elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page).
Intrinsic Size - MDN Web Docs Glossary: Definitions of Web-related terms
for a box containing a string of text, the min-content size would be defined by the longest word.
MIME type - MDN Web Docs Glossary: Definitions of Web-related terms
a mime type (now properly called "media type", but also sometimes "content type") is a string sent along with a file indicating the type of the file (describing the content format, for example, a sound file might be labeled audio/ogg, or an image file image/png).
Operator - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascript the addition operator ("+") adds numbers together and concatenates strings, whereas the "not" operator ("!") negates an expression — for example making a true statement return false.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
in programming, semantics refers to the meaning of a piece of code — for example "what effect does running that line of javascript have?", or "what purpose or role does that html element have" (rather than "what does it look like?".) semantics in javascript in javascript, consider a function that takes a string parameter, and returns an <li> element with that string as its textcontent.
Serialization - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, for example, you can serialize an object to a json string by calling the function json.stringify().
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
protection against session hijacking create a secure communication channel with ssh (secure shell) pass authentication cookies over https connection implement logout functionality so the user can end the session generate the session id after successful login pass encrypted data between the users and the web server use a string or long random number as a session key learn more general knowledge session hijacking on wikipedia ...
Type conversion - MDN Web Docs Glossary: Definitions of Web-related terms
for example, given the instruction 5+2.0, the floating point 2.0 is implicitly typecasted into an integer, but given the instruction number("0x11"), the string "0x11" is explicitly typecasted as the number 17.
URI - MDN Web Docs Glossary: Definitions of Web-related terms
a uri (uniform resource identifier) is a string that refers to a resource.
URL - MDN Web Docs Glossary: Definitions of Web-related terms
uniform resource locator (url) is a text string that specifies where a resource (such as a web page, image, or video) can be found on the internet.
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
ribute('accept'); // header "accept: "+x var acceptlanguage = xinclude.getattribute('accept-language'); // "accept-language: "+x var xifallback = xinclude.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'fallback')[0]; // only one such child is allowed if (href === '' || href === null) { // points to same document if empty (null is equivalent to empty string) href = null; // set for uniformity in testing below if (parse === 'xml' && xpointer === null) { alert('there must be an xpointer attribute present if "href" is empty an parse is "xml"'); return false; } } else if (href.match(/#$/, '') || href.match(/^#/, '')) { alert('f...
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).
MDN Web Docs Glossary: Definitions of Web-related terms
f 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 texel thread three js time to fir...
Organizing your CSS - Learn web development
if you use a string which won't appear in the code you can jump from section to section by searching for it — below we have used ||.
How CSS is structured - Learn web development
keep property names and property values together as single unbroken strings.
create fancy boxes - Learn web development
*/ .fancy::before, .fancy::after { /* this is required to be allowed to display the pseudo-elements, event if the value is an empty string */ content: ''; /* we positionnate our pseudo-elements on the left and right sides of the box, but always at the bottom */ position: absolute; bottom : 0; /* this makes sure our pseudo-elements will be below the box content whatever happens.
Sending form data - Learn web development
on the server side: retrieving the data whichever http method you choose, the server receives a string that will be parsed in order to get the data as a list of key/value pairs.
How the Web works - Learn web development
dns explained real web addresses aren't the nice, memorable strings you type into your address bar to find your favorite websites.
Creating hyperlinks - Learn web development
a url, or uniform resource locator is simply a string of text that defines where something is located on the web.
Debugging HTML - Learn web development
here, the error message is relatively easy to understand — "unterminated double quote string".
Adding vector graphics to the Web - Learn web development
abbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.o...
From object to iframe — other embedding technologies - Learn web development
bbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the user updates the text area code textarea.on...
Image gallery - Learn web development
in each loop iteration, replace the xxx placeholder value with a string that will equal the path to the image in each case.
Test your skills: Events - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Test your skills: Functions - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Test your skills: Loops - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Test your skills: Math - Learn web development
check the data type of finalresult using typeof; you'll probably see that it is actually of string type!
Multimedia: video - Learn web development
this is the ffmpeg command string to remove audio: ffmpeg -i original.mp4 -an -c:v copy audiofreeversion.mp4 video preload the preload attribute has three available options: auto|metadata|none.
Client-Server Overview - Learn web development
the end of the first line also includes a short string identifying the specific protocol version (http/1.1).
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.
Introduction to client-side frameworks - Learn web development
template literal strings make it easy to write strings of html that represent what the final element would look like.
Framework main features - Learn web development
javascript lets us use the + operator to concatenate strings together, so this function would technically still work if a and b were strings — it just might not give you the result you'd expect.
Beginning our React todo list - Learn web development
if you write defaultchecked="true", the value of defaultchecked will be "true" — a string literal.
Using Vue computed properties - Learn web development
the list summary method will get the number of finished todoitems, and return a string reporting this.
Vue conditional rendering: editing existing todos - Learn web development
up"> <button type="button" class="btn" @click="oncancel"> cancel <span class="visually-hidden">editing {{label}}</span> </button> <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> ...
Focus management with Vue refs - Learn web development
to use a ref in a component, you add a ref attribute to the element that you want to access, with a string identifier for the value of the attribute.
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.
Deploying our app - Learn web development
in our build script, npm run test is called, then you see the string && — this means "if the thing on the left succeeded (exited with zero), then do this thing on the right".
Client-side tooling overview - Learn web development
often linters can be configured to not only report errors, but also report any violations of a specified style guide that you team might be using (for example code that is using the wrong number of spaces for indentation, or using template literals rather than regular string literals).
Chrome Worker Modules
in particular, globals (string, math, object, self) and the worker global scope itself (this) are shared between workers.
Accessibility Features in Firefox
both history and bookmarks can be searched with a "quick search" field that quickly narrows the list down via a substring search.
CSUN Firefox Materials
both history and bookmarks can be searched with a "quick search" field that quickly narrows the list down via a substring search.
Multiprocess on Windows
com metadata midl outputs two different types of metadata: "fast format strings" (also known as oicf) and (optionally, if a library statement is included in the idl) type libraries (also known as typelib).
Accessible Toolkit Checklist
typing letter or several letters to navigate (same letter goes to each item starting with that, different letters go to first item starting with that entire string).
Adding a new CSS property
while we implement the string api in terms of the value api, we generally don't care much about the deprecated primitive value api, so in cases where there's some new structure, you should generally create the simplest structure of primitive values that will produce the right string.
A bird's-eye view of the Mozilla framework
xpcom components also link with a set of xpcom utilities, such as strings, smart pointers, basic assertion and condition checking.
Creating a Language Pack
l10n binary repack for apps currently in development, you need to get the right strings for the build you use.
Creating a Login Manager storage module
getservice(ci.nsiconsoleservice); return this.__logservice; }, log: function (message) { dump("sampleloginmanager: " + message + "\n"); this._logservice.logstringmessage("sampleloginmanager: " + message); }, // logs function name and arguments for debugging stub: function(arguments) { var args = []; for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) this.log("called " + arguments.callee.name + "(" + args.join(",") + ")"); }, init: function slms_init() { this.stub(arguments); }, initwithfile: function slm...
How Mozilla's build system works
all variables are strings.
Creating Custom Events That Can Pass Data
docevent->createevent(ns_literal_string("nsdommyevent"), getter_addrefs(event)); //create the event event->initevent(ns_literal_string("nsdommyevent"), pr_true, pr_true); //initialize it twindow = do_queryinterface(awindow); //use the window for a target.
Eclipse CDT Manual Setup
this particular regular expression will exclude all directories beginning with the string "obj" except "obj-debug", so if "obj-debug" is not the name of your main object directory, then adjust the regular expression as necessary.
Gecko Logging
raw print exactly what has been specified in the format string, without the process/thread/timestamp, etc.
Experimental features in Firefox
nightly 33 no developer edition 33 no beta 33 no release 33 no preference name media.track.enabled dom document property: autoplaypolicy the document property autoplaypolicy returns a string indicating how the browser handles requests to automatically play media (either using the autoplay property on a media element or by attempting to trigger playback from javascript code.
Limitations of frame scripts
examples of apis add-on authors should avoid in frame scripts: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely to not work in the content process.
Limitations of frame scripts
for example: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) file: uris, see bug 1187099 <...> xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely not to work in the content process.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
var searchactive = false; prev.disabled = true; next.disabled = true; next, we add an event listener to the searchform so that when it is submitted, the htmliframeelement.findall() method is used to do a search for the string entered into the search input element (searchbar) within the text of the current page (the second parameter can be changed to 'case-insensitive' if you want a case-insensitive search.) we then enable the previous and next buttons, set searchactive to true, and blur() the search bar to make the keyboard disappear and stop taking up our screen once the search is submitted.
HTMLIFrameElement.findNext()
parameters direction a string indicating the direction in which you want to cycle through the available search results.
mozbrowseractivitydone
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserasyncscroll
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowseraudioplaybackchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserclose
type read only domstring the type of event.
mozbrowserdocumentfirstpaint
type read only domstring the type of event.
mozbrowserfirstpaint
type read only domstring the type of event.
mozbrowserloadstart
type read only domstring the type of event.
mozbrowsermanifestchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserresize
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserscroll
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserscrollareachanged
this can occur on resize and when the page size changes (while loading for example.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserselectionstatechanged
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowservisibilitychange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
HTMLIFrameElement.sendMouseEvent()
parameters type a string representing the event type.
HTMLIFrameElement.sendTouchEvent()
parameters type a string representing the event type.
Browser API
htmliframeelement.findall() searches for a string in a browser <iframe>'s content; if found, the first instance of the string relative to the caret position will be highlighted.
CSS -moz-bool-pref() @supports function
syntax -moz-bool-pref( <string> ) parameters <string> the preference name returns evaluates to true if the preference is enabled, false otherwise.
MozScrolledAreaChanged
typeread only domstring the type of event.
smartcard-insert
typeread only domstring the type of event.
smartcard-remove
typeread only domstring the type of event.
Roll your own browser: An embedding how-to
other initialization must be done to start up event queues and load some string bundles.
How to add a build-time test
(example to run the testcookie program) in the test program: if the test fails, exit with a non-zero status and/or print the string "fail" to stdout if the test passes, exit with a zero status and don't print the string "fail" (bonus points for printing "pass" :) ) write the test so that you expect it to pass on all platforms, since if the test fails, the tree will go orange (once we've set this up - see bug 352240 for status).
How to get a stacktrace with WinDbg
see also symbol server maps addresses to human readable strings.
Implementing Download Resuming
(it is possible to pass an empty string as the id; however, this means that you have no assurance that the file remained unchanged) now, you can open the channel as usual (using nsichannel.asyncopen() in the common case) and write to the file in the ondataavailable notifications.
Assert.jsm
json.stringify is not designed to be used for this purpose; objects may have ambiguous tojson() implementations that would influence the test.
FxAccountsOAuthClient.jsm
fxaccountsoauthclient fxaccountsoauthclient( object options object parameters string client_id string state string oauth_uri string content_uri [optional] string scope [optional] string action [optional] string authorizationendpoint ); parameters client_id - oauth id returned from client registration.
Log.jsm
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); ...
Examples
(files[i]) promise = promise.then(function onsuccess(array) { return decoder.decode(array); }); promises.push(promise); } return promise.all(promises); } let folder = "/path/to/folder"; let promise = readtextfiles([ os.path.join(folder, "read.me"), os.path.join(folder, "home.html") ]); promise.then( function onsuccess(filescontent) { // filescontent is an array of strings; each string is the content of one file.
Promise
for example, the os.file.exists function returns a promise that will eventually fulfill with a boolean: promise<boolean> exists(string path); the rejection reason may be specified separately in the function's documentation, and is considered to be an error object unless otherwise specified.
PromiseWorker.jsm
return new promiseworker.meta(abuf, {transfers: [abuf]}); if you want to return an object or an array and transfer only certain parts of this data, it would all have to be return wrapped in this meta object like so: return new promiseworker.meta({ thebuf: abuf, othernontrans: 'this string is not transfered but copied' }, {transfers: [abuf]}); a simple demo showing this in live action can be found here: github :: promiseworker transfer arraybuffer - worker side rejecting the promise to reject the promise from the worker, simply throw.
Services.jsm
vice prompt service scriptloader mozijssubscriptloader javascript subscript loader service scriptsecuritymanager nsiscriptsecuritymanager script security manager search nsibrowsersearchservice browser search service startup nsiappstartup application startup service storage mozistorageservice storage api service strings nsistringbundleservice string bundle service sysinfo nsipropertybag2 system info service telemetry nsitelemetry telemetry service tm nsithreadmanager thread manager service urifixup nsiurifixup uri fixup service urlformatter nsiurlformatter url formatter service vc nsiversioncomparator version compara...
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.
JavaScript code modules
iso8601dateutils.jsm provides routines to convert between javascript date objects and iso 8601 date strings.
Mozilla Content Localized in Your Language
ellipsis ellipsis are often inserted automatically in the ui where strings are truncated.
Localization notes
localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too.
Localization prerequisites
don’t bother the version string here, as long as you’re 3.79.1 or better.
SVN for Localizers
when localizing websites, l10n-drivers will always add needed files to your repository or update your files with new strings in english.
Mozilla Web Developer FAQ
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.
Mozilla Development Strategies
find and fix string usage problems.
Mozilla Quirks Mode Behavior
(bug 915053) an empty string for the background attribute sets the background url to empty only in quirks mode.
Mozilla Style System Documentation
i'm reluctant to write it both since i don't know much about it.] problems:a bunch the code needs to be rewritten to prevent stylesheets from blocking the parser and to reduce string copying (although that partly goes with parsing).] parsing stylesheet representation problems: the stylesheet representation uses way too much memory.
Leak-hunting strategies and tips
leaking many copies of a string could be a very large leak, but the object graphs are small and easy to identify using gc-based leak detection.) what leak tools do we have?
TraceMalloc
tracemalloclogtimestamp(caption) - log a timestamp event to the current log file, annotating the log even with the caption string.
about:memory
single memory report files can also be loaded automatically when about:memory is loaded by appending a file query string, for example: about:memory?file=/home/username/reports.json.gz this is most useful when loading memory reports files obtained from a firefox os device.
browser.dom.window.dump.file
type:string default value:none exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-03-18 introduction: pushed to nightly on 2009-04-24 bugs: bug 489938 values the value holds the file system path for the file in which the content of the window.dump() calls get written, e.g.
ui.SpellCheckerUnderline
type:string default value:#ff0000 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values a color code like #ff0000 for red.
ui.textSelectBackground
type:string with rgb hex value as color code default value:#ef0fff (blue) [1] exists by default: no application support: before gecko 1.7 status: active; last updated 2015-09-21 introduction: pushed to trunk on 2000-04-13 bugs: bug 34704 [1]: nsxplookandfeel.cpp, line 628, retrieved 2015-09-21 ...
ui.textSelectForeground
type:string with rgb hex value as color code default value:#ffffff (white) [1] exists by default: no application support: before gecko 1.7 status: active; last updated 2015-09-21 introduction: pushed to trunk on 2000-04-13 bugs: bug 34704 [1]: nsxplookandfeel.cpp, line 635, retrieved 2015-09-21 ...
Preferences system
usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string.
Research and prep
it is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation.
L20n
what l20n looks like here is a simple, straightforward example showing an english string being provided: <brandname "firefox"> <about "about {{ brandname }}"> here is the same string being provided in slovenian: <brandname { nominative: "firefox", genitive: "firefoxa", dative: "firefoxu", accusative: "firefox", locative: "firefoxu", instrumental: "firefoxom" }> <about "o {{ brandname.locative }}"> for developers documentation for developers wanting to implement...
AsyncTestUtils extended framework
the second argument defines the search query; each attribute defines a "contains" string constraint.
About NSPR
to that end it is possible to perform translations of ascii strings (dns names) into nspr's network address structures, with no regard to whether the addressing technology is ipv4 or ipv6.
Hash Tables
hash table types and constants hash table functions hash table types and constants plhashentry plhashtable plhashnumber plhashfunction plhashcomparator plhashenumerator plhashallocops hash table functions pl_newhashtable pl_hashtabledestroy pl_hashtableadd pl_hashtableremove pl_hashtablelookup pl_hashtableenumerateentries pl_hashstring pl_comparestrings pl_comparevalues see also xpcom hashtable guide ...
I/O Functions
nspr uses unix-style pathnames, which are null-terminated character strings.
Introduction to NSPR
each thread has a built-in per-thread error number and error string that are updated when nspr operations fail.
Logging
nspr provides a set of logging functions that conditionally write printf() style strings to the console or to a log file.
NSPR LOG FILE
this value causes logging output to be written using the windows function outputdebugstring(), which writes to the debugger window.
Network Addresses
pr_initializenetaddr converting between a string and a network address pr_stringtonetaddr pr_netaddrtostring converting address formats pr_convertipv4addrtoipv6 getting host names and addresses pr_gethostbyname pr_gethostbyaddr pr_enumeratehostent pr_getaddrinfobyname pr_enumerateaddrinfo pr_getcanonnamefromaddrinfo pr_freeaddrinfo getting protocol entries pr_getprotobyname pr_getprotobynumber ...
PLHashFunction
see also pl_hashstring ...
PL_strfree
syntax void pl_strfree(char *s); parameter the function has these parameter: s pointer to the string to be freed.
PRUnichar
an unsigned 16-bit type, like char in java or the "characters" of a javascript string defined in /mozilla/xpcom/base/nscore.h.
PR_ASSERT
the macro converts the expression to a string and passes it to pr_assert, using file and line parameters from the compile-time environment.
PR_Assert
syntax #include <prlog.h> void pr_assert ( const char *s, const char *file, printn ln); parameters the function has these parameters: s a string to be displayed in the log.
PR GetAddrInfoByName
syntax #include <prnetdb.h> praddrinfo *pr getaddrinfobyname( const char *hostname, pruint16 af, printn flags); parameters the function has the following parameters: hostname the character string defining the host name of interest.
PR_GetHostByName
syntax #include <prnetdb.h> prstatus pr_gethostbyname( const char *hostname, char *buf, printn bufsize, prhostent *hostentry); parameters the function has the following parameters: hostname the character string defining the host name of interest.
PR_GetLibraryPath
returns a copy of the default library pathname string.
PR_GetProtoByName
syntax #include <prnetdb.h> prstatus pr_getprotobyname( const char* protocolname, char* buffer, print32 bufsize, prprotoent* result); parameters the function has the following parameters: protocolname a pointer to the character string of the protocol's name.
PR_Initialize
argv the base address of an array of strings that compromise the program's argument vector.
PR_LOG
for a description of formatting and format strings, see "formatted printing".
PR_SetLibraryPath
this may indicate that the function cannot allocate sufficient storage to make a copy of the path string description this function registers a default library pathname with the runtime.
PR_VERSION
syntax #include <prinit.h> #define pr_version "2.1 yyyymmdd" description the format of the version string ismajorversion.minorversion builddate.
PR_VersionCheck
this is a string comparison of sorts, though the details of the comparison will vary over time.
NSPR API Reference
ddresses network address types and constants network address functions atomic operations pr_atomicincrement pr_atomicdecrement pr_atomicset interval timing interval time type and constants interval functions date and time types and constants time parameter callback functions functions memory management operations memory allocation functions memory allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link ...
HTTP delegation
(when issueing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g.
HTTP delegation
(when issuing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g.
4.3.1 Release Notes
to obtain the version info from the jar file use, "system.out.println(org.mozilla.jss.cryptomanager.jar_jss_version)" and to check the shared library: strings libjss4.so | grep -i header feedback bugs discovered should be reported by filing a bug report with bugzilla.
Using JSS
MozillaProjectsNSSJSSUsing JSS
(the path to jss34.jar ends with the string "/jss42.jar".
NSS_3.12.1_release_notes.html
returns a string that must be freed with port_free().
NSS_3.12.2_release_notes.html
bug 456854: cert_decodecertpackage does not set nspr error code upon error bug 457980: hundreds of kilobytes of useless strings in libpkix bug 457984: enable pkcs11 module logging in optimized builds bug 458905: memory leaks in pkix bridge certificates.
NSS 3.12.6 release notes
bug 527759: add multiple roots to nss (single patch) bug 528741: pkix_hash throws a null-argument exception on empty strings bug 530907: the peerid argument to ssl_setsockpeerid should be declared const bug 531188: decompression failure with https://livechat.merlin.pl/ bug 532417: build problem with spaces in path names bug 534943: clean up the makefiles in lib/ckfw/builtins bug 534945: lib/dev does not need to include headers from lib/ckfw bug 535669: move common ...
NSS 3.16.3 release notes
new functions in cert.h ​cert_getgeneralnametypefromstring - an utlity function to lookup a value of type certgeneralnametype given a human readable string.
NSS 3.24 release notes
this mode is triggered by setting the database password to the empty string.
NSS 3.31 release notes
pk11uri_formaturi - format a pk11uri object to a string.
NSS 3.45 release notes
vendor specific mechanism bug 1558126 - tls_aes_256_gcm_sha384 should be marked as fips compatible bug 1555207 - helloretryrequestcallback return code for rejecting 0-rtt bug 1556591 - eliminate races in uses of pk11_setwrapkey bug 1558681 - stop using a global for anti-replay of tls 1.3 early data bug 1561510 - fix a bug where removing -arch xxx args from cc didn't work bug 1561523 - add a string for the new-ish error ssl_error_missing_post_handshake_auth_extension this bugzilla query returns all the bugs fixed in nss 3.45: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.45 compatibility nss 3.45 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.46 release notes
16593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for delegated credentials bug 1493916 - fix ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bug 1512605 - incorrect alert description after unencrypted finished msg bug 1564715 - read /proc/cpuinfo when at_hwcap2 returns ...
NSS 3.51 release notes
bug 1538980 - secu_readderfromfile calls strstr on a string that isn't guaranteed to be null-terminated bug 1561337 - correct a warning for comparison of integers of different signs: 'int' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fips_enabled flag on the machine unless nss was built with fips enabled bug 1431940 - fix a null pointer dereference ...
NSS Developer Tutorial
escape non-printing characters (with \x if there is no special escape such as \r, \n, and \t) and avoid defining string literals that use non-ascii characters.
NSS Sample Code Sample_1_Hashing
* it writes out the digest as a hexadecimal string.
NSS Sample Code Sample_2_Initialization of NSS
try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(output); return p0; } /* change the password */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, char *oldpwfile, char *newpwfile) { secstatus rv; secupwdata pwdata; secupwdata newpwdata; char *oldpw = null; char ...
Hashing - sample 1
* it writes out the digest as a hexadecimal string.
Initialize NSS database - sample 2
try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(output); return p0; } /* * changepw */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, char *oldpwfile, char *newpwfile) { secstatus rv; secupwdata pwdata; secupwdata newpwdata; char *oldpw = null; char *newpw = null...
sample1
* it writes out the digest as a hexadecimal string.
nss tech note7
answer: the version without the initial 00 says : "ps is a string of strong pseudo-random octets [random] [...] long enough that the value of the quantity being crypted is one octet shorter than the rsa modulus" the version with the initial 00 instead says to pad to the same length as the rsa modulus.
NSS Tools sslstrength
the argument to the ciphers command is a string of characters, where each single character represents a cipher.
FC_GetInfo
examples note the use of the %.32s format string to print the manufacturerid and librarydescription members of the ck_info structure.
FC_InitPIN
in the nss cryptographic module, one uses the empty string password ("") to log in as the pkcs #11 so.
FC_InitToken
note: the so password should be the empty string, i.e., ulpinlen argument should be 0.
FC_Login
the so pin is the empty string.
NSC_InitToken
(user certs are the certificates that have their associated private keys in the key database.) note: the so password should be the empty string, i.e., ulpinlen argument should be 0.
NSC_Login
the so pin is the empty string.
NSS tools : cmsutil
to see a usage string, issue the command without options.
NSS tools : ssltab
if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool.
NSS tools : ssltap
if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool.
ssltyp.html
syntax #include <seccomon.h> #include <prtypes.h> #include <secport.h> typedef enum { sibuffer, sicleardatabuffer, sicipherdatabuffer, sidercertbuffer, siencodedcertbuffer, sidernamebuffer, siencodednamebuffer, siasciinamestring, siasciistring, sideroid } secitemtype; typedef struct secitemstr secitem; struct secitemstr { secitemtype type; unsigned char *data; unsigned int len; }; description a secitem structure can be used to associate your own data with an ssl socket.
S/MIME functions
cate mxr 3.2 and later nss_cmssignerinfo_getsigningtime mxr 3.2 and later nss_cmssignerinfo_getverificationstatus mxr 3.2 and later nss_cmssignerinfo_getversion mxr 3.2 and later nss_cmssignerinfo_includecerts mxr 3.2 and later nss_cmsutil_verificationstatustostring mxr 3.2 and later nss_smimesignerinfo_savesmimeprofile mxr 3.4 and later nss_smimeutil_findbulkalgforrecipients mxr 3.2 and later ...
Utility functions
3.2 and later sec_pkcs5getpbealgorithm mxr 3.2 and later sec_pkcs5isalgorithmpbealg mxr 3.2 and later sec_pkcs5isalgorithmpbealgtag mxr 3.12 and later sec_registerdefaulthttpclient mxr 3.11.1 and later sec_signdata mxr 3.2 and later sec_stringtooid mxr 3.12 and later secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr 3.2 and later secitem_dupitem mxr 3.2 and later secitem_freeitem mx...
NSS Tools cmsutil
to see a usage string, issue the command without options.
NSS Tools pk12util
to see a usage string, issue the pkcs12util command without any options.
NSS Tools sslstrength
the argument to the ciphers command is a string of characters, where each single character represents a cipher.
NSS Tools ssltap
the options for the command are the following: -v print a version string for the tool.
NSS tools : cmsutil
MozillaProjectsNSStoolscmsutil
to see a usage string, issue the command without options.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
if a connection is ssl, the data display includes interpreted ssl records and handshaking options -v print a version string for the tool.
Network Security Services
pkcs #11 information documentation on pkcs #11 modules implementing pkcs #11 for nss the strings nss uses to load pkcs #11 modules pkcs #11 faq using the jar installation manager to install a pkcs #11 cryptographic module pkcs #11 conformance testing - archived version ca certificates pre-loaded into nss mozilla ca certificate policy list of pre-loaded ca certificates consumers of this list must consider the trust bit setting...
Proxies in Necko
if pac (proxy autoconfiguration) is enabled, it is asked for the proxy string for the given uri, which determines whether to use a proxy.
Pork Tool Development
source locations ast nodes have a location associated with them; sourceloc is defined to be an integer corresponding to an string offset.
Rhino FAQ
for instance, to create an array of java.lang.string of length five, do var stringarray = java.lang.reflect.array.newinstance(java.lang.string, 5); then if you wish to assign the string "hi" to the first element, simply execute stringarray[0] = "hi".
Rhino history
also, the implementation effectively leaked memory since most jvms don't really collect unused classes or the strings that are interned as a result of loading a class file.
New in Rhino 1.7R4
update license to mpl 2.0 make string concatenation with + fast java class generation updates and fixes faster number to string conversion several regexp fixes regexp performance improvements es5 compliance fixes improved interpreter performance improved commonjs module implementation javascript 1.8 generator expressions many parser and ast fixes use javascript 1.7 as default version in rhino shell javaadapter improvements fixes in js to java access include mozilla test suite a list of bugs that were fixed since the previous release.
Performance Hints
for example, the code function myobject(a) { this.s = a; this.tostring = new function("return this.s"); } could be written more efficiently as function myobject(a) { this.s = a; this.tostring = function () { return this.s } } beginning with rhino 1.4 release 2, code passed to eval and new function will be interpreted rather than compiled to class files.
FOSS
bundled modules include support for bytearray, bytestring, cgi, posix signals, ffi, and more.
Functions
(nameexpressions are basic expressions like string and x that would eat up a huge amount of run time if the engine weren't smart enough to avoid symbol table lookups.) general closures are the base case.
Property cache
nor do operations such as add that only need to look up a property (.tostring) in unusual cases.
JIT Optimization Outcomes
accessnottypedarray accessnotstring statictypedarrayuint32 statictypedarraycantcomputemask outofbounds getelemstringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled.
JIT Optimization Strategies
getelem_string attempts to optimize element accesses on a string.
JS::GetFirstArgumentAsTypeHint
if args.get(0) is one of the strings "string", "number", or "default", set *result to jstype_string, jstype_number, or jstype_void accordingly and return true.
JS::Handle
there are typedefs available for the main types: namespace js { typedef handle<jsfunction*> handlefunction; typedef handle<jsid> handleid; typedef handle<jsobject*> handleobject; typedef handle<jsscript*> handlescript; typedef handle<jsstring*> handlestring; typedef handle<js::symbol*> handlesymbol; // added in spidermonkey 38 typedef handle<value> handlevalue; } see also mxr id search for js::handle mxr id search for js::handlefunction mxr id search for js::handleid mxr id search for js::handleobject mxr id search for js::handlescript mxr id search for js::handlestring mxr id search for js::handlesymbol mxr id sea...
JS::MutableHandle
there are typedefs available for the main types: namespace js { typedef mutablehandle<jsfunction*> mutablehandlefunction; typedef mutablehandle<jsid> mutablehandleid; typedef mutablehandle<jsobject*> mutablehandleobject; typedef mutablehandle<jsscript*> mutablehandlescript; typedef mutablehandle<jsstring*> mutablehandlestring; typedef mutablehandle<js::symbol*> mutablehandlesymbol; typedef mutablehandle<value> mutablehandlevalue; } see also mxr id search for js::mutablehandle mxr id search for js::mutablehandlefunction mxr id search for js::mutablehandleid mxr id search for js::mutablehandleobject mxr id search for js::mutablehandlescript mxr id search for js::mutablehandlestrin...
JS::PropertySpecNameToPermanentId
the resulting jsid, on success, is either an interned string or a well-known symbol; either way it is immune to gc so there is no need to visit *idp during gc marking..
JS::Rooted
there are typedefs available for the main types: namespace js { typedef rooted<jsobject*> rootedobject; typedef rooted<jsfunction*> rootedfunction; typedef rooted<jsscript*> rootedscript; typedef rooted<jsstring*> rootedstring; typedef rooted<js::symbol*> rootedsymbol; // added in spidermonkey 38 typedef rooted<jsid> rootedid; typedef rooted<js::value> rootedvalue; } see also mxr id search for js::rooted mxr id search for js::rootedobject mxr id search for js::rootedfunction mxr id search for js::rootedscript mxr id search for js::rootedstring mxr id search for js::ro...
JS::ToPrimitive
hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint.
JSCheckAccessOp
as for jspropertyop, id is either a string or an int jsval.
JSClass
it implements the object's [[defaultvalue]] hook, which is invoked by javascript when the object must be converted to a string, number, or primitive value.
JSDeletePropertyOp
this is either a string (unicode property identifier) or an integer (element index).
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.
JSPropertyDescriptor
value describes the value of the specified property, which can be any valid javascript value (function, object, string...) configurable declare that the property can be modified and deleted enumerable declare that the property can be enumerated, and the enumerable genus can be traversed by the for...in loop.
JSPropertyOp
this is either a string (unicode property identifier) or an integer (element index).
JSProtoKey
oto_array array mxr search for jsproto_array jsproto_boolean boolean mxr search for jsproto_boolean jsproto_json json mxr search for jsproto_json jsproto_date date mxr search for jsproto_date jsproto_math math mxr search for jsproto_math jsproto_number number mxr search for jsproto_number jsproto_string string mxr search for jsproto_string jsproto_regexp regexp mxr search for jsproto_regexp jsproto_error error mxr search for jsproto_error jsproto_internalerror internalerror mxr search for jsproto_internalerror jsproto_evalerror evalerror mxr search for jsproto_evalerror jsproto_rangeerror rangeerror mxr ...
JSSecurityCallbacks.contentSecurityPolicyAllows
jssecuritycallbacks.contentsecuritypolicyallows is invoked once per global object upon the first attempt to evaluate js code from a string (either through eval or the function constructor).
JSType
jstype_string strings.
JSVAL_IS_GCTHING
javascript performs automatic garbage collection of objects, strings, and doubles.
JSVAL_IS_OBJECT
if v is a string, number, boolean, or undefined, the result is false.
JSVAL_IS_PRIMITIVE
syntax jsval_is_primitive(v) description jsval_is_primitive(v) is true if v is undefined, null, a boolean, a number, or a string.
JSVAL_TO_DOUBLE
this function is not type-safe: if v is an integer, string, null, or anything else, the behavior is undefined.
JSVAL_TO_GCTHING
when possible, it is better to use a more specific macro, such as jsval_to_object or jsval_to_string.
JS_AliasElement
this name corresponds to a string representation of the element's current index number.
JS_BufferIsCompilableUnit
utf8 const char * string containing the script to compile.
JS_ClearNewbornRoots
description the last gc thing of each type (object, string, double, external string types) created on a given context is kept alive until another thing of the same type is created, using a newborn root in the context.
JS_ClearRegExpStatics
description js_clearregexpstatics clears the pending input string and flags of the built-in regexp object.
JS_DecompileScriptObject
syntax jsstring * js_decompilescriptobject(jscontext *cx, jsobject *scriptobj, const char *name, unsigned int indent); name type description cx jscontext * the context.
JS_DefaultValue
hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint.
JS_DumpHeap
jstrace_object = 0x00, jstrace_string = 0x01, jstrace_symbol = 0x02, jstrace_script = 0x03, // shape details are exposed through js_traceshapecyclecollectorchildren.
JS_DumpNamedRoots
it points to a variable, array element, or field of type jsval, jsobject *, jsstring *, or jsdouble *.
JS_Enumerate
(the term own property refers to a property that is not inherited from the object's prototype.) this is not quite the same behavior as a javascript for...in loop, which converts all property ids to strings and also enumerates inherited properties.
JS_GC
obsolete since jsapi 50 description js_gc performs garbage collection of js objects, strings and other internal data structures that are no longer reachable in the specified context or runtime.
JS_GetFunctionName
the return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created.
JS_GetImplementationVersion
syntax const char * js_getimplementationversion(void); description js_getimplementationversion returns a hard-coded, english language string that specifies the version number of the js engine currently in use, and its release date.
JS_GetVersion
see also mxr id search for js_getversion js_versiontostring js_stringtoversion js_setversionforcompartment ...
JS_InitStandardClasses
these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array, boolean, date, decodeuri, decodeuricomponent, encodeuri, encodeuricomponent, error, eval, evalerror, function, infinity, isnan, isfinite, math, nan, number, object, parseint, parsefloat, rangeerror, referenceerror, regexp, string, syntaxerror, typeerror, undefined, and urierror as well as a few spidermonkey-specific globals, depending on compile-time options: escape, unescape, uneval, internalerror, script, xml, namespace, qname, file, generator, iterator, and stopiteration, as of spidermonkey 1.7.
JS_LockGCThing
thing is a pointer to a jsdouble, jsstring, or jsobject.
JS_LooselyEqual
comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number.
JS_NewContext
javascript objects, functions, strings, and numbers may be shared among the contexts in a jsruntime, but they cannot be shared across jsruntimes.
JS_NewRegExpObject
bytes or chars const char * or const char16_t * a pointer to the string that contains a regular expression.
JS_PropertyStub
it attempts to call the object's valueof and tostring functions, in the order determined by the specified type, in accordance with the default defaultvalue algorithm in es5 §8.12.8.
JS_ReportOutOfMemory
when a script tries to grow an array beyond 230-1 elements, for example, or concatenate strings such that the result is more than 229-1 characters long, the javascript engine reports an error as though by calling this function.
JS_ReportPendingException
description if an exception is pending in the context cx, js_reportpendingexception converts the exception to a string and reports it to the current error reporter.
JS_SetCompartmentNameCallback
jscompartmentnamecallback will be called when visiting the compartment, and it should store the name of the compartment into buf with null terminated string.
JS_SetErrorReporter
example code with error handling omitted: class myrequest { public: void execute() { auto rt = js_newruntime(memlimit); js_setruntimeprivate(rt, this); js_seterrorreporter(rt, &myrequest::dispatcherror); // execute js } void onerror(const std::string& error) { // handle error } static void dispatcherror( jscontext* ctx, const char* message, jserrorreport* report) { auto rt = js_getruntime(ctx); auto rt_userdata = js_getruntimeprivate(rt); if (rt_userdata) { auto req = static_cast<myrequest*>(rt_userdata); req->onerror(message); } } ...
JS_SetOptions
mxr id search for jsoption_dont_report_uncaught jsoption_relimit added in spidermonkey 1.8 throw an exception if a regular expression backtracks more than n3 times, where n is the length of the input string.
JS_SetVersion
see also mxr id search for js_setversion jsversion js_getversion js_versiontostring js_stringtoversion bug 880917 ...
JS_SetVersionForCompartment
see also mxr id search for js_setversionforcompartment jsversion js_getversion js_versiontostring js_stringtoversion bug 880917 ...
JS_StrictlyEqual
comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number.
JS_TracerInit
kind uint32 one of the constants jstrace_object, jstrace_double, jstrace_string; or a tag denoting an internal implementation-specific traversal kind.
JS_ValueToFunction
if v is null, undefined, a boolean, a number, or a string, a typeerror is reported and js_valuetofunction returns null.
JS_ValueToInt32
js::toint32 will also convert nan (and anything that converts to nan, such as an array of strings) to 0, whereas this routine would report an error.
JS_ValueToObject
if v is a boolean value, a number, or a string, the result is a new wrapper object of type boolean, number, or string.
jsid
jsid is either a 31-bit signed integer, interned string or object.
Setting up CDT to work on SpiderMonkey
under the "providers" group tab, select "cdt gcc build output parser" and add the string |(ccache) to the end of the "compiler command pattern" text input.
Web Replay
in general, redirections are needed for any function that is (a) not compiled as part of gecko, and either (b) may behave differently between recording and replaying, or (c) depends on data produced by other redirected functions (for example, corefoundation types like cfarrayref and cfstringref).
Mozinfo
mozinfo also exports: choices: a dictionary of possible values for os, bits, and processor main: the console_script entry point for mozinfo unknown: a singleton denoting a value that cannot be determined unknown has the string representation "unknown".
Setting up an update server
beta builds are those with a b in the version string.
Gecko Roles
role_label presents an icon or short string in an interface.
Using the Places livemark service
you can convert a string into an nsiuri using nsiioservice.
Preferences API
preferences api allows you to save and read strings, numbers, booleans, and references to files to the preferences store.
Avoiding leaks in JavaScript XPCOM components
var private_data = 0; var result = new array(); result[0] = function() { return (private_data += 1); } result[1] = function() { return (private_data *= 2); } return result; } // this function returns the string "results: 1, 2, 4, 0, 5, 1, 10." function test() { var fns1 = function_array(); var fns2 = function_array(); return "results: " + fns1[0]() + ", " + // increments first private_data to 1 fns1[1]() + ", " + // doubles first private_data to 2 fns1[1]() + ", " + // doubles first private_data to 4 fns2[1]() + ", " + // doubles second...
Preface
use c++ macros, special string classes and smart pointers to optimize your code.
Resources
weblock resources weblock installer and information the sdk download linux: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-i686-pc-linux-gnu-1.4a.tar.gz windows: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip other mozilla downloads gecko resources internal string guide external string guide the gecko networking library ("necko") the netscape portable runtime environment embedding mozilla current module owners xpinstall xul xpcom resources the xpcom project page xulplanet's online xpcom reference information on xpconnect and scriptable components the smart pointer guide xpidl xpidl compiler reference general development resources the ...
Using XPCOM Components
the nsiwebbrowserfind interface findnext find the next occurrence of the search string.
mozilla::services namespace
for example, to obtain a reference to the ioservice: nscomptr<nsiioservice> ioservice = mozilla::services::getioservice(); provided service getters service accessor service interface service name getchromeregistryservice nsichromeregistryservice chrome registry service getioservice nsiioservice io service getobserverservice nsiobserverservice observer service getstringbundleservice nsistringbundleservice string bundle service gettoolkitchromeregistryservice nsitoolkitchromeregistry toolkit chrome registry service getxulchromeregistryservice nsixulchromeregistry xul chrome registry service getxuloverlayproviderservice nsixuloverlayprovider xul overlay provider service more services will be added as needed.
How To Pass an XPCOM Object to a New Window
to access the xpcom object from the window's code, you can access the window.arguments[] array, as shown in the example below: components.utils.reporterror(string(window.arguments[0])); this will produce output similar to "[xpconnect wrapped nsimyxpcomobject]".
Interfacing with the XPCOM cycle collector
handling js::value fields recall (or see here) that a js::value may reference a string or object and is subject to gc.
Components.Exception
syntax var exception = [ new ] components.exception([ message [, result [, stack [, data ] ] ] ]); parameters message a string which can be displayed in the error console when your exception is thrown or in other developer-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_error_failure stack an xpcom stack to be set on the exception (defaulting to the current stack chain) data any additional data you might want to store, defaulting to ...
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.utils.evalInSandbox
note: it's not safe to use evalinsandbox() to evaluate json strings; instead, use the techniques discussed in the article on json.
Components.utils.import
syntax components.utils.import(url [, scope]); // or, if you use a tool such as jslint which reports compiler errors for the above, components.utils["import"](url [, scope]); parameters url a string of the url of the script to be loaded.
XPConnect wrappers
if you call 'tostring()' and get "[xpconnect wrapped nsifoo]" then the reference is to a xpcwrappednative object with interface nsifoo.
Language bindings
eobjectin creates a new javascript object in the scope of the specified object's compartment.components.utils.evalinsandboxthe evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.components.utils.evalinwindowthis function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context.
Monitoring HTTP activity
// define a reference to the interfacevar nsihttpactivityobserver = components.interfaces.nsihttpactivityobserver; var httpobserver = { observeactivity: function(ahttpchannel, aactivitytype, aactivitysubtype, atimestamp, aextrasizedata, aextrastringdata) { if (aactivitytype == nsihttpactivityobserver.activity_type_http_transaction) { switch(aactivitysubtype) { case nsihttpactivityobserver.activity_subtype_response_header: // received response header break; case nsihttpactivityobserver.activity_subtype_response_complete: // received complete http response br...
NS_InitXPCOM2
many of the xpcom glue functions and classes are also available prior to xpcom initialization, including for example nsembedcstring and nscomptr.
NS_InitXPCOM3
many of the xpcom glue functions and classes are also available prior to xpcom initialization, including for example nsembedcstring and nscomptr.
Cut
« xpcom api reference summary the cut function removes a section of the string's internal buffer.
Length
« xpcom api reference summary the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
Cut
« xpcom api reference summary the cut function removes a section of the string's internal buffer.
Length
« xpcom api reference summary the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
IAccessibleRelation
[propget] hresult relationtype( [out] bstr relationtype ); parameters relationtype the strings returned are defined @ref grprelations "in this section of the documentation".
imgICache
findentryproperties() find properties used to get properties such as 'type' and 'content-disposition' 'type' is a nsisupportscstring containing the images' mime type such as 'image/png' 'content-disposition' will be a nsisupportscstring containing the header if you call this before any data has been loaded from a uri, it will succeed, but come back empty.
imgIRequest
mimetype string read only.
mozIThirdPartyUtil
if it cannot be determined because one or both uris do not have a base domain (for instance, in the case of ip addresses, host aliases such as 'localhost', or a file:// uri), an exact string comparison on host is performed.
nsIAboutModule
hide_from_aboutabout (1 << 2) a flag that indicates whether this about: uri doesn't want to be listed in about:about, especially if it's not useful without a query string.
nsIAccessibilityService
reatehypertextaccessible(in nsisupports aframe); nsiaccessible createhtmlbraccessible(in nsisupports aframe); nsiaccessible createhtmlbuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlaccessiblebymarkup(in nsiframe aframe, in nsiweakreference aweakshell, in nsidomnode adomnode); nsiaccessible createhtmlliaccessible(in nsisupports aframe, in nsisupports abulletframe, in astring abullettext); nsiaccessible createhtmlcheckboxaccessible(in nsisupports aframe); nsiaccessible createhtmlcomboboxaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlhraccessible(in nsisupports aframe); nsiaccessi...
Description
attribute astring description; ...
GetActionDescription
astring getactiondescription( in pruint8 aindex ); parameters aindex[in] the zero-based index.
GetActionName
astring getactionname( in pruint8 aindex ); parameters aindex[in] the zero-based index.
Help
attribute astring help; ...
Name
attribute astring name; ...
Value
attribute astring value; ...
nsIAccessibleRole
role_label 79 presents an icon or short string in an interface.
nsIAccessibleTextChangeEvent
modifiedtext domstring the inserted or removed text.
nsIAppStartup
;1"] .getservice(components.interfaces.nsiconsoleservice); var startupinfo = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(ci.nsiappstartup_mozilla_2_0).getstartupinfo(); var keys = object.keys(startupinfo); keys.sort(function(a, b) { return startupinfo[a] - startupinfo[b]; }); for each (var name in keys) { aconsoleservice.logstringmessage(name + ": " + startupinfo[name]); } to calculate how long startup took, compute the difference between the event's timestamp and the timestamp of the process event.
nsICachingChannel
offlinecacheclientid acstring the session into which to cache offline data.
nsICommandLineHandler
@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).
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.
nsIConsoleMessage
attributes attribute type description message wstring the message in a string format.
nsICookie2
rawhost autf8string the host (possibly fully qualified) of the cookie, without a leading dot to represent if it is a domain cookie.
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 setcurrentmailcharset( in wstring charset ); ...
nsIDOMGeoPositionError
message domstring human readable error message.
nsIDOMMozNetworkStats
to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype domstring connection type of the stats.
nsIDOMStorageItem
value domstring the value associated with the item.
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 ...
getFiles
nsisimpleenumerator getfiles( in string aname ); parameters aname [in] the symbolic name for an enumeration of file or directory locations.
nsIFeedEntry
published astring a string indicating the date on which the entry was published, in rfc822 format.
nsIGSettingsService
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 ...
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.
nsIMemoryReporterManager
each code area is identified by a unique path string, which is displayed in about:memory.
nsIMicrosummary
: 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.
nsIMsgThread
subject acstring subject of the thread newestmsgdate unsigned long numchildren unsigned long readonly: number of messages in the thread.
nsINavHistoryResult
sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes; you must set this value before setting the sortingmode attribute.
nsIPlacesView
place string theuri (as a string) of the root place that the view displays.
nsIProperty
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description name astring get the name of the property.
nsIRequest
name autf8string the name of the request.
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.
nsISocketTransport
host autf8string get the host for the underlying socket connection.
data
this content is now available at nsisupportscstring.attributes.
data
this content is now available at nsisupportsstring.attributes.
nsIToolkitProfile
name autf8string the profile's name.
nsITransportEventSink
astatus the transport status (resolvable to a string using nsierrorservice).
nsIUUIDGenerator
exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) example generating a uuid var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); var uuid = uuidgenerator.generateuuid(); var uuidstring = uuid.tostring(); ...
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 ...
nsIXFormsModelElement
1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned.
nsIXPCScriptable
apper, in jscontextptr cx, in jsobjectptr obj, in jsval val); jsobjectptr outerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); jsobjectptr innerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreateprototype(in jscontextptr cx, in jsobjectptr proto); attributes attribute type description classname string scriptableflags pruint32 the bitwise or'd set of flags (define below) that indicate the behavior of this object.
nsIZipEntry
name string read only.
nsMsgSearchValue
def struct nsmsgsearchvalue { nsmsgsearchattribvalue attribute; union { nsmsgpriorityvalue priority; prtime date; pruint32 msgstatus; /* see msg_flag in msgcom.h */ pruint32 size; nsmsgkey key; print32 age; /* in days */ nsimsgfolder *folder; nsmsglabelvalue label; pruint32 junkstatus; pruint32 junkpercent; } u; char *string; } nsmsgsearchvalue; ...
NS ENSURE SUCCESS
syntax ns_ensure_success(nsresult, return-value); usage nsresult mozmyclass::mozstringmucking() { nsresult rv = ns_cstringcopy(mdeststring, msrcstring); ns_ensure_success(rv, rv); // this is the same as doing: nsresult rv = ns_cstringcopy(mdeststring, msrcstring); if (ns_failed(rv)) return rv; return ns_ok; } ...
NS ENSURE TRUE
syntax ns_ensure_true( expr, return-value ); usage nsresult mozmyclass::mozstringmucking() { char *foo = new char[123]; ns_ensure_true(foo, ns_error_out_of_memory); // this is equivalent to doing: if (!foo) return ns_error_out_of_memory; // thou shalt not return ns_error_failure..
Working with out parameters
void gettransferdata ( in string aflavor, out nsisupports adata, out unsigned long adatalen ) ; ...
XPCOM
file and memory management, threads, basic data structures (strings, arrays, variants), etc.
Xray vision
for example: the detail property of a customevent fired by content could be a javascript object or date as well as a string or a primitive the return value of evalinsandbox() and any properties attached to the sandbox object may be pure javascript objects also, the webidl specifications are starting to use javascript types such as date and promise: since webidl definition is the basis of dom xrays, not having xrays for these javascript types starts to seem arbitrary.
Filelink Providers
other services may require the user to fill in a server string or port number.
Index
93 access stringbundle from overlay thunderbird no summary!
LDAP Support
this can be accomplished by setting the following preferences: user_pref("mail.autocomplete.commentcolumn", 2); user_pref("ldap_2.servers.directoryname.autocomplete.commentformat", "[ou]"); the first preference tells us to use a comment column in the type down (the default value is 0 for no comment), and that the value for the comment is a custom string unique to each directory.
MailNews Filters
how to add a filter action add your new action to nsimsgfilteraction add code to file out the new action here add new action to the rulesactiontable add string for the new action to the filter editor dtd file add new action to the filter editor js code add new action to the xbl widget in the filter editor if your action has a parameter, add code to initialize the ui editing an existing filter here and to save to the filter here add your action to filter.properties so it will show up in the filter log.
Mail and RDF
might work inside the datasource: var msgcountarc = rdf.getresource("http://home.netscape.com/nc-rdf#totalmessages"); function gettarget(target, property, unused) { var folder = target.queryinterface(components.interfaces.nsimsgfolder); if (property == msgcountarc) { var msgcount = folder.gettotalmessages(false); var result = rdf.getliteral(msgcount.tostring()); return result; } } asynchronously notifying rdf when a mail object's data changes and the data is reflected in rdf by notifying all of the observers that rdf has registered with the datasource.
Thunderbird Binaries
you should see a string that looks something like this: comm-central-1.9.2 branch: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9.2.2pre) gecko/20100308 lanikai/3.1b1pre comm-central-trunk: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9.3a1pre) gecko/20090826 shredder/3.1a1pre the part that you want to note is the gecko revision number (rv) and the thunderbird version string.
Thunderbird Configuration Files
on windows vista/xp/2000, the path is usually %appdata%\thunderbird\profiles\xxxxxxxx.default\, where xxxxxxxx is a random string of 8 characters.
Adding items to the Folder Pane
each item in this array satisfies the following interface: id (attribute) a unique string for this object.
Demo Addon
then we store the folder name in a string to display it later on the screen and mark it with an * if it is the inbox.
Finding the code for a feature
i keep two prominent links to this on my firefox toolbar, one to comm-central string search, and one to comm-central file search.
Activity Manager examples
variant_contractid); initiator->setasisupports(reinterpret_cast<nsisupports*>(copyservice)); // subject of the delete operation is the imap folder // wrap it in a nsvariant component nscomptr<nsiwritablevariant> srcfolder = do_createinstance(ns_variant_contractid); srcfolder->setasisupports(reinterpret_cast<nsisupports*>(imapfolder)); copyevent->addsubject(srcfolder); copyevent->init(ns_literal_string("message copy event"), initiator, ns_literal_string("completed successfully"), pr_now() / pr_usec_per_msec, // start time pr_now() / pr_usec_per_msec); // completion time // do not forget to increase the ref counter if needed copyevent->setundohandler(undohandler); ///////////////////////////////////////////////////////////////...
Using COM from js-ctypes
, winabi, hresult, // return refclsid, // rclsid lpunknown, // punkouter dword, // dwclscontext refiid, // riid lpvoid // *ppv ); // helper functions function checkhresult(hr /*primative hresult*/, funcname /*jsstr*/) { // primative because thats what is returned by declared functions that // return hresult hr = hr.tostring(); // makes it primative if (hr < 0) { console.error('hresult', hr, 'returned from function ', funcname /*, 'getstrofresult:', getstrofresult(hr)*/); throw new error('hresult ' + hr + ' returned from function ' + funcname); } } let clsidfromarr = iidfromarr = function(jsarr_pieces) { let guid = guid(); // clsid and iid are same they are guid ...
Declaring and Calling Functions
example: multiple input parameters this example declares the libc asctime() function, which converts a time structure into a string.
Scripting plugins - Plugins
wnpobject = 15, npnvpluginelementnpobject = 16 how to call plugin native methods the following html code will do the job: <embed type="application/plugin-mimetype"> <script> var embed = document.embeds[0]; embed.nativemethod(); alert(embed.nativeproperty); embed.nativeproperty.anothernativemethod(); </script> the api extensions the api extensions are based on four new structs: npstring npvariant npn_releasevariantvalue npn_getstringidentifier npn_getstringidentifiers npn_getintidentifier npn_identifierisstring npn_utf8fromidentifier npn_intfromidentifier npobject npn_construct (since firefox 3.0b1) npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_enumerate (since mozilla 1.9a1) npn_eva...
URLs - Plugins
to post a file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path string.
Gecko Plugin API Reference - Plugins
accessing browser objects from a plugin how to call plugin native methods the api extensions npstring npvariant npn_releasevariantvalue npn_getstringidentifier npn_getstringidentifiers npn_getintidentifier npn_identifierisstring npn_utf8fromidentifier npn_intfromidentifier npobject npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_evaluate npn_getproperty npn_setp...
Preferences System
usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string.
DOM Inspector FAQ - Firefox Developer Tools
to restrict the search, you can use the beginning-of-string and end-of-string markers; e.g., searching nodes for "^tab$" will return only nodes whose names are exactly "tab".
Debugger keyboard shortcuts - Firefox Developer Tools
command windows macos linux close current file ctrl + w cmd + w ctrl + w search for a string in the current file ctrl + f cmd + f ctrl + f search for a string in all files ctrl + shift + f cmd + shift + f ctrl + shift + f find next in the current file ctrl + g cmd + g ctrl + g search for scripts by name ctrl + p cmd + p ctrl + p resume execution when at a breakpoint f8 f8 1 f8 step over f10 f10 1 f10 step into f11 f11 1 f11 step out shift + f11 shift + f11 1 shift + f11 toggle breakpoint on the currently selected line ctrl + b cmd + b ctrl + b toggle conditional breakpoint on the currently s...
UI Tour - Firefox Developer Tools
when the source pane is focused you can search for a string in the file using ctrl + f (cmd + f on a mac).
Debugger.Script - Firefox Developer Tools
for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information tracking how the code was introduced into the system; the entire string is not a valid url.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
plot(log); } function handleuncaughtexception(ex) { console.log('debugger hook threw:'); console.log(ex.tostring()); console.log('stack:'); console.log(ex.stack); }; function plot(log) { // given the log, compute a map from allocation sites to // allocation counts.
Index - Firefox Developer Tools
120 debug eval sources you can debug javascript code that is evaluated dynamically, either as a string passed to eval() or as a string passed to the function constructor.
All keyboard shortcuts - Firefox Developer Tools
enter return enter debugger command windows macos linux close current file ctrl + w cmd + w ctrl + w search for a string in the current file ctrl + f cmd + f ctrl + f search for a string in all files ctrl + shift + f cmd + shift + f ctrl + shift + f find next in the current file ctrl + g cmd + g ctrl + g search for scripts by name ctrl + p cmd + p ctrl + p resume execution when at a breakpoint f8 f8 1 f8 step over f10 f1...
Migrating from Firebug - Firefox Developer Tools
the search field in the firefox devtools filters the requests by the entered string.
Shader Editor - Firefox Developer Tools
in webgl they can be included in a page in several ways: as text hardcoded in javascript strings, as separate files included using <script> tags, or retrieved from the server as plain text.
Tips - Firefox Developer Tools
copy copies anything as a string.
AbstractRange - Web APIs
we set the starting position of the range to the sixth character of the text node's string, and the end position to the length of the text node's string minus one.
AesCbcParams - Web APIs
properties name a domstring.
AesCtrParams - Web APIs
properties name a domstring.
AesGcmParams - Web APIs
properties name a domstring.
AesKeyGenParams - Web APIs
properties name a domstring.
Animation.replaceState - Web APIs
syntax let myreplacestate = animation.replacestate; value a string that represents the replace state of the anmation.
Animation - Web APIs
WebAPIAnimation
animation.id gets and sets the string used to identify the animation.
AnimationEffect.getComputedTiming() - Web APIs
if effecttiming.duration is the string auto, this attribute will return 0.
AnimationEvent.animationName - Web APIs
the animationevent.animationname read-only property is a domstring containing the value of the animation-name css property associated with the transition.
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
syntax var animationplaybackevent = new animationplaybackevent(type, eventinitdict); parameters type a domstring representing the name of the event.
Attr.localName - Web APIs
WebAPIAttrlocalName
syntax name = attribute.localname return value a domstring representing the local part of the attribute's qualified name.
Attr.prefix - Web APIs
WebAPIAttrprefix
syntax string = attribute.prefix examples the following logs "x" to the console.
AudioBufferSourceNode - Web APIs
it's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network.
AudioContextOptions - Web APIs
constants standard values for latencyhint the latencyhint property can be number specifying a preferred maximum latency in seconds or a string from the audiocontextlatencycategory enumerated string, which selects a standard value for a given type of audio usage: value description "balanced" the user agent should balance audio output latency and power consumption when selecting a latency value.
AudioParam.exponentialRampToValueAtTime() - Web APIs
n); // set buttons to do something onclick exprampplus.onclick = function() { gainnode.gain.exponentialramptovalueattime(1.0, audioctx.currenttime + 2); } exprampminus.onclick = function() { gainnode.gain.exponentialramptovalueattime(0.01, audioctx.currenttime + 2); } note: a value of 0.01 was used for the value to ramp down to in the last function rather than 0, as an invalid or illegal string error is thrown if 0 is used — the value needs to be positive.
AudioProcessingEvent - Web APIs
type read only domstring the type of event.
AudioTrackList - Web APIs
gettrackbyid() returns the audiotrack found within the audiotracklist whose id matches the specified string.
AudioWorkletNode() - Web APIs
name a string, which represents the name of the audioworkletprocessor this node will be based on.
AudioWorkletNode.port - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
AudioWorkletProcessor.port - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
AudioWorkletProcessor.process - Web APIs
parameters an object containing string keys and float32array values.
AuthenticatorAttestationResponse.attestationObject - Web APIs
fmt a text string that indicates the format of the attstmt.
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.
AuthenticatorAttestationResponse - Web APIs
methods authenticatorattestationresponse.gettransports()secure context returns an array of strings describing which transport methods (e.g.
AuthenticatorResponse - Web APIs
authenticatorassertionresponse authenticatorattestationresponse properties authenticatorresponse.clientdatajson a json string in an arraybuffer, representing the client data that was passed to credentialscontainer.create() or credentialscontainer.get().
BaseAudioContext.state - Web APIs
syntax baseaudiocontext.state; value a domstring.
BasicCardResponse.cardNumber - Web APIs
syntax "cardnumber" : "number" value a domstring representing the credit card number.
BasicCardResponse.cardSecurityCode - Web APIs
syntax "cardsecuritycode" : "number" value a domstring representing the card security code.
BasicCardResponse.cardholderName - Web APIs
syntax name = basiccardresponse.cardholdername; value a domstring indicating the name of the cardholder.
BasicCardResponse.expiryMonth - Web APIs
syntax "expirymonth" : "number" value a domstring representing the card expiry month as a two-digit number in the range 01 to 12.
BasicCardResponse.expiryYear - Web APIs
syntax "expiryyear" : "number" value a domstring representing the card expiry year as a four-digit number in the range 0000 to 9999.
BatteryManager - Web APIs
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) specifications specification status comment battery status api candidate recommendation initial definition ...
BeforeUnloadEvent - Web APIs
when a non-empty string is assigned to the returnvalue event property, a dialog box appears, asking the users for confirmation to leave the page (see example below).
BiquadFilterNode - Web APIs
biquadfilternode.type is a string value defining the kind of filtering algorithm the node is implementing.
Blob.slice() - Web APIs
WebAPIBlobslice
the default value is an empty string.
Blob.type - Web APIs
WebAPIBlobtype
syntax var mimetype = blob.type value a domstring containing the file's mime type, or an empty string if the type could not be determined.
BluetoothRemoteGATTCharacteristic - Web APIs
bluetoothremotegattcharacteristic.uuidread only returns a domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic.
BluetoothRemoteGATTService - Web APIs
bluetoothremotegattservice.uuidread only returns a domstring representing the uuid of this service.
Body.blob() - Web APIs
WebAPIBodyblob
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.
Body.json() - Web APIs
WebAPIBodyjson
this object could be anything that can be represented by json — an object, an array, a string, a number...
Body - Web APIs
WebAPIBody
it returns a promise that resolves with a usvstring (text).
BroadcastChannel() - Web APIs
syntax channel = new broadcastchannel(channel); values channel is a domstring representing the name of the channel; there is one single channel with this name for all browsing contexts with the same origin.
BroadcastChannel.name - Web APIs
the read-only broadcastchannel.name property returns a domstring, which uniquely identifies the given channel with its name.
BroadcastChannel - Web APIs
broadcastchannel.name read only returns a domstring, the name of the channel.
Broadcast Channel API - Web APIs
an example string message: // example of sending of a very simple message bc.postmessage('this is a test message.'); any kind of object can be sent, not just a domstring.
CSS - Web APIs
WebAPICSS
css.escape() can be used to escape a string mostly for use as part of a css selector.
CSSConditionRule - Web APIs
interface cssconditionrule : cssgroupingrule { attribute domstring conditiontext; } properties the cssconditionrule derives from cssrule, cssgroupingrule and inherits all properties of these classes.
CSSGroupingRule - Web APIs
interface cssgroupingrule : cssrule { readonly attribute cssrulelist cssrules; unsigned long insertrule (domstring rule, unsigned long index); void deleterule (unsigned long index); } properties common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all properties of this class.
CSSImageValue - Web APIs
we then get() the background-image from the stylemap and stringify it: // get the element const button = document.queryselector( 'button' ); // retrieve all computed styles with computedstylemap() const allcomputedstyles = button.computedstylemap(); // return the cssimagevalue example console.log( allcomputedstyles.get('background-image') ); console.log( allcomputedstyles.get('background-image').tostring() ); specifications specification s...
CSSKeywordValue.value - Web APIs
syntax var val = csskeywordvalue.value csskeywordvalue.value = val value a usvstring.
CSSKeywordValue - Web APIs
the interface instance name is a stringifier meaning that when used anywhere a string is expected it will return the value of csskeyword.value.
CSSNumericValue.add() - Web APIs
examples let mathsum = css.px("23").add(css.percent("4")).add(css.cm("3")).add(css.in("9")); // prints "calc(23px + 4% + 3cm + 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'add' in that specification.
CSSNumericValue.div() - Web APIs
examples let mathproduct = css.px("24").div(css.percent("4")); // prints "calc(24px / 4%)" mathproduct.tostring(); specifications specification status comment css typed om level 1the definition of 'div' in that specification.
CSSNumericValue.max() - Web APIs
// prints "2cm" console.log(css.cm("1").max(css.cm("2")).tostring()); // prints "max(1cm, 0.393701in)" console.log(css.cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed om level 1the definition of 'max' in that specification.
CSSNumericValue.min() - Web APIs
// prints "1cm" console.log(css.cm("1").min(css.cm("2")).tostring()); // prints "max(1cm, 0.393701in)" console.log(css.cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed om level 1the definition of 'min' in that specification.
CSSNumericValue.mul() - Web APIs
examples let mathsum = css.px("23").mul(css.percent("4")).mul(css.cm("3")).mul(css.in("9")); // prints "calc(23px * 4% * 3cm * 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'mul' in that specification.
CSSNumericValue.sub() - Web APIs
examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification.
CSSNumericValue.sum() - Web APIs
examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification.
CSSNumericValue.to() - Web APIs
examples // prints "0.608542cm" console.log(css.px("23").to("com").tostring()); specifications specification status comment css typed om level 1the definition of 'to' in that specification.
CSSNumericValue.toSum() - Web APIs
examples let v = css.px("23").add(css.percent("4")).add(css.cm("3")).add(css.in("9")); v.tostring() // => "calc(23px + 4% + 3cm + 9in)" v.tosum("px", "percent").tostring() // => "calc(1000.39px + 4%)" specifications specification status comment css typed om level 1the definition of 'tosum' in that specification.
CSSNumericValue - Web APIs
cssnumericvalue.tosum tbd cssnumericvalue.type tbd cssnumericvalue.parse allows a cssnumericvalue to be constructed directly from a string containing css.
CSSPageRule - Web APIs
interface csspagerule : cssrule { attribute domstring selectortext; readonly attribute cssstyledeclaration style; }; properties as a cssrule, csspagerule also implements the properties of this interface.
CSSPrimitiveValue.setFloatValue() - Web APIs
exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the string value can't be converted into the specified unit.
CSSPseudoElement - Web APIs
csspseudoelement.type read only returns the pseudo-element selector as a cssomstring.
CSSRule.cssText - Web APIs
WebAPICSSRulecssText
syntax string = cssrule.csstext example <style> body { background-color: darkblue; } </style> <script> var stylesheet = document.stylesheets[0]; alert(stylesheet.cssrules[0].csstext); // body { background-color: darkblue; } </script> specifications specification status comment css object model (cssom)the definition of 'cssrule: csstext' in that specification.
CSSStyleDeclaration.getPropertyCSSValue() - Web APIs
syntax var value = style.getpropertycssvalue(property); parameters property is a domstring representing the property name to be retrieved.
CSSStyleSheet - Web APIs
this differs from insertrule(), which simply takes the textual representation of the entire rule as a single string.
CSSStyleValue.parse() - Web APIs
csstext a comma-separated string containing one or more values to apply to the provided property.
CSSStyleValue.parseAll() - Web APIs
csstext a comma-separated string containing one or more values that apply to the provided property.
CSSStyleValue - Web APIs
an instance of this class may be used anywhere a string is expected.
CSSUnitValue.CSSUnitValue() - Web APIs
unit returns a usvstring indicating the type of unit.
CSSUnitValue - Web APIs
cssunitvalue.unit returns a usvstring indicating the type of unit.
CSSUnparsedValue.CSSUnparsedValue() - Web APIs
syntax var cssunparsedvalue = new cssunparsedvalue(members) parameters members an array whose values must be either a usvstring or a cssvariablereferencevalue.
CSSUnparsedValue - Web APIs
it consists of a list of string fragments and variable references.
CSSValue.cssText - Web APIs
WebAPICSSValuecssText
syntax csstext = cssvalue.csstext; value a domstring representing the current css property value.
CSSValue - Web APIs
WebAPICSSValue
properties cssvalue.csstext a domstring representing the current value.
CSSVariableReferenceValue.variable - Web APIs
syntax var variable = cssvariablereferencevalue.variable; value a usvstring beginning with -- (that is, a custom property name).
Managing screen orientation - Web APIs
the screen.lockorientation() accepts a string (or series of strings) to define the kind of lock to apply.
Using dynamic styling information - Web APIs
however, this property only returns style attributes that have been set in-line (e.g, <td style="background-color: lightblue"> returns the string "background-color:lightblue", or directly for that element using element.style.propertyname, even though there may be other styles on the element from a stylesheet).
CSS Painting API - Web APIs
utproperties() { return ['--boxcolor']; } static get inputarguments() { return ['*','<length>']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = args[0].tostring(); const strokewidth = parseint(args[1]); console.log(thecolor); if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = thecolor; } else if ( stroketype === 'filled' ) { ctx.fillstyle = thecolor; ctx.strokestyle = thecolor; } else { ctx.fillstyle =...
Cache.addAll() - Web APIs
WebAPICacheaddAll
syntax cache.addall(requests[]).then(function() { // requests have been added to the cache }); parameters requests an array of string urls that you want to be fetched and added to the cache.
Cache.match() - Web APIs
WebAPICachematch
the available options are: ignoresearch: a boolean that specifies whether to ignore the query string in the url.
Cache.matchAll() - Web APIs
WebAPICachematchAll
the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
CacheStorage.has() - Web APIs
WebAPICacheStoragehas
}); parameters cachename a domstring representing the name of the cache object you are looking for in the cachestorage.
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.
CanvasRenderingContext2D.fillStyle - Web APIs
syntax ctx.fillstyle = color; ctx.fillstyle = gradient; ctx.fillstyle = pattern; options color a domstring parsed as css <color> value.
CanvasRenderingContext2D.filter - Web APIs
syntax ctx.filter = "<filter-function1> [<filter-function2>] [<filter-functionn>]"; ctx.filter = "none"; values the filter property accepts a value of "none" or one or more of the following filter functions in a domstring.
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
syntax ctx.globalcompositeoperation = type; type is a string identifying which of the compositing or blending mode operations to use.
CanvasRenderingContext2D.measureText() - Web APIs
syntax ctx.measuretext(text); parameters text the text string to measure.
CanvasRenderingContext2D.removeHitRegion() - Web APIs
syntax void ctx.removehitregion(id); parameters id a domstring representing the id of the region that is to be removed.
CanvasRenderingContext2D.shadowColor - Web APIs
syntax ctx.shadowcolor = color; color a domstring parsed as a css <color> value.
CanvasRenderingContext2D.strokeStyle - Web APIs
syntax ctx.strokestyle = color; ctx.strokestyle = gradient; ctx.strokestyle = pattern; options color a domstring parsed as css <color> value.
Compositing and clipping - Web APIs
globalcompositeoperation = type this sets the type of compositing operation to apply when drawing new shapes, where type is a string identifying which of the twelve compositing operations to use.
Drawing shapes with canvas - Web APIs
let's see how we can construct a path2d object: path2d() the path2d() constructor returns a newly instantiated path2d object, optionally with another path as an argument (creates a copy), or optionally with a string consisting of svg path data.
Drawing text - Web APIs
this string uses the same syntax as the css font property.
Using images - Web APIs
data urls allow you to completely define an image as a base64 encoded string of characters directly in your code.
Using channel messaging - Web APIs
for this initial port transfering this message could be an empty string but in this example it is set to 'init'.
Client.type - Web APIs
WebAPIClienttype
syntax var myclienttype = client.type; value a string, representing the client type.
Client.url - Web APIs
WebAPIClienturl
syntax var clienturl = client.url; value a usvstring.
Clients.get() - Web APIs
WebAPIClientsget
syntax self.clients.get(id).then(function(client) { // do something with your returned client }); parameters id a domstring representing the id of the client you want to get.
Clients.openWindow() - Web APIs
syntax self.clients.openwindow(url).then(function(windowclient) { // do something with your windowclient }); parameters url a usvstring representing the url of the client you want to open in the window.
Clipboard.write() - Web APIs
WebAPIClipboardwrite
example this example function replaces the current contents of the clipboard with a specified string.
Clipboard - Web APIs
WebAPIClipboard
readtext() requests text from the system clipboard; returns a promise which is resolved with a domstring containing the clipboard's text once it's available.
Clipboard API - Web APIs
since readtext() (and read(), for that matter) returns an empty string if the clipboard isn't text, this code is safe.
CloseEvent - Web APIs
closeevent.reason read only returns a domstring indicating the reason the server closed the connection.
Comment() - Web APIs
WebAPICommentComment
the comment() constructor returns a newly created comment object with the optional domstring given in parameter as its textual content.
CompositionEvent.CompositionEvent() - Web APIs
syntax const myevent = new compositionevent(typearg [, compositioneventinit]) values typearg is a domstring representing the name of the event.
CompositionEvent.locale - Web APIs
syntax mylocale = compositionevent.locale value a domstring representing the locale of current input method.
Console.table() - Web APIs
WebAPIConsoletable
// an array of strings console.table(["apples", "oranges", "bananas"]); // an object whose properties are strings function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var me = new person("john", "smith"); console.table(me); collections of compound types if the elements in the array, or properties in the object, are themselves arrays or objects, then their elemen...
Console API - Web APIs
examples let mystring = 'hello world'; // output "hello world" to the console console.log(mystring) see the console reference page for more examples.
ConstrainDouble - Web APIs
additionally, you can specify the property's value as a simple floating-point value, in which case the user agent does its best to match the value once all other more stringent constraints are met.
ConstrainULong - Web APIs
in addition, you can specify the value as a simple long integer value, in which case the user agent does its best to match the value once all other more stringent constraints are met.
ContentIndexEvent() - Web APIs
syntax var contentindexevent = new contentindexevent(type, contentindexeventinit); parameters type a domstring indicating the event which occurred.
ContentIndexEvent - Web APIs
id read only a string which identifies the deleted content index via it's id.
CrashReportBody - Web APIs
properties reason a string representing the reason for the crash.
CustomElementRegistry.define() - Web APIs
one option is currently supported: extends: string specifying the name of a built-in element to extend.
CustomEvent() - Web APIs
syntax event = new customevent(typearg, customeventinit); parameters typearg a domstring representing the name of the event.
CustomEvent.initCustomEvent() - Web APIs
syntax event.initcustomevent(type, canbubble, cancelable, detail); parameters type is a domstring containing the name of the event.
DOMConfiguration - Web APIs
rm", "cdata-sections", "check-character-normalization", "comments", "datatype-normalization", "element-content-whitespace", "entities", "error-handler", "infoset", "namespaces", "namespace-declarations", "normalize-characters","schema-location", "schema-type", "split-cdata-sections", "validate", "validate-if-schema", "well-formed" properties domconfiguration.parameternames read only is a domstringlist methods domconfiguration.cansetparameter() returns a boolean domconfiguration.getparameter() returns a domuserdata domconfiguration.setparameter() sets a parameter specification http://www.w3.org/tr/dom-level-3-cor...mconfiguration ...
DOMImplementation.createHTMLDocument() - Web APIs
syntax const newdoc = document.implementation.createhtmldocument(title) parameters title optional (except in ie) a domstring containing the title to give the new html document.
DOMMatrix() - Web APIs
syntax var dommatrix = new dommatrix([init]) parameters init optional a string containing a sequence of numbers or an array of numbers specifying the matrix you want to create, or a css transform string.
DOMMatrixReadOnly() - Web APIs
syntax var dommatrixreadonly = new dommatrixreadonly([init]) parameters init optional either a string containing a sequence of numbers or an array of integers specifying the matrix you want to create.
DOMMatrixReadOnly.flipX() - Web APIs
const flipped = document.getelementbyid('flipped'); const matrix = new dommatrixreadonly(); const flippedmatrix = matrix.flipx(); flipped.setattribute('transform', flippedmatrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.flipx()' in that specification.
DOMMatrixReadOnly.scale() - Web APIs
atrixwithorigin = matrix.scale(0.5, 25, 25); // if the browser has interpreted these parameters as scalex, scaley, scalez, the resulting matrix is 3d const browserexpectssixparamscale = !scaledmatrixwithorigin.is2d; if (browserexpectssixparamscale) { scaledmatrixwithorigin = matrix.scale(0.5, 0.5, 1, 25, 25, 0); } document.queryselector('#transformed').setattribute('transform', scaledmatrix.tostring()); document.queryselector('#transformedorigin').setattribute('transform', scaledmatrixwithorigin.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.scale()' in that specification.
DOMMatrixReadOnly.translate() - Web APIs
const matrix = new dommatrixreadonly().translate(25, 25); document.queryselector('#transformed').setattribute('transform', matrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.translate()' in that specification.
DOMParser() - Web APIs
this object can be used to parse the text of a document using the parsefromstring() method.
DOMTokenList.add() - Web APIs
WebAPIDOMTokenListadd
syntax tokenlist.add(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token (or tokens) to add to the tokenlist.
DOMTokenList.contains() - Web APIs
syntax tokenlist.contains(token); parameters token a domstring representing the token you want to check for the existance of in the list.
DOMTokenList.entries() - Web APIs
the values are domstring objects, each representing a single token.
DOMTokenList.supports() - Web APIs
syntax let trueorfalse = element.supports(token) parameters token a domstring containing the token to query for.
DOMTokenList.toggle() - Web APIs
syntax tokenlist.toggle(token [, force]); parameters token a domstring representing the token you want to toggle.
DOMTokenList.values() - Web APIs
the individual values are domstring objects.
DOMTokenList - Web APIs
domtokenlist.value a stringifier property that returns the value of the list as a domstring.
DOMUserData - Web APIs
note that although it can be an object, in mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., node.setuserdata() and node.getuserdata()).
DataTransfer.effectAllowed - Web APIs
syntax datatransfer.effectallowed; values a domstring representing the drag operation that is allowed.
DataTransfer.mozClearDataAt() - Web APIs
syntax void datatransfer.mozcleardataat([type], index); arguments type a string representing the type of the drag data to remove from the drag data object.
DataTransfer.mozCursor - Web APIs
syntax datatransfer.mozcursor; return value a domstring representing one of the values listed above.
DataTransfer.mozGetDataAt() - Web APIs
syntax nsivariant datatransfer.mozgetdataat([type], index); arguments type a string representing the type of the drag data to retrieve from the drag data object.
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.
DedicatedWorkerGlobalScope.name - Web APIs
syntax var nameobj = self.name; value a domstring.
Device Memory API - Web APIs
traditionally, developrs had to use heruistics and either benchmark the device or infer the device capabilities based on other factors like device manufacturer or user agent strings.
Document.alinkColor - Web APIs
syntax var color = document.alinkcolor; document.alinkcolor = color; color is a string containing the name of the color (e.g., blue, darkblue, etc.) or the hexadecimal value of the color (e.g., #0000ff) notes the default value for this property in mozilla firefox is red (#ee0000 in hexadecimal).
Document.bgColor - Web APIs
WebAPIDocumentbgColor
syntax color = document.bgcolor document.bgcolor =color parameters color is a string representing the color as a word (e.g., "red") or hexadecimal value (e.g., "#ff0000").
Document.characterSet - Web APIs
syntax var string = document.characterset; examples <button onclick="console.log(document.characterset);"> log character encoding </button> <!-- displays document's character encoding in the dev console, such as "iso-8859-1" or "utf-8" --> specifications specification status comment domthe definition of 'characterset' in that specification.
Document.createExpression() - Web APIs
syntax xpathexpr = document.createexpression(xpathtext, namespaceurlmapper); parameters xpathtext is a string which is the xpath expression to be compiled.
Document.createTextNode() - Web APIs
data is a string containing the data to be put in the text node.
Document.designMode - Web APIs
syntax var mode = document.designmode; document.designmode = value; value a string indicating whether designmode is (or should be) set to on or off.
Document.dir - Web APIs
WebAPIDocumentdir
the document.dir property is a domstring representing the directionality of the text of the document, whether left to right (default) or right to left.
Document.documentURI - Web APIs
the documenturi read-only property of the document interface returns the document location as a string.
Document.fgColor - Web APIs
WebAPIDocumentfgColor
syntax var color = document.fgcolor; document.fgcolor = color; parameters color is a string representing the color as a word (e.g., "red") or hexadecimal value (e.g., "#ff0000").
Document.getElementsByClassName() - Web APIs
names is a string representing the class name(s) to match; multiple class names are separated by whitespace getelementsbyclassname can be called on any element, not only on the document.
Document.getElementsByName() - Web APIs
be careful not to use the same string as both a name and an id.
Document.linkColor - Web APIs
syntax color = document.linkcolor document.linkcolor = color parameters color is a string representing the color as a word (e.g., red) or hexadecimal value (e.g., #ff0000).
Document.open() - Web APIs
WebAPIDocumentopen
a string of "replace") specified that the history entry for the new document would replace the current history entry of the document being written to.
Document.preferredStyleSheetSet - Web APIs
if there isn't a preferred style sheet set defined by the author, the empty string ("") is returned.
Document.queryCommandState() - Web APIs
syntax querycommandstate(string command) parameters command is a command from document.execcommand() return value querycommandstate() can return a boolean value or null if the state is unknown.
Document.readyState - Web APIs
syntax var string = document.readystate; values the readystate of a document can be one of following: loading the document is still loading.
Document.visibilityState - Web APIs
syntax var string = document.visibilitystate examples document.addeventlistener("visibilitychange", function() { console.log( document.visibilitystate ); // modify behavior...
Document.vlinkColor - Web APIs
syntax color = document.vlinkcolor document.vlinkcolor = color parameters color is a string representing the color as a word (e.g., "red") or hexadecimal value (e.g., "#ff0000").
DocumentFragment.querySelectorAll() - Web APIs
syntax elementlist = documentfragment.queryselectorall(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas.
DocumentOrShadowRoot.activeElement - Web APIs
morbi sed euismod diam.</textarea> </form> <p>active element id: <b id="output-element"></b></p> <p>selected text: <b id="output-text"></b></p> javascript function onmouseup(e) { const activetextarea = document.activeelement; const selection = activetextarea.value.substring( activetextarea.selectionstart, activetextarea.selectionend ); const outputelement = document.getelementbyid('output-element'); const outputtext = document.getelementbyid('output-text'); outputelement.innerhtml = activetextarea.id; outputtext.innerhtml = selection; } const textarea1 = document.getelementbyid('ta-example-one'); const textarea2 = document.getelementbyid('ta-example-...
How to create a DOM tree - Web APIs
dom trees can be queried using xpath expressions, converted to strings or written to a local or remote files using xmlserializer (without having to first convert to a string), posted to a web server (via xmlhttprequest), transformed using xslt, xlink, converted to a javascript object through a jxon algorithm, etc.
DragEvent() - Web APIs
syntax event = new dragevent(type, drageventinit); arguments type is a domstring representing the name of the event (see dragevent event types).
EcdhKeyDeriveParams - Web APIs
properties name a domstring.
EffectTiming.direction - Web APIs
syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a domstring which specifies the direction in which the animation should play as well as what to do when the playback reaches the end of the animation sequence in the current direction.
EffectTiming.duration - Web APIs
exceptions typeerror the specified value is either a string other than "auto", a number less than zero, nan, or some other type of object entirely.
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
syntax var timingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a domstring indicating the fill type to use in order to properly render an affected element when outside the animation's active interval (that is, when it's not actively animating).
Element.animate() - Web APIs
WebAPIElementanimate
options either an integer representing the animation's duration (in milliseconds), or an object containing one or more timing properties: id optional a property unique to animate(): a domstring with which to reference the animation.
Element.attachShadow() - Web APIs
tach a shadow root to: any autonomous custom element with a valid name <article> <aside> <blockquote> <body> <div> <footer> <h1> <h2> <h3> <h4> <h5> <h6> <header> <main> <nav> <p> <section> <span> syntax var shadowroot = element.attachshadow(shadowrootinit); parameters shadowrootinit a shadowrootinit dictionary, which can contain the following fields: mode a string specifying the encapsulation mode for the shadow dom tree.
Element.attributes - Web APIs
to be more specific, attributes is a key/value pair of strings that represents any information regarding that attribute.
Element: copy event - Web APIs
>...and pasting it into this one</div> css div.source, div.target { border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('copy', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element: cut event - Web APIs
WebAPIElementcut event
">...and pasting it into this one</div> css div.source, div.target { border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('cut', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); selection.deletefromdocument(); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
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
attrname is a string containing the name of the attribute.
Element.getElementsByClassName() - Web APIs
syntax var elements = element.getelementsbyclassname(names); parameters names a domstring containing one or more class names to match on, separated by whitespace.
Element.getElementsByTagName() - Web APIs
the special string "*" represents all elements.
Element.hasAttribute() - Web APIs
name is a string representing the name of the attribute.
Element.hasAttributeNS() - Web APIs
namespace is a string specifying the namespace of the attribute.
Element.id - Web APIs
WebAPIElementid
if the id value is not the empty string, it must be unique in a document.
Element.insertAdjacentElement() - Web APIs
syntax targetelement.insertadjacentelement(position, element); parameters position a domstring representing the position relative to the targetelement; must match (case-insensitively) one of the following strings: 'beforebegin': before the targetelement itself.
Element.localName - Web APIs
WebAPIElementlocalName
syntax name = element.localname return value a domstring representing the local part of the element's qualified name.
Element.name - Web APIs
WebAPIElementname
syntax htmlelement.name = string let elname = htmlelement.name let fcontrol = htmlformelement.elementname let controlcollection = htmlformelement.elements.elementname example <form action="" name="forma"> <input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.na...
Element.prefix - Web APIs
WebAPIElementprefix
syntax string = element.prefix examples the following logs "x" to the console.
Element.removeAttribute() - Web APIs
syntax element.removeattribute(attrname); parameters attrname a domstring specifying the name of the attribute to remove from the element.
Element: select event - Web APIs
examples selection logger <input value="try selecting some text in this element."> <p id="log"></p> function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const input = document.queryselector('input'); input.addeventlistener('select', logselection); onselect equivalent you can also set up the event handler using the onselect property: input.onselect = logselection; specifications specification status ui event...
Element.slot - Web APIs
WebAPIElementslot
syntax var astring = element.slot element.slot = astring value a domstring.
Element.toggleAttribute() - Web APIs
syntax element.toggleattribute(name [, force]); parameters name a domstring specifying the name of the attribute to be toggled.
Encoding API - Web APIs
stringview – a c-like representation of strings based on typed arrays.
Event() - Web APIs
WebAPIEventEvent
syntax new event(typearg[, eventinit]); values typearg this is a domstring representing the name of the event.
Event.initEvent() - Web APIs
WebAPIEventinitEvent
syntax event.initevent(type, bubbles, cancelable); type is a domstring defining the type of event.
Event.msConvertURL() - Web APIs
targettype [in] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged".
EventSource() - Web APIs
syntax eventsource = new eventsource(url, configuration); parameters url a usvstring that represents the location of the remote resource serving the events/messages.
EventSource - Web APIs
eventsource.url read only a domstring representing the url of the source.
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.
EventTarget.removeEventListener() - Web APIs
the event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see matching event listeners for removal syntax target.removeeventlistener(type, listener[, options]); target.removeeventlistener(type, listener[, usecapture]); parameters type a string which specifies the type of event for which to remove an event listener.
EventTarget - Web APIs
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example simple implementation of eventtarget var eventtarget = function() { this.listeners = {}; }; eventtarget.prototype.listeners = null; eventtarget.prototype.addeventlistener = function(type, callback) { if (!(type in this.listeners)) { this.listeners[type] = []; } this.listeners[type].push(callback...
ExtendableMessageEvent.origin - Web APIs
syntax var myorigin = extendablemessageevent.origin; value a usvstring.
ExtendableMessageEvent - Web APIs
this is an empty string.
FeaturePolicy.allowedFeatures() - Web APIs
return value an array of strings representing the feature policy directive names that are allowed by the feature policy this method is called on.
FeaturePolicy.features() - Web APIs
return value a list of strings that represent names of all feature policy directives supported by the user agent.
FederatedCredential - Web APIs
syntax var mycredential = new federatedcredential(init) parameters init options are: provider: a usvstring; identifying the credential provider.
FetchEvent.clientId - Web APIs
syntax var myclientid = fetchevent.clientid; value a domstring that represents the client id.
FetchEvent.respondWith() - Web APIs
if the response.url value is the empty string, then the fetchevent.request.url is used as the final url.
File.fileName - Web APIs
WebAPIFilefileName
syntax var name = instanceoffile.filename; value a string specification not part of any specification.
File.getAsDataURL() - Web APIs
WebAPIFilegetAsDataURL
syntax var url = instanceoffile.getasdataurl(); returns a string representing a data: url example // fileinput is a htmlinputelement: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // array with acceptable file types var accept = ["image/png"]; // img is a htmlimgelement: <img id="myimg"> var img = document.getelementbyid("myimg"); // if we accept the first selected file type if (accept.indexof(files[0].mediatype) > -1) { // display the image // sa...
File.name - Web APIs
WebAPIFilename
syntax var name = file.name; value a string, containing the name of the file without path, such as "my resume.rtf".
File - Web APIs
WebAPIFile
it returns a promise that resolves with a usvstring (text).
FileException - Web APIs
when errors occur, forward them to the main app using postmessage() as in the following: function onerror(e) { postmessage('error:' + e.tostring()); } try { //error is thrown if "log.txt" already exists.
FileReader.onload - Web APIs
WebAPIFileReaderonload
the filereader.onload property contains an event handler executed when the load event is fired, when content read with readasarraybuffer, readasbinarystring, readasdataurl or readastext is available.
FileSystem - Web APIs
properties filesystem.name read only a usvstring representing the file system's name.
FileSystemDirectoryEntry.getDirectory() - Web APIs
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.
FileSystemDirectoryEntry.getFile() - Web APIs
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.
FileSystemEntry.copyTo() - Web APIs
newname optional if this parameter is provided, the copy is given this string as its new file or directory name.
FileSystemEntry.moveTo() - Web APIs
newname optional if this parameter is provided, the entry is renamed to have this string as its new file or directory name.
FileSystemFileEntry.createWriter() - Web APIs
example this example establishes a method, writetofileentry(), which outputs a text string to the file corresponding to the passed-in directory entry.
FileSystemFileEntry - Web APIs
fileentry.createwriter(function(filewriter) { filewriter.onwriteend = function(e) { console.log('write completed.'); }; filewriter.onerror = function(e) { console.log('write failed: ' + e.tostring()); }; // create a new blob and write it to log.txt.
FileSystemSync - Web APIs
attributes attribute type description name readonly domstring name of the file system.
FileHandle API - Web APIs
that said, as the name does not match any real filename it can be an empty string, for example, and it doesn't even have to be unique.
FocusEvent() - Web APIs
typearg is a domstring representing the name of the event.
FontFace.display - Web APIs
WebAPIFontFacedisplay
syntax var display = fontface.display fontface.display = display value a cssomstring with one of the following values.
FontFace.family - Web APIs
WebAPIFontFacefamily
syntax instanceoffontface.family = 'font family name'; var fontface = instanceoffontface.family; // "font family name" value a domstring.
FontFace.featureSettings - Web APIs
syntax var featuresettingdescriptor = fontface.featuresettings; fontface.featuresettings = featuresettingdescriptor; value a cssomstring containing a descriptor.
FontFace.stretch - Web APIs
WebAPIFontFacestretch
syntax var stretchdescriptor = fontface.stretch; fontface.stretch = stretchdescriptor; value a cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule.
FontFace.style - Web APIs
WebAPIFontFacestyle
syntax var style = fontface.style; fontface.style = value; value a cssomstring containing the descriptors defined in the style sheet's @font-face rule.
FontFace.unicodeRange - Web APIs
syntax var unicoderangedescriptor = fontface.unicoderange; fontface.unicoderange = unicoderangedescriptor; value a cssomstring containing a descriptor as it would appear in a style sheet's @font-face rule.
FontFace.variant - Web APIs
WebAPIFontFacevariant
syntax var variantsubproperty = fontface.variant; fontface.variant = variantsubproperty; value a cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule.
FontFace.weight - Web APIs
WebAPIFontFaceweight
syntax var weightdescriptor = fontface.weight; fontface.weight = weightdescriptor; value a cssomstring containing a descriptor as it would be defined in a style sheet's @font-face rule.
FormData.entries() - Web APIs
WebAPIFormDataentries
the key of each pair is a usvstring object; the value either a usvstring, or a blob.
FormData.get() - Web APIs
WebAPIFormDataget
syntax formdata.get(name); parameters name a usvstring representing the name of the key you want to retrieve.
FormData.getAll() - Web APIs
WebAPIFormDatagetAll
syntax formdata.getall(name); parameters name a usvstring representing the name of the key you want to retrieve.
FormData.has() - Web APIs
WebAPIFormDatahas
syntax formdata.has(name); parameters name a usvstring representing the name of the key you want to test for.
FormData.keys() - Web APIs
WebAPIFormDatakeys
the keys are usvstring objects.
FormData.values() - Web APIs
WebAPIFormDatavalues
the values are usvstring or blob objects.
FormDataEntryValue - Web APIs
a string or file that represents a single value from a set of formdata key-value pairs.
FormDataEvent() - Web APIs
syntax new formdataevent(type[, formeventinit]); values type a domstring representing the name of the event.
FullscreenOptions.navigationUI - Web APIs
syntax let fullscreenoptions = { navigationui: value }; value the value of the navigationui property must be one of the following strings.
FullscreenOptions - Web APIs
properties navigationuioptional a string controlling whether or not to keep browser user interface elements visible while the element is in full-screen mode.
Fullscreen API - Web APIs
the full-screen mode feature is identified by the string "fullscreen", with a default allow-list value of "self", meaning that full-screen mode is permitted in top-level document contexts, as well as to nested browsing contexts loaded from the same origin as the top-most document.
Gamepad.hand - Web APIs
WebAPIGamepadhand
empty string ("") — this value is returned if the other values are not applicable, e.g.
GamepadEvent() - Web APIs
syntax var gamepadevent = new gamepadevent(typearg, options) parameters typearg a domstring that must be one of gamepadconnected or gamepaddisconnected.
GeolocationPositionError - Web APIs
geolocationpositionerror.message read only secure context returns a human-readable domstring describing the details of the error.
GlobalEventHandlers.onkeypress - Web APIs
html <label>enter numbers only: <input> </label> javascript function numbersonly(event) { return event.charcode === 0 || /\d/.test(string.fromcharcode(event.charcode)); } const input = document.queryselector('input'); input.onkeypress = numbersonly; // prevent pasting (since pasted content might include non-number characters) input.onpaste = event => false; result capture the typing of a hidden word the following javascript function will do something after the user types the word "exit" in any point of a page.
GlobalEventHandlers.onpointerdown - Web APIs
the handledown() function, in turn, looks at the value of pointertype to determine what kind of pointing device was used, then uses that information to customize a string to replace the contents of the target box.
GlobalEventHandlers.onselect - Web APIs
html <textarea>try selecting some text in this element.</textarea> <p id="log"></p> javascript function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const textarea = document.queryselector('textarea'); textarea.onselect = logselection; result specification specification status comment html living standardthe definition of 'onselect' in that specification.
HTMLAnchorElement.download - Web APIs
the htmlanchorelement.download property is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser.
HTMLAnchorElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <a> element and the current document.
HTMLAreaElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <area> element and the current document.
Audio() - Web APIs
syntax audioobj = new audio(url); parameters url optional an optional domstring containing the url of an audio file to be associated with the new audio element.
HTMLBRElement - Web APIs
htmlbrelement.clear is a domstring indicating the flow of text around floating objects.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
type optional a domstring indicating the image format.
HTMLCanvasElement: webglcontextcreationerror event - Web APIs
this event has a webglcontextevent.statusmessage property, which can contain a platform dependent string with more information about the failure.
HTMLCollection - Web APIs
htmlcollection.nameditem() returns the specific node whose id or, as a fallback, name matches the string specified by name.
HTMLContentElement.select - Web APIs
it is a domstring containing a space-separated list of css selectors that select the content to insert in place of the <content> element.
HTMLContentElement - Web APIs
htmlcontentelement.select is a domstring that reflects the select html attribute.
HTMLDataElement - Web APIs
htmldataelement.value is a domstring reflecting the value html attribute, containing a machine-readable form of the element's value.
HTMLDialogElement.returnValue - Web APIs
syntax dialoginstance.returnvalue = 'myreturnvalue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog.
HTMLDivElement - Web APIs
htmldivelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
accessKeyLabel - Web APIs
the htmlelement.accesskeylabel read-only property returns a string that represents the element's assigned access key (if any); otherwise it returns an empty string.
HTMLElement.innerText - Web APIs
syntax const renderedtext = htmlelement.innertext htmlelement.innertext = string value a domstring representing the rendered text content of an element.
HTMLFormControlsCollection - Web APIs
like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value").
HTMLFormElement.acceptCharset - Web APIs
syntax var string = form.acceptcharset; form.acceptcharset = string; example inputs = document.forms['myform'].acceptcharset; specifications specification status comment html living standardthe definition of 'htmlformelement: acceptcharset' in that specification.
HTMLFormElement.action - Web APIs
syntax var string = form.action; form.action = string; example form.action = '/cgi-bin/publish'; specifications specification status comment html living standardthe definition of 'htmlformelement: action' in that specification.
HTMLFormElement.enctype - Web APIs
syntax var string = form.enctype; form.enctype = string; example form.enctype = 'application/x-www-form-urlencoded'; specifications specification status comment html living standardthe definition of 'htmlformelement: enctype' in that specification.
HTMLFormElement.method - Web APIs
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.
HTMLFormElement.target - Web APIs
syntax string = htmlformelement.target htmlformelement.target = string example myform.target = document.frames[1].name; specifications specification status comment html living standardthe definition of 'htmlformelement: target' in that specification.
HTMLHeadElement - Web APIs
htmlheadelement.profile is a domstring representing the uris of one or more metadata profiles (white space separated).
HTMLHeadingElement - Web APIs
htmlheadingelement.align is a domstring representing an enumerated attribute indicating alignment of the heading with respect to the surrounding context.
HTMLHtmlElement.version - Web APIs
while this property is recognized by mozilla, the return value for this property is always an empty string.
HTMLHtmlElement - Web APIs
htmlhtmlelement.version is a domstring representing the version of the html document type definition (dtd) that governs this document.
HTMLImageElement.complete - Web APIs
the srcset attribute is absent and the src attribute, while specified, is the empty string ("").
HTMLImageElement.currentSrc - Web APIs
syntax let currentsource = htmlimageelement.currentsrc; value a usvstring indicating the full url of the image currently visible in the <img> element represented by the htmlimageelement.
HTMLImageElement.decoding - Web APIs
syntax refstr = imgelem.decoding; imgelem.decoding = refstr; values a domstring representing the decoding hint.
HTMLImageElement.isMap - Web APIs
usage notes when an image marked as being part of a server-side image map is clicked, the browser constructs the string "?x,y", where x and y indicate the coordinates at which the mouse was clicked as offsets from the top-left corner of the image, specified in css pixels.
HTMLImageElement.longDesc - Web APIs
syntax descurl = htmlimageelement.longdesc; htmlimageelement.longdesc = descurl; value a domstring which may be either an empty string (indicating that no long description is available) or the url of a file containing a long form description of the image's contents.
HTMLImageElement.lowSrc - Web APIs
syntax htmlimageelement.lowsrc = imageurl; imageurl = htmlimageelement.lowsrc; value a domstring specifying the url of a version of the image specified by src which has been modified in some fashion so that it loads significantly more quickly than the primary image.
HTMLImageElement.name - Web APIs
syntax htmlimageelement.name = namestring; namestring = htmlimageelement.name; value a domstring providing a name by which the image can be referenced.
HTMLImageElement.referrerPolicy - Web APIs
syntax refstr = imgelt.referrerpolicy; imgelt.referrerpolicy = refstr; values a domstring representing the referrer policy.
HTMLImageElement.src - Web APIs
syntax htmlimageelement.src = newsource; let src = htmlimageelement.src; value when providing only a single image, rather than a set of images from which the browser selects the best match for the viewport size and display pixel density, the src attribute is a usvstring specifying the url of the desired image.
HTMLInputElement: search event - Web APIs
in that case the value of the <input> element will be the empty string.
HTMLInputElement.setSelectionRange() - Web APIs
selectiondirection optional a string indicating the direction in which the selection is considered to have been performed.
HTMLIsIndexElement - Web APIs
htmlisindexelement.prompt is a domstring representing a text to be prompted for the field.
HTMLLIElement - Web APIs
htmllielement.type is a domstring representing the type of the bullets, "disc", "square" or "circle".
HTMLLabelElement.htmlFor - Web APIs
syntax controlid = htmllabelelement.htmlfor htmllabelelement.htmlfor = newid value a domstring which contains the id string of the element which is associated with the control.
HTMLLabelElement - Web APIs
htmllabelelement.htmlfor is a string containing the id of the labeled control.
HTMLLinkElement.referrerPolicy - Web APIs
syntax domstring htmllinkelement.referrerpolicy example var links = document.getelementsbytagname("link"); links[0].referrerpolicy; // "no-referrer" specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification.
HTMLLinkElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <link> element and the current document.
HTMLMapElement - Web APIs
htmlmapelement.name is a domstring representing the <map> element for referencing it other context.
HTMLMediaElement.mediaGroup - Web APIs
value a domstring.
HTMLMediaElement.msInsertAudioEffect() - Web APIs
syntax htmlmediaelement.msinsertaudioeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the audio effects class.
HTMLMediaElement.src - Web APIs
syntax var mediaurl = htmlmediaelement.src; value a usvstring object containing the url of a media resource to use in the element; this property reflects the value of the html element's src attribute.
HTMLOListElement - Web APIs
htmlolistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display.
HTMLObjectElement.setCustomValidity - Web APIs
gotta fill this out, yo!'); input.reportvalidity(); } else if (input.rangeunderflow) { input.setcustomvalidity('we need a higher number!'); input.reportvalidity(); } else if (input.rangeoverflow) { input.setcustomvalidity('thats too high!'); input.reportvalidity(); } else { input.setcustomvalidity(''); input.reportvalidity(); } } it's vital to set the message to an empty string if there are no errors.
HTMLOptGroupElement - Web APIs
htmloptgroupelement.label is a domstring representing the label for the group.
HTMLOrForeignElement.nonce - Web APIs
examples retrieving a nonce value in the past, not all browsers supported the nonce idl attribute, so a workaround is to try to use getattribute as a fallback: let nonce = script['nonce'] || script.getattribute('nonce'); however, recent browsers version hide nonce values that are accessed this way (an empty string will be returned).
HTMLParagraphElement - Web APIs
htmlparagraphelement.align a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
HTMLQuoteElement - Web APIs
htmlquoteelement.cite is a domstring reflecting the cite html attribute, containing a url for the source of the quotation.
HTMLSelectElement.selectedOptions - Web APIs
a string is constructed to list the ordered items, with logic to build the list using proper english grammar rules (including a serial comma).
HTMLSlotElement.name - Web APIs
syntax var name = htmlslotelement.name htmlslotelement.name = name value a domstring.
HTMLSlotElement - Web APIs
properties htmlslotelement.name domstring: can be used to get and set the slot's name.
HTMLStyleElement.media - Web APIs
syntax medium = style.media style.media = medium parameters medium is a string describing a single medium or a comma-separated list.
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
htmltablecaptionelement.align is a domstring which represents an enumerated attribute indicating alignment of the caption with respect to the table.
HTMLTableElement.align - Web APIs
syntax htmltableelement.align = alignment; var alignment = htmltableelement.align; parameters alignment domstring with one of the following values: left center right example // set the alignmnet of a table var t = document.getelementbyid('tablea'); t.align = 'center'; specification w3c dom 2 html specification htmltableelement .align.
HTMLTableElement.bgColor - Web APIs
syntax color = table.bgcolor table.bgcolor = color parameters color is a string representing a color value.
HTMLTableElement.border - Web APIs
syntax htmltableelement.border = border; var border = htmltableelement.border; border is a string representing the width of the border in pixels.
HTMLTableElement.caption - Web APIs
syntax var string = tableelement.caption; example if (table.caption) { // do something with the caption } specifications specification status comment html living standardthe definition of 'htmltableelement.caption' in that specification.
HTMLTableElement.cellSpacing - Web APIs
syntax htmltableelement.cellspacing = spacing; var spacing = htmltableelement.cellspacing; value a domstring which is either a number of pixels (such as "10") or a percentage value (like "10%").
HTMLTableElement.rules - Web APIs
syntax htmltableelement.rules = rules; var rules = htmltableelement.rules; parameters rules is a string with one of the following values: none no rules groups lines between groups only rows lines between rows cols lines between cols all lines between all cells example // turn on all the internal borders of a table var t = document.getelementbyid("tableid"); t.rules = "all"; specification w3c dom 2 html specification ...
HTMLTableElement.summary - Web APIs
syntax htmltableelement.summary = string; varstring = htmltableelement.summary; example htmltableelement.summary = "usage statistics"; specification w3c dom 2 html specification ...
HTMLTableElement.width - Web APIs
syntax htmltableelement.width = width; var width = htmltableelement.width; where width is a string representing the width in number of pixels or as a percentage value.
HTMLTimeElement - Web APIs
htmltimeelement.datetime is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value.
HTMLTitleElement - Web APIs
htmltitleelement.text is a domstring representing the text of the document's title.
HTMLTrackElement.src - Web APIs
syntax var texttrackurl = htmltrackelement.src; value a domstring object containing the url of the text track data.
HTMLUListElement - Web APIs
htmlulistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display.
HTMLVideoElement.msInsertVideoEffect() - Web APIs
syntax str = htmlmediaelement.msinsertvideoeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the video effects class.
HTMLVideoElement.msIsLayoutOptimalForPlayback - Web APIs
syntax htmlvideoelement.msislayoutoptimalforplayback: domstring; value boolean value set to true indicates that video is being rendered optimally (better performance and using less battery power).
The HTML DOM API - Web APIs
domstringlist domstringmap errorevent htmlallcollection mimetype mimetypearray promiserejectionevent interfaces belonging to other apis several interfaces are technically defined in the html specification while actually being part of other apis.
HashChangeEvent.newURL - Web APIs
syntax let neweventurl = event.newurl; value a domstring.
HashChangeEvent.oldURL - Web APIs
syntax let oldeventurl = event.oldurl; value a domstring.
Headers() - Web APIs
WebAPIHeadersHeaders
this can be a simple object literal with bytestring values; or an existing headers object.
Headers.entries() - Web APIs
WebAPIHeadersentries
the both the key and value of each pairs are bytestring objects.
Headers.getAll() - Web APIs
WebAPIHeadersgetAll
returns an array containing a bytestring sequence representing the values of the retrieved header.
Headers.keys() - Web APIs
WebAPIHeaderskeys
the keys are bytestring objects.
Headers.values() - Web APIs
WebAPIHeadersvalues
the values are bytestring objects.
Headers - Web APIs
WebAPIHeaders
headers.get() returns a bytestring sequence of all the values of a header within a headers object with a given name.
History.replaceState() - Web APIs
passing the empty string here should be safe against future changes to the method.
History - Web APIs
WebAPIHistory
internet explorer lets you specify a string, instead of an integer, to go to a specific url in the history list.
History API - Web APIs
window.onpopstate = function(event) { alert(`location: ${document.location}, state: ${json.stringify(event.state)}`) } history.pushstate({page: 1}, "title 1", "?page=1") history.pushstate({page: 2}, "title 2", "?page=2") history.replacestate({page: 3}, "title 3", "?page=3") history.back() // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" history.back() // alerts "location: http://example.com/example.html, state: null" history.go(2) // alerts "location: http://e...
IDBCursor.source - Web APIs
WebAPIIDBCursorsource
within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction, indexnames: domstringlist, keypath: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it.
IDBCursor - Web APIs
WebAPIIDBCursor
you should use the string constants directly instead.
IDBDatabase.createObjectStore() - Web APIs
invalidaccesserror if autoincrement is set to true and keypath is either an empty string or an array containing an empty string.
IDBDatabase.version - Web APIs
when a database is first created, this attribute is an empty string.
IDBDatabaseException - Web APIs
message domstring error message describing the exception raised.
IDBIndex.locale - Web APIs
WebAPIIDBIndexlocale
syntax var myindex = objectstore.index('index'); console.log(myindex.locale); value a domstring.
IDBIndex.objectStore - Web APIs
the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id", indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table.
FileHandle.name - Web APIs
syntax var name = instanceoffilehandle.name value a string.
FileHandle.open() - Web APIs
syntax var myfile = instanceoffilehandle.open(mode); parameters mode a string that specifies the writing mode for the file.
FileHandle.type - Web APIs
syntax var type = instanceoffilehandle.type value a string.
IDBObjectStore.createIndex() - Web APIs
any sorting operations performed on the data via key ranges will then obey sorting rules of that locale (see locale-aware sorting.) you can specify its value in one of three ways: string: a string containing a specific locale code, e.g.
IDBObjectStore.indexNames - Web APIs
syntax var myindexnames = objectstore.indexnames; value a domstringlist.
IDBObjectStore.name - Web APIs
syntax idbobjectstore.name = mynewname; var myobjectstorename = idbobjectstore.name; value a domstring containing the object store's name.
IDBVersionChangeRequest.setVersion() - Web APIs
syntax idbversionchangerequest setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database.
InputEvent.inputType - Web APIs
syntax var astring = inputevent.inputtype; value a domstring containing the type of input that was made.
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.
installChrome - Web APIs
url url is a string containing a full or relative url to download name name is displayed in the dialog, but is also used to *select* the theme somust match exactly the name in the internal manifest.rdf file.
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.
IntersectionObserver.IntersectionObserver() - Web APIs
rootmargin a string which specifies a set of offsets to add to the root's bounding_box when calculating intersections, effectively shrinking or growing the root for calculation purposes.
KeyboardEvent.altKey - Web APIs
syntax var altkeypressed = instanceofkeyboardevent.altkey return value boolean examples <html> <head> <title>altkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key keydown: " + string.fromcharcode(e.charcode) + "\n" + "charcode: " + e.charcode + "\n" + "alt key keydown: " + e.altkey + "\n" ); } </script> </head> <body onkeydown="showchar(event);"> <p> press any character key, with or without holding down the alt key.<br /> you can also use the shift key together with the alt key.
KeyboardEvent.charCode - Web APIs
example html <p>type anything into the input box below to log a <code>charcode</code>.</p> <input type="text" /> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.queryselector('#log'); input.addeventlistener('keypress', function(e) { log.innertext = `key pressed: ${string.fromcharcode(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode value of the key pressed is stored in either the keycode or charcode property, but never both.
KeyboardEvent.getModifierState() - Web APIs
the value must be one of the keyboardevent.key values which represent modifier keys, or the string "accel" .
KeyboardEvent.keyIdentifier - Web APIs
the deprecated keyboardevent.keyidentifier read-only property returns a "key identifier" string that can be used to determine what key was pressed.
KeyboardEvent.shiftKey - Web APIs
syntax var shiftkeypressed = instanceofkeyboardevent.shiftkey return value a boolean example <html> <head> <title>shiftkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key pressed: " + string.fromcharcode(e.charcode) + "\n" + "charcode: " + e.charcode + "\n" + "shift key pressed: " + e.shiftkey + "\n" + "alt key pressed: " + e.altkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without holding down the shift key.<br /> you can also use the shift key together with the alt key.</p> </body> </html> specifications spec...
KeyboardEvent.which - Web APIs
example <html> <head> <title>charcode/keycode/which example</title> <script type="text/javascript"> function showkeypress(evt) { alert("onkeypress handler: \n" + "keycode property: " + evt.keycode + "\n" + "which property: " + evt.which + "\n" + "charcode property: " + evt.charcode + "\n" + "character key pressed: " + string.fromcharcode(evt.charcode) + "\n" ); } function keydown(evt) { alert("onkeydown handler: \n" + "keycode property: " + evt.keycode + "\n" + "which property: " + evt.which + "\n" ); } </script> </head> <body onkeypress="showkeypress(event);" onkeydown="keydown(event);" > <p>please press any key.</p> </body> </html> specifications specification status ...
KeyboardLayoutMap.get() - Web APIs
example the following example demonstrates how to get the location- or layout-specific string associated with the key that corresponds to the 'w' key on an english qwerty keyboard.
LargestContentfulPaint - Web APIs
this property returns an empty string when there is no id.
Location: ancestorOrigins - Web APIs
the ancestororigins read-only property of the location interface is a static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
Location: assign() - Web APIs
WebAPILocationassign
syntax location.assign(url); parameters url is a domstring containing the url of the page to navigate to.
Location: replace() - Web APIs
WebAPILocationreplace
syntax object.replace(url); parameters url is a domstring containing the url of the page to navigate to.
Locks.name - Web APIs
WebAPILockname
syntax var name = lock.name value a domstring.
LockedFile.append() - Web APIs
WebAPILockedFileappend
it can be a string or an arraybuffer.
LockedFile.mode - Web APIs
WebAPILockedFilemode
syntax var mode = instanceoflockedfile.mode value a string, one of readonly or readwrite.
LockedFile.write() - Web APIs
WebAPILockedFilewrite
it can be a string or an arraybuffer.
LockedFile - Web APIs
lockedfile.readastext() allows to retrieve a part of the content of the file as a string.
MSManipulationEvent - Web APIs
example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; readonly inertiadestinationy: number; readonly laststate: number; initmsmanipulationevent(typearg: string, canbubblearg: boolean, cancelablearg: boolean, viewarg: window, detailarg: number, laststate: number, currentstate: number): void; readonly ms_manipulation_state_active: number; readonly ms_manipulation_state_cancelled: number; readonly ms_manipulation_state_committed: number; readonly ms_manipulation_state_dragging: number; readonly ms_manipulation_state_inertia: number; ...
MSSiteModeEvent - Web APIs
example interface mssitemodeevent extends event { buttonid: number; actionurl: string; } declare var mssitemodeevent: { prototype: mssitemodeevent; new(): mssitemodeevent; } see also microsoft api extensions ...
MediaDeviceInfo.kind - Web APIs
syntax var kind = mediadeviceinfo.kind value a domstring.
MediaDevices.getUserMedia() - Web APIs
the error is an object of type overconstrainederror, and has a constraint property whose string value is the name of a constraint which was impossible to meet, and a message property containing a human-readable string explaining the problem.
MediaError.code - Web APIs
WebAPIMediaErrorcode
to get a text string with specific diagnostic information, see mediaerror.message.
MediaKeyMessageEvent() - Web APIs
syntax var mediakeymessageevent = new mediakeymessageevent(typearg, options) parameters typearg a domstring containing one of may be one of license-request, license-renewal, license-renewal, or individualization-request.
load() - Web APIs
}); parameter sessionid a unique string generated by the content decription module for the current media object and its associated keys or licenses.
sessionId - Web APIs
the mediakeysession.sessionid read-only property contains a unique string generated by the cdm for the current media object and its associated keys or licenses.
MediaKeySession - Web APIs
mediakeysession.sessionid read only contains a unique string generated by the cdm for the current media object and its associated keys or licenses.
keySystem - Web APIs
the mediakeysystemaccess.keysystem read-only property returns a domstring identifying the key system being used.
MediaKeySystemAccess - Web APIs
properties mediakeysystemaccess.keysystem read only returns a domstring identifying the key system being used.
initDataTypes - Web APIs
an initialization data type is a string indicating the format of the initialization data.
MediaKeySystemConfiguration - Web APIs
an initialization data type is a string indicating the format of the initialization data.
MediaMetadata.album - Web APIs
syntax var album = mediametadata.album mediametadata.album = album value a string containing the name of the album.
MediaMetadata.artist - Web APIs
syntax var artist = mediametadata.artist mediametadata.artist = artist value a string containing the name of the artist.
MediaMetadata.title - Web APIs
syntax var title = mediametadata.title mediametadata.title = title value a string containing the title of the media.
MediaQueryList - Web APIs
mediaread only a domstring representing a serialized media query.
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
the available properties are: media: a domstring representing a serialized media query.
MediaQueryListEvent - Web APIs
mediaquerylistevent.mediaread only a domstring representing a serialized media query.
MediaSession.playbackState - Web APIs
syntax let playbackstate = mediasession.playbackstate; mediasession.playbackstate = playbackstate; value a domstring indicating the current playback state of the media session.
MediaSessionActionDetails.action - Web APIs
syntax let mediasessionactiondetails = { action: actiontype }; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: nexttrack advances playback to the next track.
MediaSource.endOfStream() - Web APIs
syntax mediasource.endofstream(endofstreamerror); parameters endofstreamerror optional a domstring representing an error to throw when the end of the stream is reached.
MediaSource.readyState - Web APIs
syntax var myreadystate = mediasource.readystate; value a domstring.
MediaStream.id - Web APIs
WebAPIMediaStreamid
the mediastream.id() read-only property is a domstring containing 36 characters denoting a unique identifier (guid) for the object.
MediaStream - Web APIs
mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object.
MediaStreamAudioSourceNode - Web APIs
track ordering for the purposes of the mediastreamtrackaudiosourcenode interface, the order of the audio tracks on the stream is determined by taking the tracks whose kind is audio, then sorting the tracks by their id property's values, in unicode code point order (essentially, in alphabetical or lexicographical order, for ids which are simple alphanumeric strings).
MediaStreamConstraints - Web APIs
security peeridentity a domstring identifying the peer who has sole access to the stream.
MediaStreamEvent() - Web APIs
syntax var event = new mediastreamevent(type, mediastreameventinit); values type is a domstring containing the name of the event, like addstream or removestream.
MediaStreamEvent - Web APIs
it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the mediastream it refers to.
MediaStreamTrack.id - Web APIs
the mediastreamtrack.id read-only property returns a domstring containing a unique identifier (guid) for the track, which is generated by the user agent.
MediaStreamTrackEvent() - Web APIs
type a domstring representing the name of the type of the mediastreamtrackevent.
MediaTrackConstraints.logicalSurface - Web APIs
the mediatrackconstraints dictionary's logicalsurface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the logicalsurface constrainable property.
MediaTrackSettings.cursor - Web APIs
syntax cursorsetting = mediatracksettings.cursor; value the value of cursor comes from the cursorcaptureconstraint enumerated string type, and may have one of the following values: always the mouse should always be visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content.
MediaTrackSettings.displaySurface - Web APIs
syntax displaysurface = mediatracksettings.displaysurface; value the value of displaysurface is a string that comes from the displaycapturesurfacetype enumerated type, and is one of the following: application the stream's video track contains all of the windows belonging to the application chosen by the user.
Using the Media Capabilities API - Web APIs
a plain file or mediasource — and a videoconfiguration including values for the contenttype, width, height, bitrate, and framerate: the contenttype must be a string specifying a valid video mime type.
MouseEvent.initMouseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble, cancelable, view, detail, screenx, screeny, clientx, clienty, ctrlkey, altkey, shiftkey, metakey, button, relatedtarget); parameters type the string to set the event's type to.
MouseEvent.region - Web APIs
WebAPIMouseEventregion
syntax var hitregion = instanceofmouseevent.region return value a domstring representing the id of the hit region.
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...
msGraphicsTrustStatus - Web APIs
msaudiodevicetype: string; readonly msgraphicstruststatus: msgraphicstrust; ...
msPlayToPreferredSourceUri - Web APIs
a forward slash ("/") is appended to the uri string when it is sent over the network to a playto device.
msPlayToPrimary - Web APIs
example // microsoft extensions interface htmlimageelement : htmlelement { attribute boolean msplaytodisabled; attribute boolean msplaytoprimary; attribute domstring msplaytopreferredsourceuri; }; see also htmlmediaelement ...
MutationObserverInit.characterDataOldValue - Web APIs
syntax var options = { characterdataoldvalue: true | false } value a boolean value indicating whether or not to set the mutationrecord's oldvalue property to be a string containing the value of the character node's contents prior to the change represented by the mutation record.
NDEFReadingEvent - Web APIs
ndefreadingevent.serialnumber read only represents the serial number of the device used for anti-collision and identification, or empty string in case none is available.
NDEFWriter.write() - Web APIs
WebAPINDEFWriterwrite
syntax var sessionpromise = ndefwriter.write(message, options); parameters message the message to be written, either domstring or buffersource or ndefmessageinit.
Navigator.buildID - Web APIs
WebAPINavigatorbuildID
syntax buildid = navigator.buildid; value a string representing the build identifier of the application.
Navigator.clipboard - Web APIs
this happens because readtext() returns an empty string if the clipboard is empty or doesn't contain text.
Navigator.mozIsLocallyAvailable() - Web APIs
syntax navigator.mozislocallyavailable(uri, ifoffline); parameters uri the uri of the resource whose availability is to be checked, as a string.
Navigator.msLaunchUri() - Web APIs
syntax navigator.mslaunchuri(uri, successcallback, nohandlercallback); parameters uri a domstring specifying the url containing including the protocol of the document or resource to be displayed.
Navigator.productSub - Web APIs
syntax prodsub = window.navigator.productsub prodsub is a string.
Web-based protocol handlers - Web APIs
so, using the above examples, the browser would perform a get on this url: http://www.google.co.uk/?uri=web+burger:cheeseburger server side code can extract the query string parameters and perform the desired action.
Navigator.sendBeacon() - Web APIs
data a arraybuffer, arraybufferview, blob, domstring, formdata, or urlsearchparams object containing the data to send.
NavigatorID.appCodeName - Web APIs
syntax codename = navigator.appcodename value the string "mozilla".
NavigatorID.appName - Web APIs
syntax appname = navigator.appname value the string "netscape".
NavigatorID.product - Web APIs
syntax productname = navigator.product value the string "gecko".
NavigatorLanguage.languages - Web APIs
the navigatorlanguage.languages read-only property returns an array of domstrings representing the user's preferred languages.
NetworkInformation.effectiveType - Web APIs
syntax var effectivetype = networkinformation.effectivetype value a string containing one of 'slow-2g', '2g', '3g', or '4g'.
Node.appendChild() - Web APIs
WebAPINodeappendChild
the parentnode.append() method supports multiple arguments and appending strings.
Node.baseURI - Web APIs
WebAPINodebaseURI
syntax var nodebaseuri = node.baseuri; value a domstring representing the base url of the specified node.
Node.baseURIObject - Web APIs
it's similar to node.baseuri, except it returns an nsiuri instead of a string.
Node.childNodes - Web APIs
WebAPINodechildNodes
adding or removing children will change the list's `length` } } remove all children from a node // this is one way to remove all children from a node // box is an object reference to an element while (box.firstchild) { //the list is live so it will re-index each call box.removechild(box.firstchild); } notes the items in the collection of nodes are objects, not strings.
Node.insertBefore() - Web APIs
WebAPINodeinsertBefore
) let sp2 = document.getelementbyid("childelement") parentdiv.insertbefore(newnode, sp2) // end test case [ 1 ] // begin test case [ 2 ] : childelement is of type undefined let sp2 = undefined // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // implicit dynamic cast to type node // end test case [ 2 ] // begin test case [ 3 ] : childelement is of type "undefined" ( string ) let sp2 = "undefined" // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // generates "type error: invalid argument" // end test case [ 3 ] </script> example 2 <div id="parentelement"> <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 = docu...
Node.isDefaultNamespace() - Web APIs
syntax result = node.isdefaultnamespace(namespaceuri); parameters namespaceuri is a string representing the namespace against which the element will be checked.
Node.localName - Web APIs
WebAPINodelocalName
syntax name = element.localname name is the local name as a string (see notes below for details) example (must be served with xml content type, such as text/xml or application/xhtml+xml.) <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <script type="application/javascript"><![cdata[ function test() { var text = document.getelementbyid('text'); var circle = document.getelementbyid('circle'); text.value = "<svg:circle> has:\n" + "localname = '" + circle.localname + "'\n" + "namespaceuri = '" + circle.namespa...
Node.lookupNamespaceURI() - Web APIs
return value a domstring containing the the namespace uri.
Node.lookupPrefix() - Web APIs
WebAPINodelookupPrefix
the node.lookupprefix() method returns a domstring containing the prefix for a given namespace uri, if present, and null if not.
Node.nodeValue - Web APIs
WebAPINodenodeValue
syntax str = node.nodevalue; node.nodevalue = str; value str is a string containing the value of the current node, if any.
Node.prefix - Web APIs
WebAPINodeprefix
syntax string = node.prefix examples the following logs "x" to the console.
NodeList.length - Web APIs
WebAPINodeListlength
// all the paragraphs in the document var items = document.getelementsbytagname("p"); // for each item in the list, // append the entire element as a string of html var gross = ""; for (var i = 0; i < items.length; i++) { gross += items[i].innerhtml; } // gross is now all the html for the paragraphs specifications specification status comment domthe definition of 'nodelist: length' in that specification.
Notification.badge - Web APIs
syntax var url = notification.badge value a usvstring containing a url.
Notification.dir - Web APIs
WebAPINotificationdir
syntax var direction = notification.dir; value a domstring specifying the text direction.
Notification.icon - Web APIs
WebAPINotificationicon
syntax var icon = notification.icon; value a usvstring.
Notification.image - Web APIs
syntax var image = notification.image; value a usvstring.
Notification.permission - Web APIs
syntax var permission = notification.permission; value a domstring representing the current permission.
Notification.tag - Web APIs
WebAPINotificationtag
syntax var tag = notification.tag; value a domstring.
Notification.title - Web APIs
syntax var title = notification.title; value a domstring.
NotificationAction - Web APIs
notificationaction.title read only the string describing the action that is displayed to the user.
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
syntax var offlineaudiocompletionevent = new offlineaudiocompletionevent(type, init) parameters type optional a domstring representing the type of object to create.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters options optional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
OscillatorNode.type - Web APIs
syntax oscillatornode.type = type; value a domstring specifying the shape of oscillator wave.
OscillatorNode - Web APIs
oscillatornode.type a string which specifies the shape of waveform to play; this can be one of a number of standard values, or custom to use a periodicwave to describe a custom waveform.
OverconstrainedError.constraint - Web APIs
syntax var constraint = overconstrainederror.constraint; value a string specifications specification status comment media capture and streamsthe definition of 'constraint' in that specification.
OverconstrainedError.message - Web APIs
syntax var message = overconstrainederror.message; value a domstring.
OverconstrainedError.name - Web APIs
syntax var name = overconstrainederror.name; value a domstring.
Page Visibility API - Web APIs
document.visibilitystate read only a domstring indicating the document's current visibility state.
PaymentDetailsUpdate - Web APIs
error optional a domstring specifying an error message to present to the user.
PaymentItem - Web APIs
label secure context a string specifying a human-readable name or description of the item or service being charged for.
PaymentRequest.prototype.id - Web APIs
WebAPIPaymentRequestid
const response = await request.show(); console.log(response.requestid === request.id); // and in serialized form too const json = response.tojson(); console.log(json.requestid,response.requestid, request.id); syntax var id = paymentrequest.id value a domstring.
PaymentRequest: shippingoptionchange event - Web APIs
the string identifying the currently-selected shipping option can be found in the shippingoption property.
PaymentRequestEvent() - Web APIs
options optional options are as follows: instrumentkey: a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentRequestEvent.instrumentKey - Web APIs
the instrumentkey read-only property of the paymentrequestevent interface returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
paymentRequestId - Web APIs
syntax var id = paymentrequestevent.paymentrequestid value a domstring contains the id.
PaymentRequestEvent.paymentRequestOrigin - Web APIs
syntax var ausvstring = paymentrequestevent.paymentrequestorigin value a usvstring.
PaymentRequestEvent.topOrigin - Web APIs
syntax var ausvstring = paymentrequestevent.toporigin value a usvstring specifications specification status comment payment handler apithe definition of 'toporigin' in that specification.
PaymentRequestEvent - Web APIs
properties instrumentkeyread only returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentRequestUpdateEvent.updateWith() - Web APIs
error optional a domstring specifying an error message to present to the user.
PaymentResponse.details - Web APIs
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.
PaymentRequest.payerName - Web APIs
syntax var payername = paymentresponse.payername; value a string containing the payer name.
PaymentResponse.requestId - Web APIs
syntax var id = paymentrequest.id value a domstring.
Payment processing concepts - Web APIs
payment method identifiers payment handlers are identified by payment method identifiers, which are strings uniquely identifying the payment handler.
performance.clearMarks() - Web APIs
syntax performance.clearmarks(); performance.clearmarks(name); arguments name optional a domstring representing the name of the timestamp.
performance.clearMeasures() - Web APIs
syntax performance.clearmeasures(); performance.clearmeasures(name); arguments name optional a domstring representing the name of the timestamp.
performance.mark() - Web APIs
WebAPIPerformancemark
syntax performance.mark(name); arguments name a domstring representing the name of the mark.
performance.toJSON() - Web APIs
example var js; js = window.performance.tojson(); console.log("json = " + json.stringify(js)); specifications specification status comment high resolution time level 2the definition of 'tojson() serializer' in that specification.
PerformanceEntry.duration - Web APIs
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.startTime - Web APIs
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.
PerformanceEntry.toJSON() - Web APIs
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 'tojson' in that specification.
PerformanceEntry - Web APIs
performanceentry.entrytype read only a domstring representing the type of performance metric such as, for example, "mark".
PerformanceEventTiming - Web APIs
function sendtoanalytics(data) { const body = json.stringify(data); // use `navigator.sendbeacon()` if available, falling back to `fetch()`.
PerformanceNavigationTiming.toJSON() - Web APIs
example // get a resource performance entry var perfentries = performance.getentriesbytype("navigation"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("performancenavigationtiming.tojson() = " + s); specifications specification status comment navigation timing level 2the definition of 'tojson()' in that specification.
PerformanceResourceTiming.toJSON() - Web APIs
example // get a resource performance entry var perfentries = performance.getentriesbytype("resource"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("performanceentry.tojson = " + s); specifications specification status comment resource timing level 2the definition of 'tojson' in that specification.
PerformanceServerTiming.description - Web APIs
the description read-only property returns a domstring value of the server-specified metric description, or an empty string.
PerformanceServerTiming.name - Web APIs
the name read-only property returns a domstring value of the server-specified metric name.
Using the Performance API - Web APIs
function print_json() { var json; var o = document.getelementsbytagname("output")[0]; if (window.performance.tojson === undefined) { json = "window.performance.tojson() is not supported"; o.innerhtml += json + "<br>"; } else { var s; json = window.performance.tojson(); // print the performance object s = json.stringify(json); o.innerhtml = "<p>performance = " + s + "</p>"; // print the performance.timing and performance.navigation objects var perf = json.parse(s); var timing = perf.timing; o.innerhtml += "<p>peformance.timing = " + json.stringify(timing) + "</p>"; var navigation = perf.navigation; o.innerhtml += "<p>peformance.navigation = " + json.stringify(navigation) + "</p>...
Using Performance Timeline - Web APIs
// create a few performance entries performance.mark("mark-1"); performance.mark("mark-2"); performance.measure("meas-1", "mark-1", "mark-2"); var pelist = performance.getentries(); var pe = pelist[0]; if (pe.tojson === undefined) { log ("performanceentry.tojson() is not supported"); return; } // print the performanceentry object var json = pe.tojson(); var s = json.stringify(json); log("performanceentry.tojson = " + s); } performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified at the time, the observer was created.
Plugin - Web APIs
WebAPIPlugin
plugin.version read only the plugin's version number string.
PluginArray - Web APIs
var pluginslength = navigator.plugins.length; document.write( pluginslength.tostring() + " plugin(s)<br>" + "name | filename | description<br>" ); for(var i = 0; i < pluginslength; i++) { document.write( navigator.plugins[i].name + " | " + navigator.plugins[i].filename + " | " + navigator.plugins[i].description + " | " + navigator.plugins[i].version + "<br>" ); } specifications specification status comment html ...
PopStateEvent - Web APIs
the popstate event as an example, a page at http://example.com/example.html running the following code will generate alerts as indicated: window.onpopstate = function(event) { alert("location: " + document.location + ", state: " + json.stringify(event.state)); }; history.pushstate({page: 1}, "title 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // alerts "location: http://example.com/example.html, state: null history.go(2); // alerts "location: htt...
ProcessingInstruction - Web APIs
" target="_top"><rect x="436" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="541" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">processinginstruction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties target (domstring) read only a name identifying the application to which the instruction is targeted, specification specification status comment domthe definition of 'processinginstruction' in that specification.
ProgressEvent() - Web APIs
type is a domstring representing the name of the type of the progressevent.
ProgressEvent.initProgressEvent() - Web APIs
do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.initprogressevent(typearg, canbubblearg, cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred.
PublicKeyCredentialCreationOptions.extensions - Web APIs
if true, the client outputs an array of strings containing the extensions which are supported by the authenticator.
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
syntax pubkeycredparams = publickeycredentialcreationoptions.pubkeycredparams value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
PublicKeyCredentialCreationOptions - Web APIs
publickeycredentialcreationoptions.attestation optional a string which indicates how the attestation (for the authenticator's origin) should be transported.
PushEvent.PushEvent() - Web APIs
syntax var mypushevent = new pushevent(type, eventinitdict); parameters type a domstring defining the type of pushevent.
PushManager.registrations() - Web APIs
pushregistration those objects are anonymous javascript objects with the following properties: pushendpoint a string representing the url of the endpoint.
PushManager.subscribe() - Web APIs
applicationserverkey: a base64-encoded domstring or arraybuffer containing an ecdsa p-256 public key that the push server will use to authenticate your application server.
PushManager.supportedContentEncodings - Web APIs
syntax var encodings[] = pushmanager.supportedcontentencodings value an array of strings.
PushMessageData - Web APIs
pushmessagedata.text() extracts the data as a plain text string.
PushSubscription.getKey() - Web APIs
syntax ​var key = subscription.getkey(name); parameters name a domstring representing the encryption method used to generate a client key.
PushSubscription.subscriptionId - Web APIs
the endpoint read-only property of the pushsubscription interface returns a domstring containing the subscription id associated with the push subscription.
RTCConfiguration.iceServers - Web APIs
each object must at least have an urls property, which is an array of one or more strings, each providing one server's url.
RTCDTMFSender: tonechange event - Web APIs
examples this example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>".
RTCDataChannel.bufferedAmount - Web APIs
example the snippet below includes a function which changes the contents of a block with the id "buffersize" to a string indicating the number of bytes currently buffered on an rtcdatachannel.
RTCDataChannelEvent() - Web APIs
syntax var event = new rtcdatachannelevent(type, rtcdatachanneleventinit); parameters type a domstring which specifies the name of the event.
RTCDtlsTransport.state - Web APIs
syntax let mystate = dtlstransport.state; value a string whose value is taken from the rtcdtlstransportstate enumerated type.
RTCIceCandidate.sdpMLineIndex - Web APIs
if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of sdpmlineindex is extracted from the m-line.
RTCIceCandidate.tcpType - Web APIs
syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type.
RTCIceCandidate.type - Web APIs
syntax var type = rtcicecandidate.type; value a domstring whose value is one of those defined by the rtcicecandidatetype enumerated type.
RTCIceCandidateInit.sdpMid - Web APIs
value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate.
RTCIceCandidatePairStats.state - Web APIs
syntax state = rtcicecandidatepairstats.state; value a domstring whose value is one of those found in the rtcstatsicecandidatepairstate enumerated type.
RTCIceCandidatePairStats.transportId - Web APIs
syntax transportid = rtcicecandidatepairstats.transportid; value a domstring which uniquely identifies the rtcicetransport object from which the transport-related data was obtained for the statistics contained in this rtcicecandidatepairstats object.
RTCIceCandidateStats.protocol - Web APIs
syntax protocol = rtcicecandidatestats.protocol; value the value is one of the members of the rtciceprotocol enumerated string type: tcp the candidate, if selected, would use tcp as the transport protocol for its data.
RTCIceCandidateStats.relayProtocol - Web APIs
syntax relayprotocol = rtcicecandidatestats.relayprotocol; value a domstring identifying the protocol being used by the endpoint to communicate with the turn server.
RTCIceCandidateStats.url - Web APIs
syntax url = rtcicecandidatestats.url; value a domstring specifying the url of the ice server from which the candidate described by the rtcicecandidatestats was obtained.
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.
RTCIceGathererState - Web APIs
the rtcicegathererstate enumerated type provides the string values which can be returned by an rtcicetransport object's gatheringstate.
RTCIceParameters.password - Web APIs
syntax password = rtciceparameters.password; value a domstring containing the password that corresponds to the transport's usernamefragment string specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceparameters.password' in that specification.
RTCIceRole - Web APIs
the rtcicerole enumerated type lists the string values that identify whether a connection's ice agent is serving as the controlling agent or the controlled agent, as indicated by rtcicetransport.role.
RTCIceServer.credential - Web APIs
the rtciceserver dictionary's credential property is a string providing the credential to use when connecting to the described server.
RTCIceServer.url - Web APIs
WebAPIRTCIceServerurl
}; var serverurl = iceserver.url; iceserver.url = iceserverurl; the value of this property is a domstring containing the full url of a server to use during ice negotiation.
RTCIceServer.username - Web APIs
the rtciceserver dictionary's username property is a string which specifies the username to use when authenticating with the ice server being described.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetcpcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates.
RTCIceTransport.role - Web APIs
syntax icerole = rtcicetransport.role; value a domstring specifying whether the rtcicetransport represents the controlling agent or the controlled agent.
RTCIceTransport.state - Web APIs
syntax icestate = icetransport.state; value a domstring, whose value is one of those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway.
RTCIceTransportState - Web APIs
the rtcicetransportstate enumerated type defines the string values which may be returned by the state property on rtcicetransport objects.
RTCIdentityErrorEvent.idp - Web APIs
the read-only property rtcidentityerrorevent.idp returns the domstring describing the domain name of the identity provider (idp) generating the error response event.
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentityerrorevent.loginurl is a domstring giving the url where the user can complete the authentication.
RTCIdentityErrorEvent.protocol - Web APIs
the read-only property rtcidentityerrorevent.protocol is a domstring describing the idp protocol in use.
RTCIdentityEvent.assertion - Web APIs
the read-only property rtcidentityevent.assertion returns the domstring containing a blob being the coded assertion associated with the event.
RTCIdentityEvent - Web APIs
rtcidentityevent.assertion read only returns the domstring containing a blob being the assertion generated.
RTCInboundRtpStreamStats.receiverId - Web APIs
syntax var receiverstatsid = rtcinboundrtpstreamstats.receiverid; value a domstring which contains the id of the rtcaudioreceiverstats or rtcvideoreceiverstats object which provides information about the rtcrtpreceiver which is receiving the streamed media.
RTCInboundRtpStreamStats.remoteId - Web APIs
syntax var remotestatsid = rtcinboundrtpstreamstats.remoteid; value a domstring containing the id of the rtcremoteoutboundrtpstreamstats object that represents the remote peer's rtcrtpsender for the synchronization source represented by this stats object.
RTCInboundRtpStreamStats.trackId - Web APIs
syntax var trackstatsid = rtcinboundrtpstreamstats.trackid; value a domstring containing the id of the rtcreceiveraudiotrackattachmentstats or rtcreceivervideotrackattachmentstats object representing the track which is receiving the media from this rtp session.
RTCNetworkType - Web APIs
the webrtc rtcnetworktype enumerated type defines a set of strings used to identify the type of network used by a connection between two peers.
RTCOutboundRtpStreamStats.remoteId - Web APIs
syntax var remotestatsid = rtcoutboundrtpstreamstats.remoteid; value a domstring containing the id of the rtcremoteinboundrtpstreamstats object that represents the remote peer's rtcrtpreceiver for the synchronization source represented by this stats object.
RTCOutboundRtpStreamStats.trackId - Web APIs
syntax var trackstatsid = rtcoutboundrtpstreamstats.trackid; value a domstring containing the id of the rtcsenderaudiotrackattachmentstats or rtcsendervideotrackattachmentstats object representing the track which is the source of the media being sent on this stream.
RTCPeerConnection() - Web APIs
peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection.
RTCPeerConnection: connectionstatechange event - Web APIs
the new connection state can be found in connectionstate, and is one of the strings in the rtcpeerconnectionstate enumerated type.
RTCPeerConnection.generateCertificate() - Web APIs
syntax var cert = rtcpeerconnection.generatecertificate(keygenalgorithm) parameters keygenalgorithm a domstring identifying the algorithm to use in creating the key.
RTCPeerConnection.getStreamById() - Web APIs
syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return.
RTCPeerConnection.iceGatheringState - Web APIs
rtcicegatheringstate enum the rtcicegatheringstate enum defines string constants which reflect the current status of ice gathering, as returned using the rtcpeerconnection.icegatheringstate property.
RTCPeerConnection.peerIdentity - Web APIs
the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.
RTCPeerConnection.signalingState - Web APIs
the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer.
RTCPeerConnectionIceEvent() - Web APIs
syntax var event = new rtcpeerconnectioniceevent(type, options); parameters type is a domstring containing the name of the event, like "icecandidate".
RTCPeerConnectionIceEvent - Web APIs
it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the rtcicecandidate it refers to.
RTCRemoteOutboundRtpStreamStats - Web APIs
localid a domstring which is used to find the local rtcinboundrtpstreamstats object which shares the same synchronization source (ssrc).
RTCRtpReceiver.getCapabilities() static function - Web APIs
syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive.
RTCRtpSender.getCapabilities() static function - Web APIs
syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive.
RTCRtpTransceiver.mid - Web APIs
syntax var mediaid = rtcrtptransceiver.mid; value a domstring which uniquely identifies the pairing of source and destination of the transceiver's stream.
RTCSctpTransport.state - Web APIs
syntax var mystate = sctptransport.state; value a string whose value is taken from the rtcsctptransportstate enumerated type.
RTCSctpTransport - Web APIs
rtcsctptransport.stateread only a domstring enumerated value indicating the state of the sctp transport.
RTCStatsIceCandidatePairState - Web APIs
the rtcstatsicecandidatepairstate enumerated type represents the set of string values which are possible for the rtcicecandidatepairstats object's state property.
RTCStatsType - Web APIs
the rtcstatstype enumerated type (enum) is a set of strings which define the type of statistics reported in a record found in the rtcstatsreport object.
Range.commonAncestorContainer - Web APIs
html <ul> <li>strings <ul> <li>cello</li> <li>violin <ul> <li>first chair</li> <li>second chair</li> </ul> </li> </ul> </li> <li>woodwinds <ul> <li>clarinet</li> <li>oboe</li> </ul> </li> </ul> css the .highlight class created below uses a set of css @keyframes to animate a fading outline.
ReadableStream.getReader() - Web APIs
syntax var reader = readablestream.getreader({mode}); parameters {mode} optional an object containing a property mode, which takes as its value a domstring specifying the type of reader to create.
ReadableStream.pipeThrough() - Web APIs
for example, a textdecoder, has bytes written to it and strings read from it, while a video decoder has encoded bytes written to it and uncompressed video frames read from it.
ReadableStreamBYOBReader.cancel() - Web APIs
syntax var promise = readablestreambyobreader.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation.
ReadableStreamDefaultReader.cancel() - Web APIs
syntax var promise = readablestreamdefaultreader.cancel(reason); parameters reason optional a domstring providing a human-readable reason for the cancellation.
Report.type - Web APIs
WebAPIReporttype
syntax let reporttype = reportinstance.type returns a string representing the type of the report.
Report.url - Web APIs
WebAPIReporturl
syntax let reporturl = reportinstance.url returns a string representing the url of the document that generated the report.
ReportingObserver() - Web APIs
the available options are: types: an array of strings representing the types of report to be collected by this observer.
ReportingObserverOptions - Web APIs
properties types an array of strings representing the types of report to be collected by this observer.
Request.context - Web APIs
WebAPIRequestcontext
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 request context in a variable: var myrequest = new request('flowers.jpg'); var mycontext = myrequest.context; // returns the empty string by default ...
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.
Request.redirect - Web APIs
WebAPIRequestredirect
syntax var myredirect = request.redirect; value a requestredirect enum value, which can be one the following strings: follow error manual if not specified when the request is created, it takes the default value of follow.
Request.referrerPolicy - Web APIs
syntax var myreferrerpolicy = request.referrerpolicy; value a domstring representing the request's referrerpolicy.
Request.url - Web APIs
WebAPIRequesturl
syntax var myurl = request.url; value a usvstring indicating the url of the request.
RequestDestination - Web APIs
these string values indicate potential types of content that a request may try to retrieve.
Response.statusText - Web APIs
syntax var mystatustext = response.statustext; value a bytestring.
Response.type - Web APIs
WebAPIResponsetype
syntax var mytype = response.type; value a responsetype string indicating the type of the response.
Response.url - Web APIs
WebAPIResponseurl
syntax var myurl = response.url; value a usvstring.
Response - Web APIs
WebAPIResponse
it returns a promise that resolves with a usvstring (text).
RsaOaepParams - Web APIs
properties name a domstring.
RsaPssParams - Web APIs
properties name a domstring.
SVGEllipseElement - Web APIs
g content <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="100" cy="100" rx="100" ry="60" id="ellipse" onclick="outputsize();"/> </svg> javascript content function outputsize() { var ellipse = document.getelementbyid("ellipse"); // outputs "horizontal radius: 100 vertical radius: 60" console.log( 'horizontal radius: ' + ellipse.rx.baseval.valueasstring, 'vertical radius: ' + ellipse.ry.baseval.valueasstring ) } result specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgellipseelement' in that specification.
SVGEvent - Web APIs
WebAPISVGEvent
type read only domstring the type of event.
SVGFEColorMatrixElement - Web APIs
svgfecolormatrixelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEComponentTransferElement - Web APIs
svgfecomponenttransferelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFECompositeElement - Web APIs
svgfecompositeelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEConvolveMatrixElement - Web APIs
svgfeconvolvematrixelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEDiffuseLightingElement - Web APIs
svgfediffuselightingelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEDropShadowElement - Web APIs
svgfedropshadowelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEGaussianBlurElement - Web APIs
svgfegaussianblurelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEImageElement - Web APIs
svgfeimageelement.crossorigin read only an svganimatedstring reflects the crossorigin attribute of the given element, limited to only known values.
SVGFEMergeNodeElement - Web APIs
svgfemergenodeelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEMorphologyElement - Web APIs
svgfemorphologyelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFEOffsetElement - Web APIs
svgfeoffsetelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFESpecularLightingElement - Web APIs
svgfespecularlightingelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFETileElement - Web APIs
svgfetileelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
SVGFilterPrimitiveStandardAttributes - Web APIs
svgfilterprimitivestandardattributes.result read only an svganimatedstring corresponding to the result attribute of the given element.
SVGGraphicsElement: copy event - Web APIs
" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
SVGImageElement.decoding - Web APIs
syntax var refstr = svgimageelement.decoding svgimageelement.decoding = refstr; values a domstring representing the decoding hint.
The 'X' property - Web APIs
its syntax is the same as that for <length> // rect draws a rectangle with upper left-hand corner at x,y, with width w, and height h, with optional style // standard reference: http://www.w3.org/tr/svg11/shapes.html#rectelement func (svg *svg) rect(x float64, y float64, w float64, h float64, s ...string) { svg.printf(`<rect %s %s`, dim(x, y, w, h, svg.decimals), endstyle(s, emptyclose)) } ​ ...
SVGSVGElement - Web APIs
svgsvgelement.deselectall() unselects any selected objects, including any selections of text strings and type-in bars.
Screen.orientation - Web APIs
note that older, prefixed versions returned a domstring equivalent to screenorientation.type.
Screen - Web APIs
WebAPIScreen
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom) view modulethe definition of 'screen' in that specification.
ScreenOrientation.type - Web APIs
syntax type = screenorientation.type value a string.
Using the Screen Capture API - Web APIs
function dumpoptionsinfo() { const videotrack = videoelem.srcobject.getvideotracks()[0]; console.info("track settings:"); console.info(json.stringify(videotrack.getsettings(), null, 2)); console.info("track constraints:"); console.info(json.stringify(videotrack.getconstraints(), null, 2)); } the track list is obtained by calling getvideotracks() on the capture'd screen's mediastream.
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
syntax let spvevt = new securitypolicyviolationevent(type, eventinitdict); properties type a domstring representing the type of security policy violation that occurred.
Selection.setBaseAndExtent() - Web APIs
two'); var aoffset = document.getelementbyid('aoffset'); var foffset = document.getelementbyid('foffset'); var button = document.queryselector('button'); var output = document.queryselector('.output'); var selection; button.onclick = function() { try { selection = document.getselection(); selection.setbaseandextent(one, aoffset.value, two, foffset.value); var text = selection.tostring(); output.textcontent = text; } catch(e) { output.textcontent = e.message; } } play with the live example below, setting different offset values to see how this affects the selection.
ServiceWorker.scriptURL - Web APIs
syntax someurl = serviceworker.scripturl value a usvstring (see the webidl definition of usvstring.) examples tbd specifications specification status comment service workersthe definition of 'scripturl' in that specification.
ServiceWorker.state - Web APIs
the state read-only property of the serviceworker interface returns a string representing the current state of the service worker.
ServiceWorkerContainer.register() - Web APIs
currently available options are: scope: a usvstring representing a url that defines a service worker's registration scope; that is, what range of urls a service worker can control.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
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.
ServiceWorkerMessageEvent.lastEventId - Web APIs
syntax var mylasteventid = serviceworkermessageeventinstance.lasteventid; value a domstring.
ServiceWorkerMessageEvent.origin - Web APIs
syntax var myorigin = serviceworkermessageeventinstance.origin; value a domstring.
ServiceWorkerRegistration.getNotifications() - Web APIs
the available options are: tag: a domstring representing a notification tag.
Using Service Workers - Web APIs
in this case, we are just returning a simple text string: new response('hello from your friendly neighbourhood service worker!'); this more complex response below shows that you can optionally pass a set of headers in with your response, emulating standard http response headers.
Service Worker API - Web APIs
it provides a master directory of all the named caches that a serviceworker can access, and maintains a mapping of string names to corresponding cache objects.
ShadowRoot.innerHTML - Web APIs
syntax var domstring = shadowroot.innerhtml shadowroot.innerhtml = domstring value a domstring.
SharedWorkerGlobalScope.name - Web APIs
syntax var nameobj = self.name; value a domstring.
SharedWorkerGlobalScope.onconnect - Web APIs
as of version 65 it is now initialized to an empty string, as per spec (bug 1508824).
SourceBuffer.mode - Web APIs
WebAPISourceBuffermode
syntax var mymode = sourcebuffer.mode; sourcebuffer.mode = 'sequence'; value a domstring.
SpeechGrammar.SpeechGrammar() - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var newgrammar = new speechgrammar(); newgrammar.src = '#jsgf v1.0; grammar names; public <name> = chris | kirsty | mike;' speechrecognitionlist[1] = newgrammar; // should add the new speechgrammar object to the list specifications specification status comment web speech apithe definition of 'speechgrammar()' i...
SpeechGrammar.weight - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechGrammarList.item() - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var myfirstgrammar = speechrecognitionlist[0]; // var should contain the speechgrammar object created in line 4.
SpeechGrammarList.length - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; speechrecognitionlist.length; // should return 1.
SpeechRecognition() - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.abort() - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = ...
SpeechRecognition.continuous - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.grammars - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.interimResults - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.maxAlternatives - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.serviceURI - Web APIs
syntax var myserviceuri = myspeechrecognition.serviceuri; myspeechrecognition.serviceuri = 'path/to/my/service/'; value a domstring representing the uri of the speech recognition service.
SpeechRecognition.start() - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = ...
SpeechRecognition.stop() - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = ...
SpeechRecognition - Web APIs
od | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } r...
SpeechRecognitionAlternative - Web APIs
properties speechrecognitionalternative.transcript read only returns a string containing the transcript of the recognised word.
SpeechRecognitionError.error - Web APIs
syntax var myerror = event.error; value a domstring naming the type of error.
SpeechRecognitionError.message - Web APIs
syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised.
SpeechRecognitionErrorEvent.error - Web APIs
syntax var myerror = event.error; value a domstring naming the type of error.
SpeechRecognitionErrorEvent.message - Web APIs
syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised.
SpeechSynthesisErrorEvent.error - Web APIs
syntax myerror = event.error; value a domstring containing an error code.
SpeechSynthesisEvent.name - Web APIs
syntax event.name; value a domstring.
SpeechSynthesisUtterance.SpeechSynthesisUtterance() - Web APIs
syntax var utterthis = new speechsynthesisutterance(text); parameters text a domstring containing the text that will be synthesized when the utterance is spoken..
SpeechSynthesisUtterance.lang - Web APIs
syntax var mylang = speechsynthesisutteranceinstance.lang; speechsynthesisutteranceinstance.lang = 'en-us'; value a domstring representing a bcp 47 language tag.
SpeechSynthesisUtterance.text - Web APIs
syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised.
SpeechSynthesisVoice.lang - Web APIs
syntax var mylang = speechsynthesisvoiceinstance.lang; value a domstring representing the language of the device.
SpeechSynthesisVoice.name - Web APIs
syntax var voicename = speechsynthesisvoiceinstance.name; value a domstring representing the name of the voice.
SpeechSynthesisVoice.voiceURI - Web APIs
syntax var myvoiceuri = speechsynthesisvoiceinstance.voiceuri; value a domstring representing the uri of the voice.
Storage.key() - Web APIs
WebAPIStoragekey
return value a domstring containing the name of the key.
Storage.removeItem() - Web APIs
syntax storage.removeitem(keyname); parameters keyname a domstring containing the name of the key you want to remove.
Streams API concepts - Web APIs
a simple example is a text decoder, where raw bytes are written, and then strings are read.
Using writable streams - Web APIs
the close() method is called automatically when writing has finished — it prints the entire decoded result to the ui in one string.
Stylesheet.href - Web APIs
WebAPIStyleSheethref
syntax uri = stylesheet.href parameters uri is a string containing the stylesheet's uri.
StyleSheet.media - Web APIs
WebAPIStyleSheetmedia
example <!doctype html> <html> <head> <link rel="stylesheet" href="document.css" type="text/css" media="screen" /> <style rel="stylesheet" type="text/css" media="screen, print"> body { background-color: snow; } </style> </head> <body> <script> for (var isheetindex = 0; isheetindex < document.stylesheets.length; isheetindex++) { console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheetindex].media)); if (isheetindex === 0) document.stylesheets[isheetindex].media.appendmedium('handheld'); if (isheetindex === 1) document.stylesheets[isheetindex].media.deletemedium('print'); console.log('document.stylesheets[' + string(isheetindex) + '].media: ' + json.stringify(document.stylesheets[isheeti...
StyleSheet.type - Web APIs
WebAPIStyleSheettype
syntax string = stylesheet.type example mystylesheet.type = 'text/css'; specifications specification status comment css object model (cssom)the definition of 'stylesheet: type' in that specification.
SubmitEvent() - Web APIs
syntax let submitevent = new submitevent(type,eventinitdict); parameters type a domstring indicating the event which occurred.
SubtleCrypto.deriveBits() - Web APIs
it takes as its arguments the base key, the derivation algorithm to use, and the length of the bit string to derive.
SyncManager.getTags() - Web APIs
}) returns a promise that resolves to an array of domstrings containing developer-defined identifiers for syncmanager registrations.
TaskAttributionTiming.containerId - Web APIs
syntax var containerid = taskattributiontiming.containerid; value a domstring containing the containers id attribute.
TaskAttributionTiming.containerName - Web APIs
syntax var containername = taskattributiontiming.containername; value a domstring containing the container's name attribute.
TaskAttributionTiming.containerSrc - Web APIs
syntax var containersrc = taskattributiontiming.containersrc; value a domstring containing the container's src attribute.
TaskAttributionTiming.containerType - Web APIs
syntax var containertype = taskattributiontiming.containertype; value a domstring containing the container's type, one of iframe, embed, or object.
Text() - Web APIs
WebAPITextText
the text() constructor returns a newly created text object with the optional domstring given in parameter as its textual content.
Text.replaceWholeText() - Web APIs
this method returns the text node which received the replacement text, or null if the replacement text is an empty string.
Text - Web APIs
WebAPIText
text.wholetext read only returns a domstring containing the text of all text nodes logically adjacent to this node, concatenated in document order.
TextDecoder() - Web APIs
syntax decoder = new textdecoder(utflabel, options); parameters utflabeloptional is a domstring, defaulting to "utf-8", containing the label of the encoder.
TextDecoder.prototype.encoding - Web APIs
the textdecoder.prototype.encoding read-only property returns a domstring containing the name of the decoding algorithm used by the specific decoder.
TextEncoder.encoding - Web APIs
the textencoder.encoding read-only property returns a domstring containing the name of the encoding algorithm used by the specific encoder.
TextRange - Web APIs
WebAPITextRange
textrange.querycommandvalue() returns the domstring indicating the current value of the specified command.
TextTrackList - Web APIs
gettrackbyid() returns the texttrack found within the texttracklist whose id matches the specified string.
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.
TouchEvent() - Web APIs
syntax event = new touchevent(typearg, toucheventinit); values typearg is a domstring representing the name of the event.
TrackDefault.kinds - Web APIs
syntax var mykinds = trackdefault.kinds; value an array of domstrings.
TrackDefault.label - Web APIs
syntax var mylabel = trackdefault.label; value a domstring.
TrackDefault.language - Web APIs
syntax var mylanguage = trackdefault.language; value a domstring.
TrackDefault.type - Web APIs
WebAPITrackDefaulttype
audio, video, or text track.) syntax var mytype = trackdefault.type; value a domstring — one of audio, video or text.
TransformStream - Web APIs
array(chunk.buffer, chunk.byteoffset, chunk.bytelength)) else if (array.isarray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.transform(json.stringify(chunk), controller) break case 'symbol': controller.error("cannot send a symbol as a chunk part") break case 'undefined': controller.error("cannot send undefined as a chunk part") default: controller.enqueue(this.textencoder.encode(string(chunk))) break }, flush() { /* do any destructor work here */ } } class anytou8stream ...
TransitionEvent.transitionName - Web APIs
the transitionevent.transitionname read-only property is a domstring containing the name of the css property associated with the transition.
UIEvent() - Web APIs
WebAPIUIEventUIEvent
syntax event = new uievent(typearg [, uieventinit]) values typearg is a domstring representing the name of the event.
UIEvent.initUIEvent() - Web APIs
syntax event.inituievent(type, canbubble, cancelable, view, detail) parameters type is a domstring defining the type of event.
UIEvent.isChar - Web APIs
WebAPIUIEventisChar
example in this snippet, which is part of an event handler, the event is checked to see if it generates a character; if it does, the value of uievent.which is appended to a string which buffers the typed characters.
URL.revokeObjectURL() - Web APIs
syntax url.revokeobjecturl(objecturl) parameters objecturl a domstring representing a object url that was previously created by calling createobjecturl().
URL.searchParams - Web APIs
WebAPIURLsearchParams
examples if the url of your page is https://example.com/?name=jonathan%20smith&age=18 you could parse out the name and age parameters using: let params = (new url(document.location)).searchparams; let name = params.get('name'); // is the string "jonathan smith".
URLSearchParams.delete() - Web APIs
params.delete('foo'); //query string is now: 'bar=2' specifications specification status comment urlthe definition of 'delete()' in that specification.
URLSearchParams.entries() - Web APIs
the key and value of each pair are usvstring objects.
URLSearchParams.getAll() - Web APIs
return value an array of usvstrings.
URLSearchParams.keys() - Web APIs
the keys are usvstring objects.
URLSearchParams.sort() - Web APIs
examples // create a test urlsearchparams object var searchparams = new urlsearchparams("c=4&a=2&b=3&a=1"); // sort the key/value pairs searchparams.sort(); // display the sorted query string console.log(searchparams.tostring()); the result is: a=2&a=1&b=3&c=4 specifications specification status comment urlthe definition of 'sort()' in that specification.
URLSearchParams.values() - Web APIs
the values are usvstring objects.
USBAlternateInterface - Web APIs
this is the value of the string descriptor with the index specified by the iinterface field of the interface descriptor defining this interface.
USBConfiguration.configurationName - Web APIs
this is equal to the value of the string descriptor with the index provided in the iconfiguration field of the configuration descriptor defining this configuration.
USBConfiguration - Web APIs
this is equal to the value of the string descriptor with the index provided in the iconfiguration field of the configuration descriptor defining this configuration.
USBDevice.manufacturerName - Web APIs
syntax var serialnumber = usbdevice.manufacturername value a domstring.
UserDataHandler - Web APIs
key (domstring) is the user key.
VTTCue() - Web APIs
WebAPIVTTCueVTTCue
text a domstring providing the text that will be shown during the time span indicated by starttime and endtime.
VTTRegion - Web APIs
WebAPIVTTRegion
properties vttregion.id a domstring that identifies the region.
validityState.badInput - Web APIs
for example, if you have a number input element whose content is a string.
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.
VideoPlaybackQuality.droppedVideoFrames - Web APIs
var videoelem = document.getelementbyid("my_vid"); var percentelem = document.getelementbyid("percent"); var quality = videoelem.getvideoplaybackquality(); var droppercent = (quality.droppedvideoframes/quality.totalvideoframes)*100; percentelem.innertext = math.trunc(droppercent).tostring(10); specifications specification status comment media playback qualitythe definition of 'videoplaybackquality.droppedvideoframes' in that specification.
VideoTrackList - Web APIs
gettrackbyid() returns the videotrack found within the videotracklist whose id matches the specified string.
WEBGL_compressed_texture_astc - Web APIs
ext.getsupportedprofiles() returns an array of strings containing the names of the astc profiles supported by the implementation.
WakeLockSentinel - Web APIs
type read only returns a string representation of the currently acquired wakelocksentinel type.
WebGL2RenderingContext.getFragDataLocation() - Web APIs
name a domstring specifying the name of the user-defined varying out variable.
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
uniformname a domstring specifying the name of the uniform block to whose index to retrieve.
WebGL2RenderingContext.getUniformIndices() - Web APIs
uniformnames an array of domstring specifying the names of the uniforms to query.
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
varyings an array of domstring specifying the the names of the varying variables to use.
WebGLRenderingContext.bindAttribLocation() - Web APIs
name a domstring specifying the name of the variable to bind to the generic vertex index.
WebGLRenderingContext.getAttribLocation() - Web APIs
name a domstring specifying the name of the attribute variable whose location to get.
WebGLRenderingContext.getSupportedExtensions() - Web APIs
syntax gl.getsupportedextensions(); return value an array of strings with all the supported webgl extensions.
WebGLRenderingContext.shaderSource() - Web APIs
source a domstring containing the glsl source code to set.
WebGLShader - Web APIs
examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings.
A basic 2D WebGL animation example - Web APIs
note the use of a template literal string to insert the correct shader type string into the message that gets generated.
Getting started with WebGL - Web APIs
once we have the canvas, we try to get a webglrenderingcontext for it by calling getcontext() and passing it the string "webgl".
Using WebGL extensions - Web APIs
var available_extensions = gl.getsupportedextensions(); the webglrenderingcontext.getsupportedextensions() method returns an array of strings, one for each supported extension.
WebRTC connectivity - Web APIs
at the end of each generation of candidates, an end-of-candidates notification is sent in the form of an rtcicecandidate whose candidate property is an empty string.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdrequested() method, which accepts as input an sdp offer string.
WebSocket.binaryType - Web APIs
syntax var binarytype = awebsocket.binarytype; value a domstring: "blob" if blob objects are used.
WebSocket.url - Web APIs
WebAPIWebSocketurl
syntax var url = awebsocket.url; value a domstring.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
you can tell which eye a given xrview represents by checking the value of its eye property, which is a string whose value is left or right (a third possible value, none, theoretically may be used to represent another point of view, but support for this is not entirely available in the current api).
Geometry and reference spaces in WebXR - Web APIs
currently, the only supported options are strings identifying the standard reference spaces.
WebXR application life cycle - Web APIs
this is done by calling navigator.xr.requestsession(), again specifying the string indicating the mode you want to enable: inline, immersive-vr, or immersive-ar.
Movement, orientation, and motion: A WebXR example - Web APIs
function logglerror(where) { let err = gl.geterror(); if (err) { console.error(`webgl error returned by ${where}: ${err}`); } } this takes as its only input a string, where, which is used to indicate what part of the program generated the error, since similar errors can have in multiple situations.
Starting up and shutting down a WebXR session - Web APIs
this string specifies the type of webxr session you want to establish—in this case, a fully-immersive virtual reality experience.
Using the Web Animations API - Web APIs
for instance, web animations doesn't use the string "infinite", but instead uses the javascript keyword infinity.
Migrating from webkitAudioContext - Web APIs
here is some information on how you can get these values if you need them: the name attribute is a string representing the name of the audioparam object.
The structured clone algorithm - Web APIs
boolean objects string objects date regexp lastindex is not preserved.
WheelEvent() - Web APIs
syntax var wheelevent = new wheelevent(typearg, wheeleventinit); properties typearg is a domstring representing the name of the event.
Window.alert() - Web APIs
WebAPIWindowalert
syntax window.alert(message); parameters message optional a string you want to display in the alert dialog, or, alternatively, an object that is converted into a string and displayed.
Window.confirm() - Web APIs
WebAPIWindowconfirm
syntax result = window.confirm(message); parameters message a string you want to display in the alert dialog.
Window.defaultStatus - Web APIs
syntax var smsg = window.defaultstatus; window.defaultstatus = smsg; parameters smsg is a string containing the text to be displayed by default in the statusbar.
window.dump() - Web APIs
WebAPIWindowdump
syntax window.dump(message); dump(message); parameters message is the string message to log.
Window.getComputedStyle() - Web APIs
pseudoeltoptional a string specifying the pseudo-element to match.
Window.getDefaultComputedStyle() - Web APIs
pseudoelt optional a string specifying the pseudo-element to match.
Window.navigator - Web APIs
WebAPIWindownavigator
syntax navigatorobject = window.navigator examples example #1: browser detect and return a string var sbrowser, susrag = navigator.useragent; // the order matters here, and this may report false positives for unlisted browsers.
Window.showModalDialog() - Web APIs
options is an optional string specifying window ornamentation for the dialog, using one or more semicolon delimited values: syntax description center: {on | off | yes | no | 1 | 0 } if on, yes, or 1, the dialog window is centered on the desktop; otherwise it's hidden.
Window.status - Web APIs
WebAPIWindowstatus
syntax window.status = string; var value = window.status; specifications specification status comment html living standardthe definition of 'window.status' in that specification.
Window.updateCommands() - Web APIs
syntax window.updatecommands("scommandname") parameters scommandname is a particular string which describes what kind of update event this is (e.g.
WindowClient.visibilityState - Web APIs
syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values).
WindowEventHandlers.onpopstate - Web APIs
examples for example, a page at http://example.com/example.html running the following code will generate alerts as indicated: window.onpopstate = function(event) { alert("location: " + document.location + ", state: " + json.stringify(event.state)); }; history.pushstate({page: 1}, "title 1", "?page=1"); history.pushstate({page: 2}, "title 2", "?page=2"); history.replacestate({page: 3}, "title 3", "?page=3"); history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // alerts "location: http://example.com/example.html, state: null history.go(2); // alerts "location: htt...
WorkerGlobalScope.dump() - Web APIs
syntax dump('my message\n'); parameters a domstring containing the message you want to send.
WorkerGlobalScope.importScripts() - Web APIs
syntax self.importscripts('foo.js'); self.importscripts('foo.js', 'bar.js', ...); parameters a comma-separated list of domstring objects representing the scripts to be imported.
Worklet.addModule() - Web APIs
WebAPIWorkletaddModule
syntax addpromise = worklet.addmodule(moduleurl); addpromise = worklet.addmodule(moduleurl, options); parameters moduleurl a string containing the url of a javascript file with the module to add.
WritableStream.abort() - Web APIs
syntax var promise = writablestream.abort(reason); parameters reason a domstring providing a human-readable reason for the abort.
WritableStreamDefaultController.error() - Web APIs
syntax writablestreamdefaultcontroller.error(e); parameters e a domstring representing the error you want future interactions to fail with.
WritableStreamDefaultWriter.abort() - Web APIs
syntax var promise = writablestreamdefaultwriter.abort(reason); parameters reason optional a domstring representing a human-readable reason for the abort.
XDomainRequest - Web APIs
xdomainrequest.responsetext gets the response body as a string.
XMLDocument.async - Web APIs
WebAPIXMLDocumentasync
(it has been possible to load documents synchronously since 1.4 alpha.) example function loadxmldata(e) { alert(new xmlserializer().serializetostring(e.target)); // gives querydata.xml contents as string } var xmldoc = document.implementation.createdocument("", "test", null); xmldoc.async = false; xmldoc.onload = loadxmldata; xmldoc.load('querydata.xml'); ...
XMLDocument.load() - Web APIs
WebAPIXMLDocumentload
examples var xmldoc = document.implementation.createdocument("", "test", null); function documentloaded (e) { alert(new xmlserializer().serializetostring(e.target)); // gives querydata.xml contents as string } xmldoc.addeventlistener("load", documentloaded, false); xmldoc.load('querydata.xml'); see also the load sample in the xml tests directory.
HTML in XMLHttpRequest - Web APIs
usage retrieving an html resource as a dom using xmlhttprequest works just like retrieving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responsetype property of the xmlhttprequest object after calling open() but before calling send().
XMLHttpRequest.open() - Web APIs
url a domstring representing the url to send the request to.
XMLHttpRequest.overrideMimeType() - Web APIs
syntax xmlhttprequest.overridemimetype(mimetype) parameters mimetype a domstring specifying the mime type to use instead of the one specified by the server.
XMLHttpRequest.readyState - Web APIs
if responsetype is "text" or empty string, responsetext will have the partial text response as it loads.
XMLHttpRequest.responseURL - Web APIs
the read-only xmlhttprequest.responseurl property returns the serialized url of the response or the empty string if the url is null.
XPathEvaluator.createExpression() - Web APIs
syntax xpathexpression xpathevaluator.createexpression(expression, resolver); parameters expression a domstring representing representing the xpath expression to be created.
XPathEvaluator.evaluate() - Web APIs
syntax xpathresult xpathevaluator.evaluate(expression, contextnode, resolver, type, result); parameters expression a domstring representing the xpath expression to be parsed and evaluated.
XPathEvaluator - Web APIs
xpathevaluator.evaluate() evaluates an xpath expression string and returns a result of the specified type if possible.
XPathNSResolver - Web APIs
the xpathnsresolver interface permits prefix strings in an xpath expression to be properly bound to namespace uri strings.
XPathResult.resultType - Web APIs
string_type 2 a result containing a single string.
XREnvironmentBlendMode - Web APIs
the webxr api's enumerated type xrenvironmentblendmode defines strings used to identify if and how to blend the rendered virtual content with the real world.
XRInputSource.handedness - Web APIs
syntax let hand = xrinputsource.handedness; value a domstring indicating whether the input controller is held in one of the user's hands, and if it is, which hand.
XRInputSource.targetRayMode - Web APIs
syntax let raymode = xrinputsource.targetraymode; value a domstring taken from the xrtargetraymode enumerated type, indicating which method to use when generating and presenting the target ray to the user.
XRInputSourceArray.length - Web APIs
ngth === 0) { showalertdialog("you need to have at least one controller to play super duper shark jump fest 9000.", [ { label: "shop now", url: "https://www.amazon.com/s?k=vr+controllers" }, { label: "quit" handler: quitgame } ]); } here, if length is 0, a hypothetical showalertdialog() function is called with a prompt string explaining the need for a controller, and an array of objects, each describing a button and what should happen when it's clicked.
XRInputSourceEvent() - Web APIs
syntax newinputsourceevent = new xrinputsourceevent(type, eventinitdict); parameters type a domstring indicating which of the input source events the new object will represent.
XRPermissionDescriptor.optionalFeatures - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.optionalfeatures = optfeaturelist; optfeaturelist = xrpermissiondescriptor.optionalfeatures; value an array of strings taken from the xrreferencespacetype enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available.
XRPermissionDescriptor.requiredFeatures - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.requiredfeatures = reqfeaturelist; reqfeaturelist = xrpermissiondescriptor.requiredfeatures; value an array of strings indicating the webxr features which must be available for use by the app or site.
XRPermissionStatus - Web APIs
granted an array of strings listing the names of the features for which permission has been granted as of the time at which navigator.permissions.query() was called.
XRReferenceSpaceEvent() - Web APIs
syntax let refspaceevent = new xrreferencespaceevent(type, eventinitdict); parameters type a domstring indicating the event type which has occurred.
XRReferenceSpaceType - Web APIs
the xrreferencespacetype enumerated type defines the strings which identify the types of reference spaces supported by webxr.
XRSession - Web APIs
WebAPIXRSession
visibilitystate read only a domstring whose value is one of those found in the xrvisibilitystate enumerated type, indicating whether or not the session's imagery is visible to the user, and if so, if it's being visible but not currently the target for user events.
XRSessionEvent() - Web APIs
syntax newxrsessionevent = new xrsessionevent(type, eventinitdict); parameters type a domstring indicating which of the events represented by objects of type xrsessionevent this particular object represents.
XRSessionInit - Web APIs
at this time, all features are identified using strings from the xrreferencespacetype enumeration, but future updates to the webxr standard may add more features.
XRSessionMode - Web APIs
the webxr device api's xrsessionmode enumerated type defines the string values used to identify the possible kinds of session mode that can be used.
XRSystem: requestSession() - Web APIs
syntax var sessionpromise = xr.requestsession(sessionmode, sessioninit) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum.
XRViewerPose.views - Web APIs
stereo views require two views to render properly, with the left eye's view having its eye set to the string left and the right eye's view a value of right.
XRVisibilityState - Web APIs
the xrvisibilitystate enumerated type defines the string values which are valid for the xrsession interface's visibilitystate property, which indicates whether or not an xr session is currently visible to the user, and if it is, whether or not it's currently the primary focus.
msCaching - Web APIs
WebAPImsCaching
syntax cachestate = object.mscaching values type: domstring property value description auto disables caching for stream or ms-stream data.
msGetPropertyEnabled - Web APIs
syntax var retval = style.msgetpropertyenabled(name); parameters name [in] type: string the name of the property to enable.
msPutPropertyEnabled - Web APIs
(string) boolean[in]: true = enable the property.
msRegionOverflow - Web APIs
syntax string = object.msregionoverflow values type:domstring overflow: the region element's content overflows the region's content box.
msWriteProfilerMark - Web APIs
type = string.
ARIA live regions - Accessibility
<div id="clock" role="timer" aria-live="polite"></div> /* basic javascript to update the clock */ setinterval(function() { var now = new date(); document.getelementbyid('clock').innerhtml = "time: " + now.gethours() + ":" + ("0"+now.getminutes()).substr(-2); }, 60000); the first time the function executes, the entirety of the string that is added will be announced.
Using the aria-valuemax attribute - Accessibility
value string representation of a number possible effects on user agents and assistive technology if the aria-valuemax is indeterminate, or if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology.
Using the aria-valuemin attribute - Accessibility
value string representation of a number possible effects on user agents and assistive technology if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology.
Using the slider role - Accessibility
monday"> </div> </div> the code snippet below shows a function that responds to user input and updates the aria-valuenow and aria-valuetext attributes: var daynames = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; var updateslider = function (newvalue) { var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working examples: slider example notes aria attributes used aria-valuemin aria-valuemax aria-valuenow aria-valuetext aria-orientation related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the sli...
ARIA: timer role - Accessibility
// get the number of seconds let timer = document.getelementbyid(timername), seconds = parseint(timer.innertext); // remove a second // updated the content of timer timer.innertext = --seconds // if timer != 0, settimeout if (seconds) { settimeout( function() { starttimer(timername); }, 1000); } } the first time the function executes, the entirety of the string that is added will be announced.
ARIA: textbox role - Accessibility
the placeholder should be visible when the control's value is the empty string such as when the control first receives focus and when users remove a previously-entered value.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name.
-webkit-box-reflect - CSS: Cascading Style Sheets
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
if you need to use a special character, and can not enter it literally into your css content string, use a unicode escape sequence, consisting of a backslash followed by the hexadecimal unicode value.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:has() - CSS: Cascading Style Sheets
WebCSS:has
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:host() - CSS: Cascading Style Sheets
WebCSS:host()
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:host-context() - CSS: Cascading Style Sheets
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
syntax formal syntax :lang( <language-code> ) parameter <language-code> a <string> representing the language you want to target.
:not() - CSS: Cascading Style Sheets
WebCSS:not
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:nth-child() - CSS: Cascading Style Sheets
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:nth-last-child() - CSS: Cascading Style Sheets
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
:where() - CSS: Cascading Style Sheets
WebCSS:where
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
system - CSS: Cascading Style Sheets
the system descriptor specifies the algorithm to be used for converting the integer value of a counter to a string representation.
@font-face - CSS: Cascading Style Sheets
yntax @font-face { [ font-family: <family-name>; ] | [ src: <src>; ] | [ unicode-range: <unicode-range>; ] | [ font-variant: <font-variant>; ] | [ font-feature-settings: <font-feature-settings>; ] | [ font-variation-settings: <font-variation-settings>; ] | [ font-stretch: <font-stretch>; ] | [ font-weight: <font-weight>; ] | [ font-style: <font-style>; ] }where <family-name> = <string> | <custom-ident>+ examples specifying a downloadable font this example simply specifies a downloadable font to use, applying it to the entire body of the document: view the live example <html> <head> <title>web font sample</title> <style type="text/css" media="screen, print"> @font-face { font-family: "bitstream vera serif bold"; src: url("https://mdn.mozillademos.org/fi...
@font-feature-values - CSS: Cascading Style Sheets
formal syntax @font-feature-values <family-name># { <feature-value-block-list> }where <family-name> = <string> | <custom-ident>+<feature-value-block-list> = <feature-value-block>+where <feature-value-block> = <feature-type> '{' <feature-value-declaration-list> '}'where <feature-type> = @stylistic | @historical-forms | @styleset | @character-variant | @swash | @ornaments | @annotation<feature-value-declaration-list> = <feature-value-declaration>where <feature-value-declaration> = <custom-ident>: <integer>...
@keyframes - CSS: Cascading Style Sheets
rom { margin-top: 50px; } 50% { margin-top: 150px !important; } /* ignored */ to { margin-top: 100px; } } @keyframes important2 { from { margin-top: 50px; margin-bottom: 100px; } to { margin-top: 150px !important; /* ignored */ margin-bottom: 50px; } } formal syntax @keyframes <keyframes-name> { <keyframe-block-list> }where <keyframes-name> = <custom-ident> | <string><keyframe-block-list> = <keyframe-block>+where <keyframe-block> = <keyframe-selector># { <declaration-list> }where <keyframe-selector> = from | to | <percentage> examples css animation examples see using css animations for examples.
shape - CSS: Cascading Style Sheets
WebCSS@mediashape
syntax the shape descrete feature is specified as one of two acceptable strings, either rect reprsenting a rectangular screen or round representing a circular, oval or elliptical screen.
@namespace - CSS: Cascading Style Sheets
[ <string> | <url> ];where <namespace-prefix> = <ident> examples specifying default and prefixed namespaces @namespace url(http://www.w3.org/1999/xhtml); @namespace svg url(http://www.w3.org/2000/svg); /* this matches all xhtml <a> elements, as xhtml is the default unprefixed namespace */ a {} /* this matches all svg <a> elements */ svg|a {} /* this matches both xhtml and svg <a> elements */ *|a {} ...
@supports - CSS: Cascading Style Sheets
WebCSS@supports
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>?
Attribute selectors - CSS: Cascading Style Sheets
[attr*=value] represents elements with an attribute name of attr whose value contains at least one occurrence of value within the string.
Coordinate systems - CSS: Cascading Style Sheets
the variables idx and idy are set to strings with the names of the properties corresponding to the coordinates in the given coordinate system.
Box-shadow generator - CSS: Cascading Style Sheets
urn; 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; } 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 + ", " + this.g + ", " + this.b; var a = ''; var v = ''; if (this.a !== 1) { a = 'a'; ...
Color picker tool - CSS: Cascading Style Sheets
{ 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 + ', ' + this.g + ', ' + this.b; var a = ''; var v = ''; var x = parsefloat(this.a); if ...
Flow Layout and Overflow - CSS: Cascading Style Sheets
the specification would allow a string of content or a regular ellipsis to be inserted.
Variable fonts guide - CSS: Cascading Style Sheets
the second example uses css custom properties to set values for a font-variation-settings string, and shows how you can more easily update single variable values by overriding a single variable rather than rewriting the whole string.
Using CSS transitions - CSS: Cascading Style Sheets
this is a transitionevent object, which has two added properties beyond a typical event object: propertyname a string indicating the name of the css property whose transition completed.
CSS data types - CSS: Cascading Style Sheets
WebCSSCSS Types
<blend-mode> <calc-product> <calc-sum> <calc-value> <color> <color-stop> <color-stop-angle> <counter-style> <custom-ident> <dimension> <filter-function> <flex> <frequency> <frequency-percentage> <gradient> <ident> <image> <integer> <length> <length-percentage> <number> <number-percentage> <percentage> <position> <quote> <ratio> <resolution> <shape-box> <shape-radius> <string> <time> <time-percentage> <timing-function> <toggle-value> <transform-function> <type-or-unit> <url> <url-modifier> <zero> specifications specification status comment css values and units module level 4 editor's draft css values and units module level 3 candidate recommendation initial definition.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
croll-padding-bottomscroll-padding-inlinescroll-padding-inline-endscroll-padding-inline-startscroll-padding-leftscroll-padding-rightscroll-padding-topscroll-snap-alignscroll-snap-stopscroll-snap-typescrollbar-colorscrollbar-width::selectionselector()sepia()<shape>shape-image-thresholdshape-marginshape-outsidesize (@page)skew()skewx()skewy()::slottedspeak-as (@counter-style)src (@font-face)steps()<string>@stylesetstyleset()@stylisticstylistic()suffix (@counter-style)@supports@swashswash()symbols (@counter-style)symbols()system (@counter-style)ttab-sizetable-layout:targettarget-counter()target-counters()target-text()text-aligntext-align-lasttext-combine-uprighttext-decorationtext-decoration-colortext-decoration-linetext-decoration-skip-inktext-decoration-styletext-decoration-thicknesstext-emphasis...
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
a statement is a building block that begins with any non-space characters and ends at the first closing brace or semi-colon (outside a string, non-escaped and not included into another {}, () or [] pair).
Linear-gradient Generator - CSS: Cascading Style Sheets
{ 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 + ', ' + this.g + ', ' + this.b; var a = ''; var v = ''; var x = parsefloat(this.a); if ...
animation-name - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | <keyframes-name> ]#where <keyframes-name> = <custom-ident> | <string> examples see css animations for examples.
background-image - CSS: Cascading Style Sheets
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
background - CSS: Cascading Style Sheets
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
border-image-source - CSS: Cascading Style Sheets
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
<string> )<shape-box> = <box> | margin-boxwhere <length-percentage> = <length> | <percentage><shape-radius> = <length-percentage> | closest-side | farthest-side<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]?
cross-fade() - CSS: Cascading Style Sheets
)where <image-tags> = ltr | rtl<image-src> = <url> | <string><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]?
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
syntax image-set() = image-set( <image-set-option># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <url> values most commonly you'll see an url() <string> value, but the <image> can be any image type except for an image set.
line-break - CSS: Cascading Style Sheets
strict break text using the most stringent line break rule.
mask-border-source - CSS: Cascading Style Sheets
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
mask-image - CSS: Cascading Style Sheets
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
mask - CSS: Cascading Style Sheets
WebCSSmask
)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()><box> = border-box | padding-box | content-boxwhere <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
symbols() - CSS: Cascading Style Sheets
WebCSSsymbols
[ <string> | <image> ]+ ); <symbols-type> can be one of the following: cyclic: the system cycles through the given values in the order of their definition, and returns to the start when it reaches the end.
transition-property - CSS: Cascading Style Sheets
<custom-ident> a string identifying the property to which a transition effect should be applied when its value changes.
exsl:node-set() - EXSLT
WebEXSLTexslnode-set
you can also use exsl:node-set() to turn strings into text nodes.
Common (exsl) - EXSLT
WebEXSLTexsl
this lets you process the xml created within a variable to process it in multiple steps.exsl:object-type()exsl:object-type() returns a string that indicates the type of the specified object.
math:highest() - EXSLT
WebEXSLTmathhighest
a node has this maximum value if converting its string value to a number equals the maximum value.
math:lowest() - EXSLT
WebEXSLTmathlowest
a node has this minimum value if converting its string value to a number equals the minimum value.
math:max() - EXSLT
WebEXSLTmathmax
returns a result tree fragment representing the highest valued node's numeric value as a string.
math:min() - EXSLT
WebEXSLTmathmin
returns a result tree fragment representing the lowest valued node's numeric value as a string.
Regular expressions (regexp) - EXSLT
WebEXSLTregexp
regexp:match()regexp:match() performs regular expression matching on a string, returning the submatches found as a result.regexp:replace()regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.regexp:test()regexp:test() tests to see whether a string matches a specified regular expression.
Sets (set) - EXSLT
WebEXSLTset
in other words, it returns a node-set whose nodes are in one node-set but not in the other.set:distinct()set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.set:has-same-node()set:has-same-node() determines whether two node-sets have any nodes in common.set:intersection()set:intersection() returns the intersection of two node-sets.
WAI ARIA Live Regions/API Support - Developer guides
the ":system" string is calculated for children-changed and text-changed events.
Audio and Video Delivery - Developer guides
note that just setting the src attribute to an empty string will actually cause the browser to treat it as though you're setting a video source to a relative path.
Rich-Text Editing in Mozilla - Developer guides
document.createelement("pre"); odoc.contenteditable = false; opre.id = "sourcetext"; opre.contenteditable = true; opre.appendchild(ocontent); odoc.appendchild(opre); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odo...
Making content editable - Developer guides
opre.id = "sourcetext"; opre.contenteditable = true; opre.appendchild(ocontent); odoc.appendchild(opre); document.execcommand("defaultparagraphseparator", false, "div"); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odo...
Constraint validation - Developer guides
basically, the idea is to trigger javascript on some form field event (like onchange) to calculate whether the constraint is violated, and then to use the method field.setcustomvalidity() to set the result of the validation: an empty string means the constraint is satisfied, and any other string means there is an error and this string is the error message to display to the user.
Writing forward-compatible websites - Developer guides
don't ua-sniff this is really a particularly common instance of assuming that one feature (the presence of a particular substring in the user agent (ua) string) implies something about the presence or absence of other features.
HTML attribute: capture - HTML: Hypertext Markup Language
the capture attribute takes as it's value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types.
HTML attribute: crossorigin - HTML: Hypertext Markup Language
an invalid keyword and an empty string will be handled as the anonymous keyword.
HTML attribute: required - HTML: Hypertext Markup Language
constraint validation if the element is required and the element's value is the empty string, then the element is suffering from valuemissing and the element will match the :invalid pseudo class.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
empty string: a synonym of the auto value.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
bidirectional text is text that may contain both sequences of characters that are arranged left-to-right (ltr) and sequences of characters that are arranged right-to-left (rtl), such as an arabic quotation embedded in an english string.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
er"); } }); // "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.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
it must be unique among the forms in a document and not an empty string as of html5.
<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="datetime"> - HTML: Hypertext Markup Language
WebHTMLElementinputdatetime
the format of the date and time value used by this input type is described in format of a valid global date and time string in date and time formats used in html.
<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.
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
<isindex> provided a single line text input for entering a query string.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
referrerpolicy a string indicating which referrer to use when fetching the resource: no-referrer means that the referer header will not be sent.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
the value is passed to the object's implementation as a string.
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
this attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
WebHTMLElementsummary
default label text if a <details> element's first child is not a <summary> element, the user agent will use a default string (typically "details") as the label for the disclosure box.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
see the text-align's browser compatibility section for the <string> value.
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
WebHTMLElementtfoot
one of the sixteen predefined color strings may be used: black = "#000000" green = "#008000" silver = "#c0c0c0" lime = "#00ff00" gray = "#808080" olive = "#808000" white = "#ffffff" yellow = "#ffff00" maroon = "#800000" navy = "#000080" red = "#ff0000" blue = "#0000ff" ...
<thead>: The Table Head element - HTML: Hypertext Markup Language
WebHTMLElementthead
one of the sixteen predefined color strings may be used: black = "#000000" green = "#008000" silver = "#c0c0c0" lime = "#00ff00" gray = "#808080" olive = "#808000" white = "#ffffff" yellow = "#ffff00" maroon = "#800000" navy = "#000080" red = "#ff0000" blue = "#0000ff" ...
data-* - HTML: Hypertext Markup Language
note that the htmlelement.dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible via htmlelement.dataset.testvalue (or by htmlelement.dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase.
id - HTML: Hypertext Markup Language
this attribute's value is an opaque string: this means that web authors should not rely on it to convey human-readable information (although having your ids somewhat human-readable can be useful for code comprehension, e.g.
lang - HTML: Hypertext Markup Language
if the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to bcp47, it is set to invalid.
title - HTML: Hypertext Markup Language
if this attribute is set to the empty string, it means its ancestors' titles are irrelevant and shouldn't be used in the tooltip for this element.
translate - HTML: Hypertext Markup Language
it can have the following values: empty string or "yes", which indicates that the element should be translated when the page is localized.
Using the application cache - HTML: Hypertext Markup Language
the first line of the cache manifest must consist of the string cache manifest (with a single u+0020 space between the two words), followed by zero or more space or tab characters.
Choosing between www and non-www URLs - HTTP
in an http url, the first substring that follows the initial http:// or https:// is called the domain name.
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’ - HTTP
the header's value is a comma-delineated string of http method names, such as get, post, or head.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
specifying your policy you can use the content-security-policy http header to specify your policy, like this: content-security-policy: policy the policy is a string containing the policy directives describing your content security policy.
HTTP conditional requests - HTTP
an opaque string, uniquely identifying each version, called the entity tag, or the etag.
Alt-Svc - HTTP
WebHTTPHeadersAlt-Svc
<alt-authority> the quoted string specifying the alternative authority which consists of an optional host override, a colon, and a mandatory port number.
Authorization - HTTP
the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l).
Cache-Control - HTTP
some directives have an optional argument, which can be either a token or a quoted-string.
Clear-Site-Data - HTTP
// single directive clear-site-data: "cache" // multiple directives (comma separated) clear-site-data: "cache", "cookies" // wild card clear-site-data: "*" directives all directives must comply with the quoted-string grammar.
Content-Location - HTTP
er response header accept: application/json, text/json content-location: /documents/foo.json accept: application/xml, text/xml content-location: /documents/foo.xml accept: text/plain, text/* content-location: /documents/foo.txt these urls are examples — the site could serve the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?format=json, /documents/foo?format=xml, and so on.
CSP: base-uri - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: child-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: connect-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: default-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: font-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: form-action - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: frame-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: img-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: manifest-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: media-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: navigate-to - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: object-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: prefetch-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: script-src-attr - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: script-src-elem - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: style-src-attr - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: style-src-elem - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
CSP: worker-src - HTTP
'unsafe-eval' allows the use of eval() and similar methods for creating code from strings.
Content-Security-Policy - HTTP
trusted types allows applications to lock down dom xss injection sinks to only accept non-spoofable, typed values in place of strings.
ETag - HTTP
WebHTTPHeadersETag
they are a string of ascii characters placed between double quotes, like "675af34563dc-tr34".
If-Match - HTTP
WebHTTPHeadersIf-Match
they are a string of ascii characters placed between double quotes (like "675af34563dc-tr34").
If-None-Match - HTTP
they are a string of ascii characters placed between double quotes (like "675af34563dc-tr34") and may be prefixed by w/ to indicate that the weak comparison algorithm should be used (this is useless with if-none-match as it only uses that algorithm).
If-Range - HTTP
WebHTTPHeadersIf-Range
it is a string of ascii characters placed between double quotes (like "675af34563dc-tr34") and may be prefixed by w/ to indicate that the weak comparison algorithm should be used.
Proxy-Authorization - HTTP
the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l).
Public-Key-Pins-Report-Only - HTTP
header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
Public-Key-Pins - HTTP
header type response header forbidden header name no syntax public-key-pins: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
POST - HTTP
WebHTTPMethodsPOST
in this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <input> or <button> elements: application/x-www-form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value.
Protocol upgrade mechanism - HTTP
sec-websocket-accept: hash hash if a sec-websocket-key header was provided, the value of this header is computed by taking the value of the key, concatenating the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" to it, taking the sha-1 hash of that concatenated string, resulting in a 20-byte value.
HTTP Public Key Pinning (HPKP) - HTTP
enabling hpkp to enable this feature for your site, you need to return the public-key-pins http header when your site is accessed over https: public-key-pins: pin-sha256="base64=="; max-age=expiretime [; includesubdomains][; report-uri="reporturi"] pin-sha256 the quoted string is the base64 encoded subject public key information (spki) fingerprint.
HTTP range requests - HTTP
each part contains its own content-type and content-range fields and the required boundary parameter specifies the boundary string used to separate each body-part.
Redirections in HTTP - HTTP
javascript redirections redirections in javascript are performed by setting a url string to the window.location property, loading the new page: window.location = "https://example.com/"; like html redirections, this can't work on all resources, and obviously, this will only work on clients that execute javascript.
Introduction - JavaScript
in contrast to java's compile-time system of classes built by declarations, javascript supports a runtime system based on a small number of data types representing numeric, boolean, and string values.
Iterators and generators - JavaScript
t) // can iterate many times it[symbol.iterator] = function* () { yield 2; yield 1; }; user-defined iterables you can make your own iterables like this: const myiterable = { *[symbol.iterator]() { yield 1; yield 2; yield 3; } } for (let value of myiterable) { console.log(value); } // 1 // 2 // 3 or [...myiterable]; // [1, 2, 3] built-in iterables string, array, typedarray, map and set are all built-in iterables, because their prototype objects all have a symbol.iterator method.
Loops and iteration - JavaScript
it then iterates over all the object's properties and returns a string that lists the property names and their values.
JavaScript modules - JavaScript
square.js — contains: name — a constant containing the string 'square'.
Unicode property escapes - JavaScript
note: for unicode property escapes to work, a regular expression must use the u flag which indicates a string must be considered as a series of unicode code points.
JavaScript Guide - JavaScript
r..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text formatting string literals string object 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 ...
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?
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
try { string(window); } catch (e) { console.log("window is likely dead"); } ...
ReferenceError: invalid assignment left-hand side - JavaScript
examples typical invalid assignments if (math.pi = 3 || math.pi = 4) { console.log('no way!'); } // referenceerror: invalid assignment left-hand side var str = 'hello, ' += 'is it me ' += 'you\'re looking for?'; // referenceerror: invalid assignment left-hand side in the if statement, you want to use a comparison operator ("=="), and for the string concatenation, the plus ("+") operator is needed.
TypeError: "x" is not a constructor - JavaScript
there are many global objects, like string or array, which are constructable using new.
TypeError: "x" is not a function - JavaScript
using the latter will throw an error: const sixteen = 2(3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //uncaught typeerror: 2 is not a function you can correct the code by adding a * operator: const sixteen = 2 * (3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //2 x (3 + 5) is 16 import the exported module correctly ensure you are importing the module correctly.
TypeError: Reduce of empty array with no initial value - JavaScript
one way is to actually provide an initialvalue as the neutral element of the operator, such as 0 for the addition, 1 for a multiplication, or an empty string for a concatenation.
TypeError: "x" is (not) "y" - JavaScript
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 undefin...
TypeError: invalid 'instanceof' operand 'x' - JavaScript
typeof "test" == "string"; // true typeof 42 == "number" // true function foo() {} var f = foo; // do not call foo.
TypeError: 'x' is not iterable - JavaScript
an iterable can be a built-in iterable type such as array, string or map, a generator result, or an object implementing the iterable protocol.
Default parameters - JavaScript
function test(num = 1) { console.log(typeof num) } test() // 'number' (num is set to 1) test(undefined) // 'number' (num is set to 1 too) // test with other falsy values: test('') // 'string' (num is set to '') test(null) // 'object' (num is set to null) evaluated at call time the default argument is evaluated at call time.
getter - JavaScript
note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden).
setter - JavaScript
note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property.
Array.prototype.reduce() - JavaScript
tostring(k).
Array.prototype.concat() - JavaScript
data types such as strings, numbers and booleans (not string, number, and boolean objects): concat copies the values of strings and numbers into the new array.
Array.prototype.find() - JavaScript
tostring(k).
Array.prototype.findIndex() - JavaScript
tostring(k).
Array.prototype.includes() - JavaScript
note: when comparing strings and characters, includes() is case-sensitive.
Array.isArray() - JavaScript
if (!array.isarray) { array.isarray = function(arg) { return object.prototype.tostring.call(arg) === '[object array]'; }; } examples using array.isarray // all following calls return true array.isarray([]); array.isarray([1]); array.isarray(new array()); array.isarray(new array('a', 'b', 'c', 'd')); array.isarray(new array(3)); // little known fact: array.prototype itself is an array: array.isarray(array.prototype); // all following calls return false array.isarray(); array.
Array.prototype.push() - JavaScript
although strings are native, array-like objects, they are not suitable in applications of this method, as strings are immutable.
Array.prototype.shift() - JavaScript
it also displays the removed element: var myfish = ['angel', 'clown', 'mandarin', 'surgeon']; console.log('myfish before:', json.stringify(myfish)); // myfish before: ['angel', 'clown', 'mandarin', 'surgeon'] var shifted = myfish.shift(); console.log('myfish after:', myfish); // myfish after: ['clown', 'mandarin', 'surgeon'] console.log('removed this element:', shifted); // removed this element: angel using shift() method in while loop the shift() method is often used in condition inside while loop.
Array.prototype.some() - JavaScript
g an arrow function const fruits = ['apple', 'banana', 'mango', 'guava']; function checkavailability(arr, val) { return arr.some(arrval => val === arrval); } checkavailability(fruits, 'kela'); // false checkavailability(fruits, 'banana'); // true converting any value to boolean const truthy_values = [true, 'true', 1]; function getboolean(value) { 'use strict'; if (typeof value === 'string') { value = value.tolowercase().trim(); } return truthy_values.some(function(t) { return t === value; }); } getboolean(false); // false getboolean('false'); // false getboolean(1); // true getboolean('true'); // true specifications specification ecmascript (ecma-262)the definition of 'array.prototype.some' in that specification.
ArrayBuffer - JavaScript
you can also get an array buffer from existing data, for example from a base64 string or from a local file.
BigInt() constructor - JavaScript
may be a string or an integer.
Boolean() constructor - JavaScript
examples creating boolean objects with an initial value of false var bnoparam = new boolean(); var bzero = new boolean(0); var bnull = new boolean(null); var bemptystring = new boolean(''); var bfalse = new boolean(false); creating boolean objects with an initial value of true var btrue = new boolean(true); var btruestring = new boolean('true'); var bfalsestring = new boolean('false'); var bsulin = new boolean('su lin'); var barrayproto = new boolean([]); var bobjproto = new boolean({}); specifications specification ecmascript (ecma-262)the ...
Function.prototype.bind() - JavaScript
however, provided arguments are still prepended to the constructor call: function point(x, y) { this.x = x; this.y = y; } point.prototype.tostring = function() { return `${this.x},${this.y}`; }; const p = new point(1, 2); p.tostring(); // '1,2' // not supported in the polyfill below, // works fine with native bind: const yaxispoint = point.bind(null, 0/*x*/); const emptyobj = {}; const yaxispoint = point.bind(emptyobj, 0/*x*/); const axispoint = new yaxispoint(5); axispoint.tostring(); // '0,5' axispoint inst...
Intl.DateTimeFormat.prototype.format() - JavaScript
description the format getter formats a date into a string according to the locale and formatting options of this intl.datetimeformat object.
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
warning: applications should not rely on undefined being returned, as future versions may return a string value identifying the runtime’s default time zone instead.
Intl.DisplayNames - JavaScript
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() constructor - JavaScript
a string with a bcp 47 language tag, or an array of such strings.
Intl.ListFormat - JavaScript
instance methods intl.listformat.prototype.format() returns a language-specific formatted string representing the elements of the list.
Intl.Locale.prototype.language - JavaScript
examples setting the language in the locale identifer string argument in order to be a valid unicode locale identifier, a string must start with the language subtag.
Intl.Locale.prototype.region - JavaScript
examples setting the region in the locale identifer string argument the region is the third part of a valid unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor.
Intl.Locale.prototype.script - JavaScript
examples setting the script in the locale identifer string argument the script is the second part of a valid unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor.
Intl.NumberFormat.prototype.format() - JavaScript
description the format getter function formats a number into a string according to the locale and formatting options of this numberformat object.
Intl.PluralRules - JavaScript
intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting.
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
these objects have two properties: type a numberformat formattoparts type, and value, which is the string which is the component of the output.
Intl.getCanonicalLocales() - JavaScript
syntax intl.getcanonicallocales(locales) parameters locales a list of string values for which to get the canonical locale names.
NaN - JavaScript
0 * infinity) any operation that involves a string and is not an addition operation (e.g.
Object.prototype.__defineGetter__() - JavaScript
syntax obj.__definegetter__(prop, func) parameters prop a string containing the name of the property to bind to the given function.
Object.prototype.__defineSetter__() - JavaScript
syntax obj.__definesetter__(prop, fun) parameters prop a string containing the name of the property to be bound to the given function.
Object.prototype.__lookupGetter__() - JavaScript
syntax obj.__lookupgetter__(sprop) parameters sprop a string containing the name of the property whose getter should be returned.
Object.prototype.__lookupSetter__() - JavaScript
syntax obj.__lookupsetter__(sprop) parameters sprop a string containing the name of the property whose setter should be returned.
Object.freeze() - JavaScript
note that strings, numbers, and booleans are always immutable and that functions and arrays are objects.
Object.getOwnPropertyDescriptor() - JavaScript
a property in javascript consists of either a string-valued name or a symbol and a property descriptor.
Object.getOwnPropertyDescriptors() - JavaScript
a property in javascript consists of either a string-valued name or a symbol and a property descriptor.
Object.getOwnPropertySymbols() - JavaScript
note that object.getownpropertynames() itself does not contain the symbol properties of an object and only the string properties.
Object.getPrototypeOf() - JavaScript
object.getprototypeof('foo'); // typeerror: "foo" is not an object (es5 code) object.getprototypeof('foo'); // string.prototype (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.getprototypeof' in that specification.
Object.is() - JavaScript
two values are the same if one of the following holds: both undefined both null both true or both false both strings of the same length with the same characters in the same order both the same object (means both object have same reference) both numbers and both +0 both -0 both nan or both non-zero and both not nan and both have the same value this is not the same as being equal according to the == operator.
Object.prototype.__proto__ - JavaScript
for objects created using new fun, where fun is one of the built-in constructor functions provided by javascript (array, boolean, date, number, object, string, and so on — including new constructors added as javascript evolves), this value is always fun.prototype.
Promise.allSettled() - JavaScript
for each outcome object, a status string is present.
Promise.prototype.catch() - JavaScript
this is considered good practice in contrast to throwing strings; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information like stack traces.
Promise - JavaScript
// it doesn't have to be a string, but if it is only a succeed message, it probably will be.
Proxy - JavaScript
y if (prop === 'latestbrowser') { return obj.browsers[obj.browsers.length - 1]; } // the default behavior to return the value return obj[prop]; }, set: function(obj, prop, value) { // an extra property if (prop === 'latestbrowser') { obj.browsers.push(value); return true; } // convert the value if it is not an array if (typeof value === 'string') { value = [value]; } // the default behavior to store the value obj[prop] = value; // indicate success return true; } }); console.log(products.browsers); // ['internet explorer', 'netscape'] products.browsers = 'firefox'; // pass a string (by mistake) console.log(products.browsers); // ['firefox'] <- no problem, the value is an array products.latestbrowser =...
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().
Comparing Reflect and Object methods - JavaScript
keys() object.keys() returns an array of strings that map to the target object's own (enumerable) property keys.
Reflect.apply() - JavaScript
examples using reflect.apply() reflect.apply(math.floor, undefined, [1.75]); // 1; reflect.apply(string.fromcharcode, undefined, [104, 101, 108, 108, 111]) // "hello" reflect.apply(regexp.prototype.exec, /ab/, ['confabulation']).index // 4 reflect.apply(''.charat, 'ponies', [3]) // "i" specifications specification ecmascript (ecma-262)the definition of 'reflect.apply' in that specification.
Reflect.getPrototypeOf() - JavaScript
l compared to object.getprototypeof() // same result for objects object.getprototypeof({}) // object.prototype reflect.getprototypeof({}) // object.prototype // both throw in es5 for non-objects object.getprototypeof('foo') // throws typeerror reflect.getprototypeof('foo') // throws typeerror // in es2015 only reflect throws, object coerces non-objects object.getprototypeof('foo') // string.prototype reflect.getprototypeof('foo') // throws typeerror // to mimic the object es2015 behavior you need to coerce reflect.getprototypeof(object('foo')) // string.prototype specifications specification ecmascript (ecma-262)the definition of 'reflect.getprototypeof' in that specification.
Reflect.has() - JavaScript
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')...
Reflect.ownKeys() - JavaScript
keys({z: 3, y: 2, x: 1}) // [ "z", "y", "x" ] reflect.ownkeys([]) // ["length"] let sym = symbol.for('comet') let sym2 = symbol.for('meteor') let obj = {[sym]: 0, 'str': 0, '773': 0, '0': 0, [sym2]: 0, '-1': 0, '8': 0, 'second str': 0} reflect.ownkeys(obj) // [ "0", "8", "773", "str", "-1", "second str", symbol(comet), symbol(meteor) ] // indexes in numeric order, // strings in insertion order, // symbols in insertion order specifications specification ecmascript (ecma-262)the definition of 'reflect.ownkeys' in that specification.
RegExp.prototype.compile() - JavaScript
flags if specified, flags can have any combination of the following values: g global match i ignore case m multiline; treat beginning and end characters (^ and $) as working over multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string) y sticky; matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes).
RegExp.prototype.dotAll - JavaScript
the "s" flag indicates that the dot special character (".") should additionally match the following line terminator ("newline") characters in a string, which it would not match otherwise: u+000a line feed (lf) ("\n") u+000d carriage return (cr) ("\r") u+2028 line separator u+2029 paragraph separator this effectively means the dot will match any character on the unicode basic multilingual plane (bmp).
RegExp.prototype.global - JavaScript
the "g" flag indicates that the regular expression should be tested against all possible matches in a string.
RegExp.prototype.ignoreCase - JavaScript
the "i" flag indicates that case should be ignored while attempting a match in a string.
RegExp.lastParen ($+) - JavaScript
the non-standard lastparen property is a static and read-only property of regular expressions that contains the last parenthesized substring match, if any.
Set - JavaScript
console.log([...myset]) // will show you exactly the same array as myarray remove duplicate elements from the array // use to remove duplicate elements from the array const numbers = [2,3,4,4,2,3,3,4,4,5,5,6,6,7,5,32,3,4,5] console.log([...new set(numbers)]) // [2, 3, 4, 5, 6, 7, 32] relation with strings let text = 'india' let myset = new set(text) // set ['i', 'n', 'd', 'i', 'a'] myset.size // 5 //case sensitive & duplicate ommision new set("firefox") // set(7) [ "f", "i", "r", "e", "f", "o", "x" ] new set("firefox") // set(6) [ "f", "i", "r", "e", "o", "x" ] specifications specification ecmascript (ecma-262)the definition of 'set' in that specification.
Symbol.iterator - JavaScript
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.
Symbol.keyFor() - JavaScript
return value a string representing the key for the given symbol if one is found on the global registry; otherwise, undefined.
TypedArray.prototype.findIndex() - JavaScript
polyfill typedarray.prototype.findindex = array.prototype.findindex = array.prototype.findindex || function(evaluator, thisarg) { 'use strict'; if (!this) { throw new typeerror('array.prototype.some called on null or undefined'); } if (typeof(evaluator) !== 'function') { if (typeof(evaluator) === 'string') { // attempt to convert it to a function if ( !
TypedArray.from() - JavaScript
opy_data = copy_data.map(func, thisobj); var typed_array = new this(copy_data.length); for(var i = 0; i < typed_array.length; i++) { typed_array[i] = copy_data[i]; } return typed_array; } })(); } examples from an iterable object (set) const s = new set([1, 2, 3]); uint8array.from(s); // uint8array [ 1, 2, 3 ] from a string int16array.from('123'); // int16array [ 1, 2, 3 ] use with arrow function and map using an arrow function as the map function to manipulate the elements float32array.from([1, 2, 3], x => x + x); // float32array [ 2, 4, 6 ] generate a sequence of numbers uint8array.from({length: 5}, (v, k) => k); // uint8array [ 0, 1, 2, 3, 4 ] specifications specification ecmascri...
TypedArray.name - JavaScript
the typedarray.name property represents a string value of the typed array constructor name.
TypedArray.prototype.sort() - JavaScript
this method has the same algorithm as array.prototype.sort(), except that sorts the values numerically instead of as strings.
WebAssembly.CompileError - JavaScript
webassembly.compileerror.prototype.tostring() returns a string representing the specified error object..
WebAssembly.Global() constructor - JavaScript
syntax new webassembly.global(descriptor, value); parameters descriptor a globaldescriptor dictionary object, which contains two properties: value: a usvstring representing the data type of the global.
WebAssembly.Global - JavaScript
global.prototype[@@tostringtag] the initial value of the @@tostringtag property is the string value "webassembly.global".
WebAssembly.LinkError - JavaScript
webassembly.linkerror.prototype.tostring() returns a string representing the specified error object..
WebAssembly.Module - JavaScript
static properties webassembly.module.customsections() given a module and string, returns a copy of the contents of all custom sections in the module with the given string name.
WebAssembly.RuntimeError - JavaScript
webassembly.runtimeerror.prototype.tostring() returns a string representing the specified error object..
WebAssembly.Table() constructor - JavaScript
syntax new webassembly.table(tabledescriptor); parameters tabledescriptor an object that can contain the following members: element a string representing the type of value to be stored in the table.
decodeURI() - JavaScript
return value a new string representing the unencoded version of the given encoded uniform resource identifier (uri).
decodeURIComponent() - JavaScript
return value a new string representing the decoded version of the given encoded uniform resource identifier (uri) component.
encodeURI() - JavaScript
return value a new string representing the provided string encoded as a uri.
undefined - JavaScript
// don't do this // logs "foo string" (function() { var undefined = 'foo'; console.log(undefined, typeof undefined); })(); // logs "foo string" (function(undefined) { console.log(undefined, typeof undefined); })('foo'); examples strict equality and undefined you can use undefined and the strict equality and inequality operators to determine whether a variable has a value.
Addition assignment (+=) - JavaScript
syntax operator: x += y meaning: x = x + y examples using addition assignment // assuming the following variables // foo = 'foo' // bar = 5 // baz = true // number + number -> addition bar += 2 // 7 // boolean + number -> addition baz += 1 // 2 // boolean + boolean -> addition baz += false // 1 // number + string -> concatenation bar += 'foo' // "5foo" // string + boolean -> concatenation foo += false // "foofalse" // string + string -> concatenation foo += 'bar' // "foobar" specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
Conditional (ternary) operator - JavaScript
description besides false, possible falsy expressions are: null, nan, 0, the empty string (""), and undefined.
Destructuring assignment - JavaScript
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.
Greater than (>) - JavaScript
examples string to string comparison console.log("a" > "b"); // false console.log("a" > "a"); // false console.log("a" > "3"); // true string to number comparison console.log("5" > 3); // true console.log("3" > 3); // false console.log("3" > 5); // false console.log("hello" > 5); // false console.log(5 > "hello"); // false console.log("5" > 3n); ...
Greater than or equal (>=) - JavaScript
examples string to string comparison console.log("a" >= "b"); // false console.log("a" >= "a"); // true console.log("a" >= "3"); // true string to number comparison console.log("5" >= 3); // true console.log("3" >= 3); // true console.log("3" >= 5); // false console.log("hello" >= 5); // false console.log(5 >= "hello"); // false number to number comparison console.log(5 >...
Less than or equal (<=) - JavaScript
examples string to string comparison console.log("a" <= "b"); // true console.log("a" <= "a"); // true console.log("a" <= "3"); // false string to number comparison console.log("5" <= 3); // false console.log("3" <= 3); // true console.log("3" <= 5); // true console.log("hello" <= 5); // false console.log(5 <= "hello"); // false number to number comparison console.log(5 <...
Logical AND (&&) - JavaScript
examples of expressions that can be converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined.
Logical NOT (!) - JavaScript
examples of expressions that can be converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined.
Logical OR (||) - JavaScript
examples of expressions that can be converted to false are: null; nan; 0; empty string ("" or '' or ``); undefined.
Logical OR assignment (||=) - JavaScript
if an empty string is returned (a falsy value), ||= must be used, otherwise you want to use the ??= operator (for null or undefined return values).
Strict equality (===) - JavaScript
strings must have the same characters in the same order.
Unary plus (+) - JavaScript
it can convert string representations of integers and floats, as well as the non-string values true, false, and null.
yield* - JavaScript
.log(iterator.next()); // {value: 2, done: false} console.log(iterator.next()); // {value: 3, done: false} console.log(iterator.next()); // {value: 4, done: false} console.log(iterator.next()); // {value: 5, done: false} console.log(iterator.next()); // {value: undefined, done: true} other iterable objects besides generator objects, yield* can also yield other kinds of iterables (e.g., arrays, strings, or arguments objects).
for await...of - JavaScript
the for await...of statement creates a loop iterating over async iterable objects as well as on sync iterables, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined async/sync iterables.
if...else - JavaScript
any value that is not false, undefined, null, 0, -0, nan, or the empty string (""), and any object, including a boolean object whose value is false, is considered truthy when used as the condition.
import.meta - JavaScript
such file-specific argument passing may be complementary to that used in the application-wide location.href (with query strings or hash added after the html file path) (or on node.js, through process.argv).
switch - JavaScript
in javascript, you can even mix in definitions of strings into these case statements as well.
Transitioning to strict mode - JavaScript
also, of course, in strict mode, the string is evaluated with strict mode rules.
JavaScript reference - JavaScript
() parsefloat() parseint() decodeuri() decodeuricomponent() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol error objects error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset structured data arraybuffer sharedarraybuffer atomics dataview json control abstraction promise generator genera...
background_color - Web app manifests
type string mandatory no the background_color member defines a placeholder background color for the application page to display before its stylesheet is loaded.
categories - Web app manifests
type array of strings mandatory no the categories member is an array of strings defining the names of categories that the application supposedly belongs to.
description - Web app manifests
type string mandatory no the description member is a string in which developers can explain what the application does.
dir - Web app manifests
WebManifestdir
type string mandatory no the base direction in which to display direction-capable members of the manifest.
display - Web app manifests
type string mandatory no the display member is a string that determines the developers’ preferred display mode for the website.
iarc_rating_id - Web app manifests
type string mandatory no the iarc_rating_id member is a string that represents the international age rating coalition (iarc) certification code of the web application.
icons - Web app manifests
[ { "src": "icon/lowres.webp", "sizes": "48x48", "type": "image/webp" }, { "src": "icon/lowres", "sizes": "48x48" }, { "src": "icon/hd_hi.ico", "sizes": "72x72 96x96 128x128 256x256" }, { "src": "icon/hd_hi.svg", "sizes": "72x72" } ] values image objects may contain the following values: member description sizes a string containing space-separated image dimensions.
lang - Web app manifests
WebManifestlang
type string mandatory no the lang member is a string containing a single language tag.
name - Web app manifests
WebManifestname
type string mandatory yes the name member is a string that represents the name of the web application as it is usually displayed to the user (e.g., amongst a list of other applications, or as a label for an icon).
orientation - Web app manifests
type string mandatory no the orientation member defines the default orientation for all the website's top-level browsing contexts.
scope - Web app manifests
type string mandatory no the scope member is a string that defines the navigation scope of this web application's application context.
serviceworker - Web app manifests
scope a string representing a url that defines a service worker's registration scope; that is, what range of urls a service worker can control.
short_name - Web app manifests
type string mandatory no the short_name member is a string that represents the name of the web application displayed to the user if there is not enough space to display name (e.g., as a label for an icon on the phone home screen).
start_url - Web app manifests
type string mandatory no the start_url member is a string that represents the start url of the web application — the prefered url that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a device's application menu or homescreen).
theme_color - Web app manifests
type string mandatory no the theme_color member is a string that defines the default theme color for the application.
MathML element reference - MathML
l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an index) <msrow> (rows in <mstack> elements) <mstack> (stacked alignment) <mstyle> (style change) <msub> (subscript) <msu...
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
the "codecs" parameter in common media types when specifying the mime type describing a media format, you can provide details using the codecs parameter as part of the type string.
SVG Core Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeCore
value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: <length>|<percentage>; animatable: yes text-anchor defines the vertical alignment a string of text.
bbox - SVG: Scalable Vector Graphics
WebSVGAttributebbox
only one element is using this attribute: <font-face> usage notes value <string> default value none animatable no <string> a comma-separated list of exactly four numbers specifying, in order, the lower left x, lower left y, upper right x, and upper right y of the bounding box for the complete font.
calcMode - SVG: Scalable Vector Graphics
for strings), the calcmode attribute is ignored and discrete interpolation is used.
contentScriptType - SVG: Scalable Vector Graphics
this attribute sets the default scripting language used to process the value strings in event attributes.
data-* - SVG: Scalable Vector Graphics
WebSVGAttributedata-*
the svgelement.dataset property is a domstringmap that provides the attribute data-test-value via svgelement.dataset.testvalue.
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
it has implications for the <tspan>, <tref>, and <altglyph> elements, event processing, for bounding box calculations and for calculation of clipping paths: if display is set to none on a <tspan>, <tref>, or <altglyph> element, then the text string is ignored for the purposes of text layout.
font-family - SVG: Scalable Vector Graphics
s: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="arial, helvetica, sans-serif">sans serif</text> <text x="100" y="20" font-family="monospace">monospace</text> </svg> usage notes value [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace default value depends on user agent animatable yes for a description of the values, please refer to the css font-family property.
glyphRef - SVG: Scalable Vector Graphics
two elements are using this attribute: <altglyph> and <glyphref> usage notes value <string> default value none animatable yes <string> this value represents the glyph identifier.
id - SVG: Scalable Vector Graphics
WebSVGAttributeid
the id must be unique within the node tree, must not be an empty string, and must not contain any whitespace characters.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
the value can be either one of the six keywords defined below, or a string which matches a previous result attribute value within the same <filter> element.
local - SVG: Scalable Vector Graphics
WebSVGAttributelocal
only one element is using this attribute: <color-profile> usage notes value <string> default value none animatable no <string> this value specifies the unique id for a locally stored color profile as specified by international color consortium.
path - SVG: Scalable Vector Graphics
WebSVGAttributepath
an empty string indicates that there is no path data for the element.
pointer-events - SVG: Scalable Vector Graphics
t itself --> <rect x="10" y="0" height="10" width="10" fill="black" /> <circle cx="15" cy="5" r="4" fill="white" pointer-events="none" /> </svg> window.addeventlistener('mouseup', (e) => { // let's pick a random color between #000000 and #ffffff const color = math.round(math.random() * 0xffffff) // let's format the color to fit css requirements const fill = '#' + color.tostring(16).padstart(6,'0') // let's apply our color in the // element we actually clicked on e.target.style.fill = fill }) as a presentation attribute, it can be applied to any element but it is mostly relevant only on the following twenty-three elements: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyl...
requiredExtensions - SVG: Scalable Vector Graphics
if a null string or empty string value is given, the attribute evaluates to "false".
systemLanguage - SVG: Scalable Vector Graphics
if a null string or empty string value is given, the attribute evaluates to "false".
unicode - SVG: Scalable Vector Graphics
WebSVGAttributeunicode
only one element is using this attribute: <glyph> context notes value <string> default value none animatable no <string> this value specifies one or more unicode characters corresponding to a glyph.
xml:space - SVG: Scalable Vector Graphics
for example, the string "a b" (three spaces between "a" and "b") separates "a" and "b" more than "a b" (one space between "a" and "b").
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
r r radius referrerpolicy 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 unic...
<animateMotion> - SVG: Scalable Vector Graphics
value type: <string>; default value: none; animatable: no rotate this attribute defines a rotation applied to the elment animated along a path, usually to make it pointing in the direction of the animation.
<font-face-format> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes string dom interface this element implements the svgfontfaceformatelement interface.
<path> - SVG: Scalable Vector Graphics
WebSVGElementpath
value type: <string> ; default value: ''; animatable: yes pathlength this attribute lets authors specify the total length for the path, in user units.
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
it supports all attribute types, including those that cannot reasonably be interpolated, such as string and boolean values.
Namespaces crash course - SVG: Scalable Vector Graphics
note that namespace names are just strings, so the fact that the svg namespace name also looks like a uri isn't important.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
losed path, effected by the startoffset attribute and text-anchor property implementation status unknown <tref> removed implementation status unknown <altglyph>, <altglyphdef>, <altglyphitem> and <glyphref> removed <altglyph>, <altglyphdef> and <altglyphitem> removed (bug 1260032), <glyphref> never really implemented (bug 1302693) svgtextcontentelement.selectsubstring() deprecated implementation status unknown getcomputedtextlength() not including dx and dy values implementation status unknown text in non-rendered elements not included in addressable characters implementation status unknown unknown elements in text render as unpositioned spans implementation status unknown offset distances of text positioned alon...
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
textlength this is a more obscure attribute giving the calculated length of the string.
Types of attacks - Web security
post endpoints should not interchangeably accept get requests with parameters in the query string.
boolean - XPath
a string evaluates to false if it an empty string.
key - XPath
WebXPathFunctionskey
syntax key(keyname ,value ) arguments keyname a string containing the name of the xsl:key element to be used.
Functions - XPath
ceiling() choose() concat() contains() count() current() xslt-specific document() xslt-specific element-available() false() floor() format-number() xslt-specific function-available() generate-id() xslt-specific id() (partially supported) key() xslt-specific lang() last() local-name() name() namespace-uri() normalize-space() not() number() position() round() starts-with() string() string-length() substring() substring-after() substring-before() sum() system-property() xslt-specific translate() true() unparsed-entity-url() xslt-specific (not supported) ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
syntax <xsl:number count=expression level="single" | "multiple" | "any" from=expression value=expression format=format-string lang=xml:lang-code letter-value="alphabetic" | "traditional" grouping-separator=character grouping-size=number /> required attributes none.
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
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.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:value-of> element evaluates an xpath expression, converts it to a string, and writes that string to the result tree.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
an attribute value template is simply a string that includes an embedded xpath expression which is used to specify the value of an attribute.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
r() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) ...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
d) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) for further reading books online the world wide web consortium portals articles tutorials/examples mailing lis...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
however, the value needs to be an xpath expression and not a string, so {$myorder} is used.
Loading and running WebAssembly code - WebAssembly
this is analogous to new function(string), except that we are substituting a string of characters (javascript source code) with an array buffer of bytes (webassembly source code).