Search completed in 1.04 seconds.
String.prototype.substring() - JavaScript
the sub
string() method returns the part of the
string between the start and end indexes, or to the end of the
string.
... syntax str.sub
string(indexstart[, indexend]) parameters indexstart the index of the first character to include in the returned sub
string.
... indexend optional the index of the first character to exclude from the returned sub
string.
...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 to
string() method returns a
string representing the specified object.
... syntax str.to
string() return value a
string representing the calling object.
... description the
string object overrides the to
string() method of the object object; it does not inherit object.prototype.to
string().
...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 dom
strings 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 sub
strings with the indexof() method, or extracting sub
strings with the sub
string() method.
...And 63 more matches
nsDependentCString
class declaration nstdependent
string_chart stores a null-terminated, immutable sequence of characters.
... subclass of nst
string 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 nstdependent
string 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 ns
string 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 nstdependent
string_chart stores a null-terminated, immutable sequence of characters.
... subclass of nst
string 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 nstdependent
string 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: ns
string for wide characters nsc
string 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: ns
string for wide characters nsc
string 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 nstauto
string_chart subclass of nst
string_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: nsauto
string for wide characters nscauto
string for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesub
string 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 nstauto
string_chart subclass of nst
string_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: nsauto
string for wide characters nscauto
string for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesub
string trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat ...
...And 35 more matches
nsDependentSubstring external
class declaration sub
strings 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 nsa
string&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsa
string&, print32 (*) operator< operator<= ...
... operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find(const nsa
string&, print32 (*) find(const nsa
string&, pruint32, print32 (*) find rfind(const nsa
string&, print32 (*) rfind(const nsa
string&, print32, print32 (*) rfind findchar rfindchar appendint tointeger base classes ns
stringcontainer data members no public members.
... methods constructors void nsdependentsub
string_external() - source void nsdependentsub
string_external(const prunichar*, pruint32) - source parameters prunichar astart pruint32 alength void nsdependentsub
string_external(const nsa
string&, pruint32) - source parameters nsa
string astr pruint32 astartpos void nsdependentsub
string_external(const nsa
string&, pruint32, pruint32) - source parameters nsa
string 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 nstadopting
string extends nstxpidl
string 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 replacesub
string 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 nsxpidlc
string data members no public members.
...And 34 more matches
nsAdoptingString
class declaration nstadopting
string extends nstxpidl
string 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 replacesub
string 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 nsxpidl
string 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 ns
string_external data members no public members.
... methods constructors void nsdependent
string_external() - source void nsdependent
string_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= ns
string_external& operator=(const ns
string_external&) - source parameters ns
string_external& a
string nsa
string& operator=(const nsa
string&) - source parameters nsa
string& a
string nsa
string& 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 ns
stringcontainer data members no public members.
... methods constructors void ns
string_external() - source void ns
string_external(const ns
string_external&) - source parameters ns
string_external& a
string void ns
string_external(const nsa
string&) - source parameters nsa
string& areadable void ns
string_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get prunichar* get() const - source operator= ns
string_external& operator=(const ns
string_external&) - source parameters ns
string_external& a
string nsa
string& operator=(const nsa
string&) - source parameters nsa
string& a
string ...
...And 34 more matches
nsXPIDLCString
class declaration nstxpidl
string extends nst
string 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: nsxpidl
string for wide characters nsxpidlc
string 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 replacesub
string 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 nsc
string data members no public members.
...And 34 more matches
nsXPIDLString
class declaration nstxpidl
string extends nst
string 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: nsxpidl
string for wide characters nsxpidlc
string 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 replacesub
string 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 ns
string 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 ns
stringcontainer data members no public members.
... methods get prunichar* get() const - source operator= ns
string_external& operator=(const ns
string_external&) - source parameters ns
string_external& a
string nsa
string& operator=(const nsa
string&) - source parameters nsa
string& a
string nsa
string& operator=(const prunichar*) - source parameters prunichar* aptr nsa
string& 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/nsa
string_(external)" shape="rect" title="nsa
string_(external)"> <area alt="" coords="939,102,1069,150" href="http://developer.mozilla.org/en/ns
stringcontainer_(external)" shape="rect" title="ns
stringcontainer_(external)"> <area alt="" coords="548,198,676,246" href="http://developer.mozilla.org/en/ns
string_external" shape="rect" title="ns
string_external"> <area alt="" coords="700,198,913,246" href="http://developer.mozilla.org/en/nsdependentsub
string_external" shape="rect" title="nsdependentsub
string_external"> <area alt="" coords="937,198,1071,246" href="http://developer.mozilla.org/en/promiseflat
string_(external)" shape="rect" title="promiseflat
string_(external)"> <area alt="" coords="1...
...095,198,1196,246" href="http://developer.mozilla.org/en/nsauto
string_(external)" shape="rect" title="nsauto
string_(external)"> <area alt="" coords="5,294,197,342" href="http://developer.mozilla.org/en/nsdependent
string_external" shape="rect" title="nsdependent
string_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/nsliteral
string_(external)" shape="rect" title="nsliteral
string_(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 ns
stringcontainer data members no public members.
... methods get prunichar* get() const - source operator= ns
string_external& operator=(const ns
string_external&) - source parameters ns
string_external& a
string nsa
string& operator=(const nsa
string&) - source parameters nsa
string& a
string nsa
string& operator=(const prunichar*) - source parameters prunichar* aptr nsa
string& 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 replacesub
string 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 nsc
string data members no public members.
... methods constructors void nsfixedc
string(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 nsfixedc
string(char*, pruint32, pruint32) - source parameters char* data pruint32 storagesize pruint32 length operator= nsc
string& operator=(const nsc
string&) - source parameters nsc
string& str nsac
string_internal& operator=(char) - source parameters char c nsac
string_internal& operator=(const char*) - source parameters char* data nsac
string_internal& operator=(const nsac
string_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 replacesub
string 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 ns
string data members no public members.
... methods constructors void nsfixed
string(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 nsfixed
string(prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 storagesize pruint32 length operator= ns
string& operator=(const ns
string&) - source parameters ns
string& str nsa
string_internal& operator=(prunichar) - source parameters prunichar c nsa
string_internal& operator=(const prunichar*) - source parameters prunichar* data nsa
string_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 replacesub
string 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 nsc
string data members no public members.
... methods constructors void nspromiseflatc
string(const nsac
string_internal&) - source parameters nsac
string_internal& str void nspromiseflatc
string(const nscsub
stringtuple&) - source parameters nscsub
stringtuple& tuple operator= nsc
string& operator=(const nsc
string&) - source parameters nsc
string& str nsac
string_internal& operator=(char) - source parameters char c nsac
string_internal& operator=(const char*) - source parameters char* data nsac
string_internal& operator=(const nsac
string_internal&) - source parameters nsac
string_internal& str nsac
string_internal& operator=(const nscsub
stringtuple&) - source parameters nscsub
stringtuple& 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 replacesub
string 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 ns
string data members no public members.
... methods constructors void nspromiseflat
string(const nsa
string_internal&) - source parameters nsa
string_internal& str void nspromiseflat
string(const nssub
stringtuple&) - source parameters nssub
stringtuple& tuple operator= ns
string& operator=(const ns
string&) - source parameters ns
string& str nsa
string_internal& operator=(prunichar) - source parameters prunichar c nsa
string_internal& operator=(const prunichar*) - source parameters prunichar* data nsa
string_internal& operator=(const nsa
string_internal&) - source parameters nsa
string_internal& str nsa
string_internal& operator=(const nssub
stringtuple&) - source parameters nssub
stringtuple& 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 nsa
string 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 nsc
stringcontainer data members no public members.
... methods get char* get() const - source operator= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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/nsac
string_(external)" shape="rect" title="nsac
string_(external)"> <area alt="" coords="980,102,1121,150" href="http://developer.mozilla.org/en/nsc
stringcontainer_(external)" shape="rect" title="nsc
stringcontainer_(external)"> <area alt="" coords="571,198,707,246" href="http://developer.mozilla.org/en/nsc
string_external" shape="rect" title="nsc
string_external"> <area alt="" coords="731,198,955,246" href="http://developer.mozilla.org/en/nsdependentcsub
string_external" shape="rect" title="nsdependentcsub
string_external"> <area alt="" coords="979,198,1123,246" href="http://developer.mozilla.org/en/promiseflatc
string_(external)" shape="rect" title="promiseflatc
string_...
...(external)"> <area alt="" coords="1147,198,1259,246" href="http://developer.mozilla.org/en/nscauto
string_(external)" shape="rect" title="nscauto
string_(external)"> <area alt="" coords="5,294,208,342" href="http://developer.mozilla.org/en/nsdependentc
string_external" shape="rect" title="nsdependentc
string_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/nsliteralc
string_(external)" shape="rect" title="nsliteralc
string_(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 nsc
stringcontainer data members no public members.
... methods get char* get() const - source operator= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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 nsac
string&, print32 (*) equals(const char*, print32 (*) equals(const nsac
string&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral find(const nsac
string&, print32 (*) find(const nsac
string&, pruint32, print32 (*) find(const char*, print32 (*) find(con...
...st char*, pruint32, print32 (*) rfind(const nsac
string&, print32 (*) rfind(const nsac
string&, print32, print32 (*) rfind(const char*, print32 (*) rfind(const char*, print32, print32 (*) findchar rfindchar appendint tointeger base classes nsac
string 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 nsc
stringcontainer data members no public members.
... methods constructors void nsc
string_external() - source void nsc
string_external(const nsc
string_external&) - source parameters nsc
string_external& a
string void nsc
string_external(const nsac
string&) - source parameters nsac
string& areadable void nsc
string_external(const char*, pruint32) - source parameters char* adata pruint32 alength get char* get() const - source operator= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string ...
... nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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 nsc
string_external data members no public members.
... methods constructors void nsdependentc
string_external() - source void nsdependentc
string_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= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* ...
...aptr nsac
string& 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 nsc
stringcontainer data members no public members.
... methods constructors void nsdependentcsub
string_external() - source void nsdependentcsub
string_external(const char*, pruint32) - source parameters char* astart pruint32 alength void nsdependentcsub
string_external(const nsac
string&, pruint32) - source parameters nsac
string& astr pruint32 astartpos void nsdependentcsub
string_external(const nsac
string&, pruint32, pruint32) - source parameters nsac
string& 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 nsc
string_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= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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 nsc
string_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= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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 sub
strings, puts these sub
strings 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/nsi
stringbundle.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 jsautobyte
string str; jsautobyte
string(jscontext *cx, js
string *str); name type description cx jscontext * the context in which to add the root.
... str js
string * a pointer to js
string to get initial content by calling js_encode
string(cx, str).
...And 22 more matches
nsACString
« xpcom api reference summary the nsac
string abstract class represents a character
string composed of single-byte storage units.
... #include "ns
stringapi.h" class nsac
string { ...
... self_type [nsac
string] an alias for the type of this class.
...And 20 more matches
nsAString
« xpcom api reference summary the nsa
string abstract class represents a character
string composed of double-byte storage units.
... #include "ns
stringapi.h" class nsa
string { ...
... self_type [nsa
string] an alias for the type of this class.
...And 20 more matches
nsAString_internal
class declaration nstsub
string is the most abstract class in the
string hierarchy.
... for example, see nst
string.
... names: nsa
string for wide characters nsac
string for narrow characters many of the accessors on nstsub
string are inlined as an optimization.
...And 20 more matches
Array.prototype.toLocaleString() - JavaScript
the tolocale
string() method returns a
string representing the elements of the array.
... the elements are converted to
strings using their tolocale
string methods and these
strings are separated by a locale-specific
string (such as a comma “,”).
... syntax arr.tolocale
string([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 nstsub
string is the most abstract class in the
string hierarchy.
... for example, see nst
string.
... names: nsa
string for wide characters nsac
string for narrow characters many of the accessors on nstsub
string are inlined as an optimization.
...And 19 more matches
nsICompositionStringSynthesizer
dom/interfaces/base/nsicomposition
stringsynthesizer.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.createcomposition
stringsynthesizer().
... to create an instance for this: var domwindowutils = window.windowutils; var composition
stringsynthesizer = domwindowutils.createcomposition
stringsynthesizer(); 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 .set
string().
...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 nstdependentsub
string_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: nsdependentsub
string for wide characters nsdependentcsub
string 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_c
stringcontainerinit2 function initializes a nsc
stringcontainer instance for use as a nsac
string.
... #include "ns
stringapi.h" nsresult ns_c
stringcontainerinit2( nsc
stringcontainer& acontainer, const char* adata = nsnull, pruint32 adatalength = pr_uint32_max, pruint32 aflags = 0 ); parameters acontainer [in] the nsc
stringcontainer instance to initialize.
... adata [in] an array of characters used to initialize the
string object.
...And 18 more matches
nsDependentCSubstring
class declaration nstdependentsub
string_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: nsdependentsub
string for wide characters nsdependentcsub
string 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_c
stringappenddatathe ns_c
stringappenddata function appends data to the existing value of a nsac
string instance.
... this is a low-level api.ns_c
stringclonedatathe ns_c
stringclonedata function returns a null-terminated, heap allocated copy of the
string's internal buffer.ns_c
stringcontainerfinishthe ns_c
stringcontainerfinish function releases any memory allocated by a nsc
stringcontainer instance.ns_c
stringcontainerinitthe ns_c
stringcontainerinit function initializes a nsc
stringcontainer instance for use as a nsac
string.ns_c
stringcontainerinit2the ns_c
stringcontainerinit2 function initializes a nsc
stringcontainer instance for use as a nsac
string.ns_c
stringcopythe ns_c
stringcopy function copies the value from one nsac
string instance to another.
...And 15 more matches
Object.prototype.toString() - JavaScript
the to
string() method returns a
string representing the object.
... syntax obj.to
string() return value a
string representing the object.
... description every object has a to
string() 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 js
string whose characters are stored in external memory.
... syntax js
string * js_newexternal
string(jscontext *cx, const char16_t *chars, size_t length, const js
stringfinalizer *fin); js
string * js_newexternal
stringwithclosure(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 js
string 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: query
string.
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: query
string.
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 js
string.
... syntax js
string * js_valueto
string(jscontext *cx, jsval v); name type description cx jscontext * the context in which to perform the conversion.
... description js_valueto
string converts a specified javascript value, v, to a
string.
...And 12 more matches
Date.prototype.toLocaleString() - JavaScript
the tolocale
string() 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.tolocale
string([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 js
string that is protected from gc and automatically shared with other code that needs a js
string with the same value.
... syntax js
string * js_intern
string(jscontext *cx, const char *s); js
string * js_intern
stringn(jscontext *cx, const char *s, size_t length); js
string * js_internuc
string(jscontext *cx, const char16_t *s); js
string * js_internuc
stringn(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 js
string * js_new
stringcopyn(jscontext *cx, const char *s, size_t n); js
string * js_newuc
stringcopyn(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/nsi
stringbundle.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.nsi
stringbundleservice); method overview nsi
stringbundle createbundle(in
string aurlspec); nsi
stringbundle createextensiblebundle(in
string aregistrykey); void flushbundles(); w
string formatstatusmessage(in nsresult astatus, in w
string astatusarg); methods createbundle() nsi
stringbundle createbundle( in
string aurlspec ); parameters aurlspec the url of the properties file to load.
...And 10 more matches
Date.prototype.toLocaleDateString() - JavaScript
the tolocaledate
string() 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.tolocaledate
string([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_addexternal
stringfinalizer(js
stringfinalizeop finalizer); name type description finalizer js
stringfinalizeop pointer to a callback function, described below.
... the js engine will automatically call this function each time a
string created by js_newexternal
string is garbage-collected.
...And 9 more matches
JS_GetStringBytes
convert a javascript
string to a c
string.
... syntax char * js_get
stringbytes(js
string *str); const char * js_get
stringbytesz(jscontext *cx, js
string *str); // added in jsapi 1.8.2 name type description cx jscontext * (js_get
stringbytesz and js_encode
string only) a context.
... str js
string *
string to retrieve bytes from.
...And 9 more matches
nsIStringBundleOverride
intl/strres/nsi
stringbundleoverride.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.nsi
stringbundleoverride); note: you should never need to use this service directly.
...And 9 more matches
NS_CStringGetMutableData
« xpcom api reference summary the ns_c
stringgetmutabledata function gives the caller write access to the
string's internal buffer.
... #include "ns
stringapi.h" pruint32 ns_c
stringgetmutabledata( nsac
string& a
string, pruint32 adatalength, char** adata ); parameters a
string [in] a nsac
string 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 tolocaletime
string() 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.tolocaletime
string([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 tolocale
string() method returns a
string with a language-sensitive representation of this number.
... syntax numobj.tolocale
string([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_compare
strings(jscontext *cx, js
string *str1, js
string *str2, int32_t *result); name type description cx jscontext * the context to which both
strings must belong.
... str1 js
string * 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_encode
string(jscontext *cx, js
string *str); char * js_encode
stringtoutf8(jscontext *cx, js::handle
string str); // added in spidermonkey 24 name type description cx jscontext * a context.
... str js
string * / js::handle
string a
string to encode.
...And 8 more matches
JS_MakeStringImmutable
make a js
string thread-safe.
... syntax jsbool js_make
stringimmutable(jscontext *cx, js
string *str); name type description cx jscontext * a context.
... s js
string * the
string to operate on.
...And 8 more matches
NS_CStringContainerInit
« xpcom api reference summary the ns_c
stringcontainerinit function initializes a nsc
stringcontainer instance for use as a nsac
string.
... #include "ns
stringapi.h" nsresult ns_c
stringcontainerinit( nsc
stringcontainer& a
string ); parameters a
string [in] a nsc
stringcontainer instance to be initialized.
... return values the ns_c
stringcontainerinit function returns ns_ok if successful.
...And 8 more matches
NS_StringContainerInit
« xpcom api reference summary the ns_
stringcontainerinit function initializes a ns
stringcontainer instance for use as a nsa
string.
... #include "ns
stringapi.h" nsresult ns_
stringcontainerinit( ns
stringcontainer& a
string ); parameters a
string [in] a ns
stringcontainer 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 to
string() method returns a
string representing the specified bigint object.
... the trailing "n" is not part of the
string.
... syntax bigintobj.to
string([radix]) parameters radixoptional optional.
...And 8 more matches
Date.prototype.toString() - JavaScript
the to
string() method returns a
string representing the specified date object.
... syntax dateobj.to
string() return value a
string representing the given date.
... description date instances inherit their to
string() 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 js
string * js_newdependent
string(jscontext *cx, js::handle
string str, size_t start, size_t length); name type description cx jscontext * the context in which to create the new
string.
... str js::handle
string the
string containing the characters for the new
string.
...And 7 more matches
nsEmbedCString
« xpcom api reference summary the nsembedc
string concrete class provides a way to construct a nsac
string object that allocates null-terminated storage.
... #include "nsembed
string.h" class nsembedc
string : public nsac
string { ...
... }; typedefs self_type [nsembedc
string] an alias for the type of this class.
...And 7 more matches
nsEmbedString
« xpcom api reference summary the nsembed
string concrete class provides a way to construct a nsa
string object that allocates null-terminated storage.
... #include "nsembed
string.h" // or: #include "ns
stringglue.h" if inside gecko class nsembed
string : public nsa
string { ...
... }; typedefs self_type [nsembed
string] an alias for the type of this class.
...And 7 more matches
nsIStringEnumerator
xpcom/ds/nsi
stringenumerator.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview a
string 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 tolocale
string() method returns a
string with a language-sensitive representation of this bigint.
... syntax bigintobj.tolocale
string([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 to
string() method returns a
string representing the source code of the function.
... syntax function.to
string() return value a
string representing the source code of the function.
... description the function object overrides the to
string method inherited from object; it does not inherit object.prototype.to
string.
...And 7 more matches
Number.prototype.toString() - JavaScript
the to
string() method returns a
string representing the specified number object.
... syntax numobj.to
string([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 sub
string.
... 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_encode
stringtobuffer(jscontext *cx, js
string *str, char *buffer, size_t length); name type description cx jscontext * a context.
... str js
string * 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 jsflat
string * js_flatten
string(jscontext *cx, js
string *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_get
stringcharat(jscontext *cx, js
string *str, size_t index, char16_t *res); char16_t js_getflat
stringcharat(jsflat
string *str, size_t index); name type description cx jscontext * the context in which to create the new
string.
... str js
string * or jsflat
string * the
string to get character.
...And 6 more matches
JS_NewUCString
note: js_new
string() was removed in spidermonkey 1.8.5.
... use js_new
stringcopyn and js_newuc
stringcopyn instead.
... syntax js
string * js_newuc
string(jscontext *cx, char16_t *chars, size_t length); js
string * js_new
string(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, js
string *str, const char *asciibytes, bool *match); bool js_flat
stringequalsascii(jsflat
string *str, const char *asciibytes); name type description cx jscontext * a context.
... str jsflat
string *
string to compare.
...And 6 more matches
nsIPrefLocalizedString
modules/libpref/public/nsipreflocalized
string.idlscriptable this interface is simply a wrapper interface for nsisupports
string so the preferences service can have a unique identifier to distinguish between requests for normal wide
strings nsisupports
string) 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 w
string data); w
string to
string(); attributes attribute type description data w
string provides access to
string data stored in this property.
...void setdatawithlength( in unsigned long length, [size_is(length)] in w
string data ); parameters length the length of the
string.
...And 6 more matches
nsIUTF8StringEnumerator
xpcom/ds/nsi
stringenumerator.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 autf8
string 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_utf16toc
string function converts the value of a nsa
string instance from utf-16 to the specified multi-byte encoding and stores the result in a nsac
string instance.
... #include "ns
stringapi.h" nsresult ns_utf16toc
string( const nsa
string& asrc, nsc
stringencoding adestencoding, nsac
string& adest ); parameters asrc [in] a nsa
string 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
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.getas
string() 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.getas
string(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 svg
stringlist defines a list of dom
string objects.
... an svg
stringlist 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() dom
string initialize(in dom
string newitem) dom
string getitem(in unsigned long index) dom
string insertitembefore(in dom
string newitem, in unsigned long index) dom
string replaceitem(in dom
string newitem, in unsigned long index) dom
string removeitem(in unsigned long index) dom
string appenditem(in dom
string 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
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(compare
string[, locales[, options]]) parameters compare
string 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 ns
string& and nsc
string& void mymethod(const ns
string& input, ns
string& output); new way: use nsa
string& and nsac
string& void mymethod(const nsa
string& input, nsa
string& output); sub
strings what: get direct references to
string fragments why: avoid making multiple copies of the
string old way: use a bunch of nsauto
strings, and use left(), right() and mid() to grab a segment of a
string: // get an 8-character
string starting at the 4th position nsauto
string leftside; str.left(leftside, 12); nsauto
string middle; leftside.right(middle, 8); new way: use sub
string() to grab a direct reference to those characters: // get an 8-character
string starting at the 4th position const nsa
string& middle = sub
string(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); js
string * jsid_to_
string(jsid id); jsid interned_
string_to_jsid(jscontext *cx, js
string *str); // added in spidermonkey 38 jsflat
string * 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 js
string * 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_c
stringsareutf8(void); void js_setc
stringsareutf8(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 js
string * js_concat
strings(jscontext *cx, js::handle
string left, js::handle
string right); name type description cx jscontext * the context in which both the
strings have been created.
... left js::handle
string 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_get
stringchars(js
string *str); // obsolete since jsapi 1.8.5 const jschar * js_get
stringcharsz(jscontext *cx, js
string *str); // added in spidermonkey 1.8.2, obsolete since jsapi 33 name type description cx jscontext * (in js_get
stringcharsz only) a context.
... str js
string * 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 js
string * js_new
stringcopyz(jscontext *cx, const char *s); js
string * js_newuc
stringcopyz(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_c
stringinsertdata function appends data to the existing value of a nsac
string instance.
... #include "ns
stringapi.h" nsresult ns_c
stringinsertdata( nsac
string& a
string, pruint32 aoffset, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsac
string 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_c
stringtoutf16 function converts the value of a nsac
string instance to utf-16 and stores the result in a nsa
string instance.
... #include "ns
stringapi.h" nsresult ns_c
stringtoutf16( const nsac
string& asrc, nsc
stringencoding asrcencoding, nsa
string& adest ); parameters asrc [in] a nsac
string 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 nsac
string instance.
... #include "ns
stringapi.h" nsresult ns_
stringinsertdata( nsac
string& a
string, pruint32 aoffset, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsac
string 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 to
string() method returns a
string representing the specified array and its elements.
... syntax arr.to
string() return value a
string representing the elements of the array.
... description the array object overrides the to
string method of object.
...And 5 more matches
Date.prototype.toGMTString() - JavaScript
the togmt
string() method converts a date to a
string, using internet greenwich mean time (gmt) conventions.
... the exact format of the value returned by togmt
string() varies according to the platform and browser, in general it should represent a human readable date
string.
... note: togmt
string() 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 [, pad
string]) 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(search
string[, position]) parameters search
string 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 search
string.
...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 to
string() method returns a
string representing the specified array and its elements.
... this method has the same algorithm as array.prototype.to
string().
... syntax typedarray.to
string() 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 deflate
stringtoutf8buffer(jsflat
string* src, mozilla::rangedptr<char> dst, size_t* dstlenp = nullptr, size_t* numcharsp = nullptr); // obsolete in spidermonkey 49 void deflate
stringtoutf8buffer(jsflat
string* src, mozilla::rangedptr<char> dst); name type description src jsflat
string * the pointer to the
string to deflate.
... description js::deflate
stringtoutf8buffer 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 js
string* js::to
string(jscontext *cx, js::handlevalue v) name type description cx jscontext * the context in which to perform the conversion.
... description js::to
string 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_getlatin1
stringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, js
string *str, size_t *length); const char16_t * js_gettwobyte
stringcharsandlength(jscontext *cx, const js::autocheckcannotgc &nogc, js
string *str, size_t *length); name type description cx jscontext * a context.
... str js
string * 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_get
stringencodinglength(jscontext *cx, js
string *str); name type description cx jscontext * a context.
... str js
string * 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_get
stringlength(js
string *str); name type description str js
string * the
string to examine.
... description js_get
stringlength 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(js
string *str); name type description str js
string *
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 nsc
stringencoding enumeration describes the set of character encodings understood by the ns_c
stringtoutf16 and ns_utf16toc
string functions.
... ns_c
string_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_c
stringappenddata function appends data to the existing value of a nsac
string instance.
... #include "ns
stringapi.h" nsresult ns_c
stringappenddata( nsac
string& a
string, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsac
string 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_c
stringcopy function copies the value from one nsac
string instance to another.
... #include "ns
stringapi.h" nsresult ns_c
stringcopy( nsac
string& adest
string, const nsac
string& asrc
string ); parameters adest
string [in] a nsac
string instance to be modified.
... asrc
string [in] a nsac
string instance containing the new
string value.
...And 4 more matches
NS_CStringCutData
« xpcom api reference summary the ns_c
stringcutdata function removes a section of the
string's internal buffer.
... #include "ns
stringapi.h" nsresult ns_c
stringcutdata( nsac
string& a
string, pruint32 acutstart, pruint32 acutlength ); parameters a
string [in] a nsac
string 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_c
stringgetdata function gives the caller read access to the
string's internal buffer.
... #include "ns
stringapi.h" pruint32 ns_c
stringgetdata( const nsac
string& a
string, const char** adata, prbool* aterminated = nsnull ); parameters a
string [in] a nsac
string 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_c
stringsetdata function copies data into the
string's internal buffer.
... #include "ns
stringapi.h" nsresult ns_c
stringsetdata( nsac
string& a
string, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsac
string 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 nsa
string instance.
... #include "ns
stringapi.h" nsresult ns_
stringappenddata( nsa
string& a
string, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsa
string 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 nsa
string instance to another.
... #include "ns
stringapi.h" nsresult ns_
stringcopy( nsa
string& adest
string, const nsa
string& asrc
string ); parameters adest
string [in] a nsa
string instance to be modified.
... asrc
string [in] a nsa
string 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 "ns
stringapi.h" nsresult ns_
stringcutdata( nsa
string& a
string, pruint32 acutstart, pruint32 acutlength ); parameters a
string [in] a nsa
string 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 "ns
stringapi.h" nsresult ns_
stringsetdata( nsa
string& a
string, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsa
string instance to modify.
... adata [in] a raw character array to copy into this
string.
...And 4 more matches
CSSPrimitiveValue.setStringValue() - Web APIs
the set
stringvalue() 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.set
stringvalue(
stringtype,
stringvalue); parameters
stringtype an unsigned short representing the type of the value.
...And 4 more matches
ConstrainDOMString - Web APIs
the constraindom
string 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 to
string() method returns a
string representing the specified boolean object.
... syntax bool.to
string() return value a
string representing the specified boolean object.
... description the boolean object overrides the to
string method of the object object; it does not inherit object.prototype.to
string().
...And 4 more matches
Date.prototype.toDateString() - JavaScript
the todate
string() 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.todate
string() return value a
string representing the date portion of the given date object in human readable form in english.
...calling to
string() will return the date formatted in a human readable form in english.
...And 4 more matches
Object.prototype.toLocaleString() - JavaScript
the tolocale
string() method returns a
string representing the object.
... syntax obj.tolocale
string() return value a
string representing the object.
... description object's tolocale
string returns the result of calling to
string().
...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(search
string[, position]) parameters search
string a
string to be searched for within str.
... position optional the position within the
string at which to begin searching for search
string.
...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 [, pad
string]) 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 tolocale
string() 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.tolocale
string() and, as the typed array elements are numbers, the same algorithm as number.prototype.tolocale
string() applies for each element.
...And 4 more matches
setValueString - Archive of obsolete content
setvalue
string sets the value of a key, when that value is a
string.
... method of winreg object syntax int setvalue
string (
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 getformatted
string, get
string examples (example needed) attributes src type: uri the uri of the property file that contains the localized
strings.
...
stringbundle type: nsi
stringbundle returns the xpcom
string bundle object which implements nsi
stringbundle.
...And 3 more matches
JSVAL_TO_STRING
cast a jsval to type js
string * without a type check.
... syntax js
string * jsval_to_
string(jsval v); description jsval_to_
string casts the argument, v, to type js
string *.
... 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_fileescaped
string(file *fp, js
string *str, char quote); name type description fp file * a file pointer to write into.
... str js
string * 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_getlatin1interned
stringchars(const js::autocheckcannotgc &nogc, js
string *str); const char16_t * js_gettwobyteinterned
stringchars(const js::autocheckcannotgc &nogc, js
string *str); name type description cx jscontext * a context.
... str js
string * 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 js
string * js_internjs
string(jscontext *cx, js::handle
string str); name type description cx jscontext * the context.
... str js::handle
string a
string to be interned.
...And 3 more matches
JS_RemoveExternalStringFinalizer
unregister a custom
string memory manager.
... syntax int js_removeexternal
stringfinalizer(js
stringfinalizeop finalizer); name type description finalizer js
stringfinalizeop the finalizer to remove.
... as with js_addexternal
stringfinalizer, 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(js
string *str) name type description obj js
string * a pointer to a js
string to convert to a jsval.
...And 3 more matches
nsEmbedCString
« xpcom api reference summary constructors for nsembedc
string.
... nsembedc
string(); explicit nsembedc
string( const self_type& a
string ); parameters a
string [in] a nsembedc
string to copy into this
string.
... nsembedc
string( const abstract_
string_type& aabstract
string ); parameters aabstract
string [in] a nsac
string to copy into this
string.
...And 3 more matches
nsEmbedString
« xpcom api reference summary constructors for nsembed
string.
... nsembed
string(); explicit nsembed
string( const self_type& a
string ); parameters a
string [in] a nsembed
string to copy into this
string.
... nsembed
string( const abstract_
string_type& aabstract
string ); parameters aabstract
string [in] a nsa
string to copy into this
string.
...And 3 more matches
NS_CStringSetDataRange
« xpcom api reference summary the ns_c
stringsetdatarange function copies data into a section of the
string's internal buffer.
... #include "ns
stringapi.h" nsresult ns_c
stringsetdatarange( nsac
string& a
string, pruint32 acutstart, pruint32 acutlength, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsac
string 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 "ns
stringapi.h" pruint32 ns_
stringgetdata( const nsa
string& a
string, const prunichar** adata, prbool* aterminated ); parameters a
string [in] a nsa
string 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 "ns
stringapi.h" nsresult ns_
stringsetdatarange( nsa
string& a
string, pruint32 acutstart, pruint32 acutlength, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters a
string [in] a nsa
string instance to modify.
...adata [in] a raw character array to copy into this
string.
...And 3 more matches
URLSearchParams.toString() - Web APIs
the to
string() 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.to
string() parameters none.
...And 3 more matches
Date.prototype.toTimeString() - JavaScript
the totime
string() method returns the time portion of a date object in human readable form in american english.
... syntax dateobj.totime
string() return value a
string representing the time portion of the given date in human readable form in american english.
...calling to
string() will return the date formatted in a human readable form in american english.
...And 3 more matches
Error.prototype.toString() - JavaScript
the to
string() method returns a
string representing the specified error object.
... syntax e.to
string() return value a
string representing the specified error object.
... description the error object overrides the object.prototype.to
string() method inherited by all objects.
...And 3 more matches
Intl.Locale.prototype.toString() - JavaScript
the intl.locale.prototype.to
string() returns the locale's full locale identifier
string.
... syntax locale.to
string() 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(search
string[, length]) parameters search
string 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.to
stringtag 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.to
string() method.
... property attributes of symbol.to
stringtag writable no enumerable no configurable no examples default tags object.prototype.to
string.call('foo'); // "[object
string]" object.prototype.to
string.call([1, 2]); // "[object array]" object.prototype.to
string.call(3); // "[object number]" object.prototype.to
string.call(true); // "[object boolean]" object.prototype.to
string.call(undefined); // "[object undefined]" object.prototype.to
string.call(null); // "[o...
...And 3 more matches
substring-after - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the sub
string-after function returns a
string that is the rest of a given
string after a given sub
string.
... syntax sub
string-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 sub
string-before function returns a
string that is the part of a given
string before a given sub
string.
... syntax sub
string-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 sub
string function returns a part of a given
string.
... syntax sub
string(
string ,start [,length] ) arguments
string the
string to evaluate.
... start the position within
string the sub
string begins length(optional) the length of the sub
string.
...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.to
string ( initobj ); parameters the to
string 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
get
string retrieves a value from a .ini file.
... method of winprofile object syntax
string get
string (
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
getvalue
string retrieves the value of a key when that value is a
string.
... method of winreg object syntax
string getvalue
string (
string subkey,
string valname); parameters the getvalue
string 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_get
stringidentifiers(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_compare
strings( const void *v1, const void *v2); description pl_compare
strings compares v1 and v2 as character
strings using strcmp.
... if the two
strings are equal, it returns 1.
...And 2 more matches
JSString
a js
string 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 js
string, because it is subject to change; instead, treat js
string objects as opaque.
...And 2 more matches
JSStringFinalizer
this article covers features introduced in spidermonkey 17 finalize external
strings created by js_newexternal
string.
... syntax struct js
stringfinalizer { void (*finalize)(const js
stringfinalizer *fin, char16_t *chars); }; name type description fin js
stringfinalizer 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_get
stringchars, and js_get
stringlength.
...And 2 more matches
JS_GetExternalStringClosure
this article covers features introduced in spidermonkey 6 returns the
string closure stored in a js
string created by calling js_newexternal
stringwithclosure.
... syntax void * js_getexternal
stringclosure(jscontext *cx, js
string *str); name type description cx jscontext * the context from which to retrieve the closure for a
string.
... str js
string * 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_getinterned
stringchars(js
string *str); const jschar * js_getinterned
stringcharsandlength(js
string *str, size_t *length); name type description str js
string * 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_getlatin1flat
stringchars(const js::autocheckcannotgc &nogc, jsflat
string *str); const char16_t * js_gettwobyteflat
stringchars(const js::autocheckcannotgc &nogc, jsflat
string *str); name type description cx jscontext * a context.
... str jsflat
string * 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_get
stringcharsandlength(jscontext *cx, js
string *str, size_t *length); name type description cx jscontext * the context.
... str js
string * 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_gettwobyteexternal
stringchars(js
string *str); name type description str js
string * a
string to get characters.
... description js_gettwobyteexternal
stringchars 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_putescaped
string(jscontext *cx, char *buffer, size_t size, js
string *str, char quote); size_t js_putescapedflat
string(char *buffer, size_t size, jsflat
string *str, char quote); name type description cx jscontext * a context.
... str js
string * or jsflat
string * 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 to
string(); attributes attribute type description data ac
string provides access to the native type represented by the object.
... methods to
string() 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 to
string(); attributes attribute type description data a
string provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...And 2 more matches
CSSPrimitiveValue.getStringValue() - Web APIs
the get
stringvalue() 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.get
stringvalue(); return value a
string value.
...And 2 more matches
FileReaderSync.readAsBinaryString() - Web APIs
the readasbinary
string() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an dom
string.
... syntax readasbinary
string(file); readasbinary
string(blob); parameters blob the dom file or blob to read.
... return value an dom
string representing the input data.
...And 2 more matches
Range.toString() - Web APIs
the range.to
string() method is a
stringifier returning the text of the range.
... alerting the contents of a range makes an implicit to
string() call, so comparing range and text through an alert dialog is ineffective.
... syntax text = range.to
string(); example html <p>this example logs <b>everything</b> between the bold <b>words</b>.
...And 2 more matches
SVGAnimatedString - Web APIs
the svganimated
string interface represents
string attributes which can be animated from each svg declaration.
... properties svganimated
string.animval read only this is a dom
string representing the animation value.
... svganimated
string.baseval this is a dom
string representing the base value.
...And 2 more matches
Selection.toString() - Web APIs
the selection.to
string() method returns a
string currently being represented by the selection object, i.e.
... syntax sel.to
string() 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().to
string()) // what is actually being effectively called.
...And 2 more matches
USVString - Web APIs
usv
string corresponds to the set of all possible sequences of unicode scalar values.
... usv
string 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.
... usv
string is equivalent to dom
string except for not allowing unpaired surrogate codepoints.
...And 2 more matches
XMLSerializer.serializeToString() - Web APIs
the xmlserializer method serializeto
string() constructs a
string representing the specified dom tree in xml form.
... syntax xml
string = anxmlserializer.serializeto
string(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 dom
string 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 toiso
string() 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.toiso
string() 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.toiso
string) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.prototype.toiso
string = 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 toiso
string() let today = ...
...And 2 more matches
Date.prototype.toUTCString() - JavaScript
the toutc
string() method converts a date to a
string, using the utc time zone.
... based on rfc7231 and modified according to ecma-262 toutc
string, it can have negative values in the 2021 version the source for this interactive example is stored in a github repository.
... syntax dateobj.toutc
string() return value a
string representing the given date using the utc time zone.
...And 2 more matches
RegExp.prototype.toString() - JavaScript
the to
string() method returns a
string representing the regular expression.
... syntax regexobj.to
string(); return value a
string representing the given object.
... description the regexp object overrides the to
string() method of the object object; it does not inherit object.prototype.to
string().
...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 &, and any " characters escaped as ".
... 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 to
string() method returns a
string representing the specified symbol object.
... syntax symbol().to
string() return value a
string representing the specified symbol object.
... description the symbol object overrides the to
string method of the object object; it does not inherit object.prototype.to
string().
...And 2 more matches
writeString - Archive of obsolete content
method of winprofile object syntax boolean write
string (
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 write
string method is similar to the windows api function writeprivateprofile
string.
...unlike the writeprivateprofile
string 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.write
string ("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_get
stringidentifier(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 np
string 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 np
string 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 _np
string { const nputf8 *utf8characters; uint32_t utf8length; } np
string; 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_exportfilemapas
string( 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_netaddrto
string( 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 getdeflatedutf8
stringlength(jsflat
string* s); name type description s jsflat
string * the pointer to the
string to calculate the length.
... description js::getdeflatedutf8
stringlength returns the length of the char buffer required to encode s as utf8.
... see also js::deflate
stringtoutf8buffer bug 1034627 ...
JS::StringValue
this article covers features introduced in spidermonkey 24 convert a js
string to a js::value.
... syntax js::value js::
stringvalue(js
string* str) name type description str js
string* a pointer to a js
string to convert.
... description js::
stringvalue converts a given js
string 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 jsflat
string * js_assert_
string_is_flat(js
string *str) { moz_assert(js_
stringisflat(str)); return (jsflat
string *)str; } name type description str js
string *
string to examine.
... description js_assert_
string_is_flat asserts the
string is flattened, and returns a pointer to jsflat
string.
... 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 js
string object.
... syntax js
string * js_getempty
string(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_getempty
string js_get
stringlength js_getempty
stringvalue bug 612150 ...
JS_GetEmptyStringValue
get the empty
string as a value of type js::value.
... syntax // added in spidermonkey 42 js::value js_getempty
stringvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getempty
stringvalue(jscontext *cx); name type description cx jscontext * a context.
... description js_getempty
stringvalue returns the empty
string as a js::value.
... see also mxr id search for js_getempty
stringvalue 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 js
stringfinalizer * js_getexternal
stringfinalizer(js
string *str); name type description str js
string * a
string to get finalizer.
... description js_getexternal
stringfinalizer returns the fin parameter passed to js_newexternal
string.
... see also mxr id search for js_ js_newexternal
string bug 724810 ...
JS_GetFlatStringChars
this article covers features introduced in spidermonkey 1.8.5 get the chars of a flat
string.
... use js_flatten
string to flatten the
string.
... syntax const jschar * js_getflat
stringchars(jsflat
string *str); name type description str jsflat
string * the flattended
string returned by js_flatten
string.
... description jsflat
string *fstr = js_flatten
string(cx, str); if (!fstr) return js_false; const jschar *chars = js_getflat
stringchars(fstr) js_assert(chars); see also js_flatten
string bug 1037869 ...
JS_IsExternalString
this article covers features introduced in spidermonkey 17 determines whether or not the specified js
string is an external
string (that is, a
string created by calling js_newexternal
string rather than js_newexternal
stringwithclosure).
... syntax bool js_isexternal
string(js
string *str); name type description str js
string * the
string to check.
... description js_isexternal
string returns true if the
string is an external
string; otherwise it's false.
... see also mxr id search for js_isexternal
string bug 651041 ...
JS_StringHasBeenInterned
this article covers features introduced in spidermonkey 17 determine if
string is interned.
... syntax bool js_
stringhasbeeninterned(jscontext *cx, js
string *str); name type description str js
string * 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(js
string *str); name type description str js
string *
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_versionto
string bug 824312 ...
JS_VersionToString
returns a
string representation of a jsversion value.
... syntax const char * js_versionto
string(jsversion version); name type description version jsversion version value to convert.
... description js_versionto
string attempts to convert the version to a const char *
string representation.
... js_versionto
string 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_c
stringclonedata function returns a null-terminated, heap allocated copy of the
string's internal buffer.
... #include "ns
stringapi.h" char* ns_c
stringclonedata( const nsac
string& a
string ); parameters a
string [in] a nsac
string instance whose data is to be cloned.
... return values the ns_c
stringcutdata function returns a pointer to a null-terminated, heap allocated buffer on success.
... see also nsmemory::free, nsac
string ...
NS_StringCloneData
« xpcom api reference summary the ns_
stringclonedata function returns a null-terminated, heap allocated copy of the
string's internal buffer.
... #include "ns
stringapi.h" prunichar* ns_
stringclonedata( const nsa
string& a
string ); parameters a
string [in] a nsa
string 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, nsa
string ...
NS_StringContainerFinish
« xpcom api reference summary the ns_
stringcontainerfinish function releases any memory allocated by a ns
stringcontainer instance.
... #include "ns
stringapi.h" void ns_
stringcontainerfinish( ns
stringcontainer& a
string ); parameters a
string [in] a ns
stringcontainer instance that is no longer needed.
... example code see ns_
stringcontainerinit for an example.
... see also ns_
stringcontainerinit ...
CSSOMString - Web APIs
cssom
string is used to denote
string data in cssom specifications and can refer to either dom
string or usv
string.
... when a specification says cssom
string, it depends on the browser vendors to choose whether to use dom
string or usv
string.
... while browser implementations that use utf-8 internally to represent
strings in memory can use usv
string when the specification says cssom
string, implementations that already represent
strings as 16-bit sequences might choose to use dom
string instead.
... implementation differences browser dom
string or usv
string for cssom
string firefox (gecko) usv
string chrome (blink) usv
string safari (webkit) usv
string edge (edgehtml) - opera (blink) usv
string specifications specification status comment css object model (cssom)the definition of 'cssom
string' in that specification.
DOMString - Web APIs
dom
string is a utf-16
string.
... as javascript already uses such
strings, dom
string is mapped directly to a
string.
... passing null to a method or parameter accepting a dom
string typically
stringifies to "null".
... specifications specification status comment web idlthe definition of 'dom
string' in that specification.
DOMStringList - Web APIs
a type returned by some apis which contains a list of dom
string (
strings).
... properties dom
stringlist.length read only returns the length of the list.
... methods dom
stringlist.item() returns a dom
string.
... dom
stringlist.contains() returns boolean indicating if the given
string is in the list specifications specification status comment html living standardthe definition of 'dom
stringlist' in that specification.
SpeechGrammarList.addFromString() - Web APIs
the addfrom
string() method of the speechgrammarlist interface takes a grammar present in a specific dom
string within the code base (e.g.
... syntax speechgrammarlistinstance.addfrom
string(
string,weight); returns void.
... parameters
string a dom
string 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.addfrom
string(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'addfrom
string()' 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 my
string = 'table of contents'; document.body.innerhtml = my
string.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 world
string = 'hello, world'; console.log(world
string.small()); // <small>hello, world</small> console.log(world
string.big()); // <big>hello, world</big> console.log(world
string.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 world
string = 'hello, world'; console.log(world
string.blink()); // <blink>hello, world</blink> console.log(world
string.bold()); // <b>hello, world</b> console.log(world
string.italics()); // <i>hello, world</i> console.log(world
string.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 world
string = 'hello, world'; console.log(world
string.blink()); // <blink>hello, world</blink> console.log(world
string.bold()); // <b>hello, world</b> console.log(world
string.italics()); // <i>hello, world</i> console.log(world
string.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).to
string(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 world
string = 'hello, world'; console.log(world
string.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 world
string = 'hello, world'; console.log(world
string.blink()); // <blink>hello, world</blink> console.log(world
string.bold()); // <b>hello, world</b> console.log(world
string.italics()); // <i>hello, world</i> console.log(world
string.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 world
string = 'hello, world'; console.log(world
string.small()); // <small>hello, world</small> console.log(world
string.big()); // <big>hello, world</big> console.log(world
string.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 world
string = 'hello, world'; console.log(world
string.blink()); // <blink>hello, world</blink> console.log(world
string.bold()); // <b>hello, world</b> console.log(world
string.italics()); // <i>hello, world</i> console.log(world
string.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_identifieris
string(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_hash
string(const void *key); parameter the function has the following parameter: key a pointer to a character
string.
... description pl_hash
string 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_importfilemapfrom
string( const char *fm
string ); parameter the function has the following parameter: fm
string a pointer to
string created by pr_exportfilemapas
string.
... description pr_importfilemapfrom
string creates a prfilemap object from a
string previously created by pr_exportfilemapas
string.
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 jserrorformat
string { const char *format; uint16_t argcount; int16_t exntype; } jserrorformat
string; name type description format const char * the error format
string in ascii.
... description jserrorformat
string is a struct to represent error message and type, returned by js_reporterrornumber function.
... see also mxr id search for jserrorformat
string jsexntype js_reporterrornumber bug 684526 ...
JS_FORGET_STRING_FLATNESS
this article covers features introduced in spidermonkey 1.8.5 convert jsflat
string to js
string.
... syntax static moz_always_inline js
string * js_forget_
string_flatness(jsflat
string *fstr) { return (js
string *)fstr; } name type description fstr jsflat
string * a
string to convert description js_forget_
string_flatness converts jsflat
string * to js
string *.
... see also mxr id search for js_forget_
string_flatness jsflat
string js
string bug 609440 ...
NS_CStringContainerFinish
« xpcom api reference summary the ns_c
stringcontainerfinish function releases any memory allocated by a nsc
stringcontainer instance.
... #include "ns
stringapi.h" void ns_c
stringcontainerfinish( nsc
stringcontainer& a
string ); parameters a
string [in] a nsc
stringcontainer instance that is no longer needed.
... see also ns_c
stringcontainerinit, ns_c
stringcontainerinit2 ...
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.get
string("propertyname"); //get a
string (and do something with it) alternative way let
stringbundleservice = cc["@mozilla.org/intl/
stringbundle;1"].getservice(ci.nsi
stringbundleservice); let bundle =
string...
...bundleservice.createbundle("chrome://your_extension/locale/overlay.properties"); let str = bundle.get
stringfromname("propertyname"); see nsi
stringbundleservice ...
ByteString - Web APIs
byte
string is a utf-8
string that corresponds to the set of all possible sequences of bytes.
... byte
string 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 'byte
string' in that specification.
FileReader.readAsBinaryString() - Web APIs
the readasbinary
string method is used to start reading the contents of the specified blob or file.
... syntax instanceoffilereader.readasbinary
string(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.readasbinary
string(blob); }); specifications specification status comment file apithe definition of 'readasbinary
string' in that specification.
URL.toString() - Web APIs
the url.to
string()
stringifier method returns a usv
string containing the whole url.
... syntax const href = url.to
string() return value a usv
string.
... examples const url = new url("/docs/web/api/url/to
string"); url.to
string(); // should return the url as a
string specifications specification status comment urlthe definition of '
stringifier' in that specification.
URLUtilsReadOnly.toString() - Web APIs
the urlutilsreadonly.to
string()
stringifier method returns a dom
string containing the whole url.
... syntax
string = object.to
string(); examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.to
string(); // 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 internetto
string 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
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 dom
stringmap 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 'dom
stringmap' in that specification.
HTMLHyperlinkElementUtils.toString() - Web APIs
the htmlhyperlinkelementutils.to
string()
stringifier method returns a usv
string containing the whole url.
... syntax
string = object.to
string(); examples // let's imagine an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils/to
string"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.to
string(); // returns: 'https://developer.mozilla.org/docs/htmlhyperlinkelementutils/to
string' specifications specification status comment html living standard living standard ...
Location: toString() - Web APIs
the to
string()
stringifier method of the location interface returns a usv
string containing the whole url.
... syntax
string = object.to
string(); examples // let's imagine an <a id="myanchor" href="https://developer.mozilla.org/docs/location/to
string"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.to
string(); // returns: 'https://developer.mozilla.org/docs/location/to
string' specifications specification status comment html living standard living standard ...
Map.prototype[@@toStringTag] - JavaScript
the map[@@to
stringtag] property has an initial value of "map".
... property attributes of map.prototype[@@to
stringtag] writable no enumerable no configurable yes syntax map[symbol.to
stringtag] examples using to
stringtag object.prototype.to
string.call(new map()) // "[object map]" specifications specification ecmascript (ecma-262)the definition of 'map.prototype[@@to
stringtag]' 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
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 sub
string ns
string findinreadable(const nsa
string& pattern, nsa
string::const_iterator start, nsa
string::const_iterator end, ns
stringcomparator& acomparator = nsdefault
stringcomparator()) 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 q
string int q
string::indexof ( const q
string & str, int from = 0, qt::casesensitivity cs = qt::casesensitive ) const format a printf style
string ns
string appendprintf() std::
string n/a q
string q
string & q
string::sprintf ( const char * cformat, ...
getFormattedString - Archive of obsolete content
« xul reference home getformatted
string( 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.
toString
this content is now available at nsisupportspruint8.to
string().
toString
this content is now available at nsisupports
string.to
string().
toString
documentation is now located at nsisupportsvoid.to
string().
Index - Web APIs
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
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::deflate
stringtoutf8buffer 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::deflate
stringtoutf8buffer jsapi reference, refere, spidermonkey js::deflate
stringtoutf8buffer 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 autf8
string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setitemannotation(in long long aitemid, in autf8
string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setpageannotation
string(in nsiuri auri, in autf8
string aname, in a
string avalue, in long aflags, in unsigned short aexpiration); boolean setitemannotatio...
...n
string(in long long aitemid, in autf8
string aname, in a
string avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint32(in nsiuri auri, in autf8
string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint32(in long long aitemid, in autf8
string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint64(in nsiuri auri, in autf8
string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint64(in long long aitemid, in autf8
string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationdouble(in nsiuri auri, in autf8
string aname, in double avalue, in long aflags,...
... in unsigned short aexpiration); void setitemannotationdouble(in long long aitemid, in autf8
string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setpageannotationbinary(in nsiuri auri, in autf8
string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8
string amimetype, in long aflags, in unsigned short aexpiration); void setitemannotationbinary(in long long aitemid, in autf8
string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8
string amimetype, in long aflags, in unsigned short aexpiration); nsivariant getpageannotation(in nsiuri auri, in autf8
string aname); nsivariant getitemannotation(in long long aitemid, in autf8
string 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 byte
string const nsac
string& nsc
string& (outparam) nsac
string& (outparam) nsc
string date mozilla::dom::date dom
string const nsa
string& mozilla::dom::dom
string& (outparam) nsa
string& (outparam) ns
string& (outparam) ns
string utf8
string const nsac
string& nsac
string& (outparam) nsc
string 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 usv
string const nsa
string& mozilla::dom::dom
string& (outparam) nsa
string& (outparam) ns
string& (outparam) ns
string 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); dom
string strings are reflected in three different ways, depending on use:
string arguments become const nsa
string&.
...And 45 more matches
nsIVariant
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview ac
string getasac
string(); native code only!
... nsresult getasarray(out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr); violates the xpcom interface guidelines a
string getasa
string(); native code only!
... autf8
string getasautf8
string(); 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 w
string 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 get
stringpref(in
string aprefname, [optional] in utf8
string 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 set
stringpref(in
string aprefname, in utf8
string 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 query
string 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 a
string, [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 getindentation
string();
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 a
string aattribute, in a
string avalue); void addinsertionlistener(in nsicontentfilter infilter); void align(in a
string aalign); boolean breakisvisible(in nsidomnode anode); boolean candrag(in nsidomevent aevent); void checkselectionstateforanonymousbuttons(in nsiselection aselection); nsidomelement createanonymouselement(in a
string atag, in nsidomnode aparentnode, in a
string aanonclass, in boolean aiscreatedhidden); nsidomelement createelementwithdefaults(in a
string at...
...agname); void decreasefontsize(); void dodrag(in nsidomevent aevent); void getalignment(out boolean amixed, out short aalign); a
string getbackgroundcolorstate(out boolean amixed); nsidomelement getelementorparentbytagname(in a
string atagname, in nsidomnode anode); a
string getfontcolorstate(out boolean amixed); a
string getfontfacestate(out boolean amixed); a
string getheadcontentsashtml(); a
string gethighlightcolorstate(out boolean amixed); void getindentstate(out boolean acanindent, out boolean acanoutdent); void getinlineproperty(in nsiatom aproperty, in a
string aattribute, in a
string avalue, out boolean afirst, out boolean aany, out boolean aall); a
string getinlinepropertywithattrvalue(in...
... nsiatom aproperty, in a
string aattribute, in a
string avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); a
string getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in a
string atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignorespuriousdragevent); void increasefontsize(); void indent(in a
string 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.to
string = 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 my
string by using the new operator with the java constructor, as follows: var my
string = new java.lang.
string("hello world"); in the previous example, the variable my
string is a javaobject because it holds an instance of the java object
string.
... as a javaobject, my
string 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: my
string.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 a
string index
string); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in a
string property, in a
string value1, in a
string value2); nsicomposition
stringsynthesizer createcomposition
stringsynth...
...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 a
string index
string); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); a
string getdocumentmetadata(in a
string aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); a
string getpccountscriptsummary(in long ascript); a
string getpccoun...
...tscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); a
string getvisiteddependentcomputedstyle(in nsidomelement aelement, in a
string apseudoelement, in a
string 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 replacesub
string 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 nsauto
string data members no public members.
... methods constructors void ns_convertasciitoutf16(const char*) - source parameters char* ac
string void ns_convertasciitoutf16(const char*, pruint32) - source parameters char* ac
string pruint32 alength void ns_convertasciitoutf16(const nsac
string_internal&) - source parameters nsac
string_internal& ac
string operator= nsauto
string& operator=(const nsauto
string&) - source parameters nsauto
string& str ns
string& operator=(const ns
string&) - source parameters ns
string& str nsa
string_internal& operator=(prunichar) - source parameters prunichar c nsa
string_internal& operator=(const prunichar*) - source parameters prunichar* data nsa
string_internal& operator=(const nsa
string_internal&) - source parameters nsa
string_internal& str nsa
string_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 ns
string_external data members no public members.
... methods constructors void ns_convertasciitoutf16_external(const nsac
string&) - source parameters nsac
string& astr void ns_convertasciitoutf16_external(const char*, pruint32) - source parameters char* adata pruint32 alength get prunichar* get() const - source operator= ns
string_external& operator=(const ns
string_external&) - source parameters ns
string_external& a
string nsa
string& operator=(const nsa
string&) - source parameters nsa
string& a
string nsa
string& operator=(const prunichar*) - source parameters prunichar* aptr nsa
string& 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 replacesub
string 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 nscauto
string 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* a
string void ns_convertutf16toutf8(const prunichar*, pruint32) - source parameters prunichar* a
string pruint32 alength void ns_convertutf16toutf8(const nsa
string_internal&) - source parameters nsa
string_internal& a
string operator= nscauto
string& operator=(const nscauto
string&) - source parameters nscauto
string& str nsc
string& operator=(const nsc
string&) - source parameters nsc
string& str nsac
string_internal& operator=(char) - source parameters char c nsac
string_internal& operator=(const char*) - source parameters char* data nsac
string_internal& operator=(const nsac
string_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 replacesub
string 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 nsauto
string data members no public members.
... methods constructors void ns_convertutf8toutf16(const char*) - source parameters char* ac
string void ns_convertutf8toutf16(const char*, pruint32) - source parameters char* ac
string pruint32 alength void ns_convertutf8toutf16(const nsac
string_internal&) - source parameters nsac
string_internal& ac
string operator= nsauto
string& operator=(const nsauto
string&) - source parameters nsauto
string& str ns
string& operator=(const ns
string&) - source parameters ns
string& str nsa
string_internal& operator=(prunichar) - source parameters prunichar c nsa
string_internal& operator=(const prunichar*) - source parameters prunichar* data nsa
string_internal& operator=(const nsa
string_internal&) - source parameters nsa
string_internal& str nsa
string_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 ns
string_external data members no public members.
... methods constructors void ns_convertutf8toutf16_external(const nsac
string&) - source parameters nsac
string& astr void ns_convertutf8toutf16_external(const char*, pruint32) - source parameters char* adata pruint32 alength get prunichar* get() const - source operator= ns
string_external& operator=(const ns
string_external&) - source parameters ns
string_external& a
string nsa
string& operator=(const nsa
string&) - source parameters nsa
string& a
string nsa
string& operator=(const prunichar*) - source parameters prunichar* aptr nsa
string& 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 replacesub
string 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 nscauto
string 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* a
string void ns_lossyconvertutf16toascii(const prunichar*, pruint32) - source parameters prunichar* a
string pruint32 alength void ns_lossyconvertutf16toascii(const nsa
string_internal&) - source parameters nsa
string_internal& a
string operator= nscauto
string& operator=(const nscauto
string&) - source parameters nscauto
string& str nsc
string& operator=(const nsc
string&) - source parameters nsc
string& str nsac
string_internal& operator=(char) - source parameters char c nsac
string_internal& operator=(const char*) - source parameters char* data nsac
string_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 a
string str); obsolete since gecko 7.0 jsval decodetojsval(in a
string str, in jscontext cx); native code only!
... jsobject decodefromstream(in nsiinputstream stream, in long contentlength); a
string encode(in jsobject value); obsolete since gecko 7.0 a
string 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 a
string relpath, in unsigned long mode); nsiwindowsregkey createchild(in a
string relpath, in unsigned long mode); a
string getchildname(in unsigned long index); a
string getvaluename(in unsigned long index); unsigned long getvaluetype(in a
string name); boolean haschanged(); boolean haschild(in a
string name); boolean hasvalue(in a
string name); ...
... boolean iswatching(); void open(in unsigned long rootkey, in a
string relpath, in unsigned long mode); nsiwindowsregkey openchild(in a
string relpath, in unsigned long mode); ac
string readbinaryvalue(in a
string name); unsigned long long readint64value(in a
string name); unsigned long readintvalue(in a
string name); a
string read
stringvalue(in a
string name); void removechild(in a
string relpath); void removevalue(in a
string name); void startwatching(in boolean recurse); void stopwatching(); void writebinaryvalue(in a
string name, in ac
string data); void writeint64value(in a
string name, in unsigned long long data); void writeintvalue(in a
string name, in unsigned long data); ...
... void write
stringvalue(in a
string name, in a
string 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 nsc
string_external data members no public members.
... methods constructors void ns_convertutf16toutf8_external(const nsa
string&) - source parameters nsa
string& astr void ns_convertutf16toutf8_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get char* get() const - source operator= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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 nsc
string_external data members no public members.
... methods constructors void ns_lossyconvertutf16toascii_external(const nsa
string&) - source parameters nsa
string& astr void ns_lossyconvertutf16toascii_external(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength get char* get() const - source operator= nsc
string_external& operator=(const nsc
string_external&) - source parameters nsc
string_external& a
string nsac
string& operator=(const nsac
string&) - source parameters nsac
string& a
string nsac
string& operator=(const char*) - source parameters char* aptr nsac
string& 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 dom
string name, in dom
string value); nsidomnodelist getelementsbyattributens(in dom
string namespaceuri, in dom
string name, in dom
string value); attributes attribute type description align dom
string 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 dom
string 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 a
string foldername, in nsimsgwindow msgwindow); nsimsgfolder addsubfolder(in a
string 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 a
string name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); a
string generateuniquesubfoldername(in a
string 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); ac
string 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 a
string akey); void deletewindowvalue(in nsidomwindow awindow, in a
string akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long aindex); nsidomnode forgetclosedwindow(in unsigned long aindex); a
string getbrowserstate(); unsigned long getclosedtabcount(in nsi...
...domwindow awindow); a
string getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); a
string getclosedwindowdata(); a
string gettabstate(in nsidomnode atab); a
string gettabvalue(in nsidomnode atab, in a
string akey); a
string getwindowstate(in nsidomwindow awindow); a
string getwindowvalue(in nsidomwindow awindow, in a
string akey); void init(in nsidomwindow awindow); void persisttabattribute(in a
string aname); void restorelastsession(); void setbrowserstate(in a
string astate); void settabstate(in nsidomnode atab, in a
string astate); void settabvalue(in nsidomnode atab, in a
string akey, in a
string a
stringvalue); void setwindowstate(in nsidomwindow ...
...awindow, in a
string astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in a
string akey, in a
string a
stringvalue); 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.setpendingcomposition
string("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); a
string makefulladdress(in a
string aname, in a
string aaddress);
string makefulladdress
string(in
string aname, in
string aaddress); w
string makefulladdressw
string(in w
string...
... name, in w
string addr); obsolete since gecko 1.9 void parseheaderaddresses(in
string line, out
string names, out
string addresses, out pruint32 numaddresses); void parseheaderswitharray(in w
string aline, [array, size_is(count)] out w
string aemailaddresses, [array, size_is(count)] out w
string anames, [array, size_is(count)] out w
string afullnames, [retval] out unsigned long count); void reformatheaderaddresses(in
string line, out
string reformattedaddress); w
string reformatunquotedaddresses(in w
string line); void removeduplicateaddresses(in
string addrs, in
string other_addrs, in prbool removealiasestome, out
string newaddress);
string unquotephraseoraddr(in
string line, in boolean preserveintegrity); w
string unquotephraseoraddrwstri...
...ng(in w
string 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","to
string","unshift","valueof"],
string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","sub
string","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).to
string(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 a
string aname, in nsicontentprefobserver aobserver); nsivariant getpref(in nsivariant agroup, in a
string aname, [optional] in nsicontentprefcallback acallback); nsipropertybag2 getprefs(in nsivariant agroup); nsipropertybag2 getprefsbyname(in a
string aname); boolean haspref(in nsivariant agroup, in a
string aname); void removegroupedprefs(); void rem...
...oveobserver(in a
string aname, in nsicontentprefobserver aobserver); void removepref(in nsivariant agroup, in a
string aname); void removeprefsbyname(in a
string aname); void setpref(in nsivariant agroup, in a
string aname, in nsivariant avalue); attributes attribute type description dbconnection mozistorageconnection the database connection to the content preferences database.
...void addobserver( in a
string 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_of
strings = 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_of
strings.addressofelement(0).contents.read
string(); // outputs: "rawr" mycarray_of
strings.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 "nsa
string.h"- #include "ns
string.h"- #include "nsreadableutils.h"- #include "nsescape.h" + #include "ns
stringapi.h" on windows, if you see the following error, you are including a header you shouldn't be: ns
stringfwd.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) nsxpidl
string: - nsxpidl
string value; + ns
string value; ptr->gettermethod(getter_copies(value)); - const prunichar *strvalue = value; + // ns
string 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 autf8
string aname, in a
string 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 autf8
string 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 a
string asubfolder); obsolete since gecko 2.0 long long getfolderidforitem(in long long aitemid); boolean getfolderreadonly(in long long aitemid); a
string 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); a
string getitemguid(in long long aitemid); obsolete since gecko 14.0 long long getitemidforguid(in a
string aguid); obsolete since gecko 14.0 long getitemindex(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8
string getitemtitle(in long long aitemid); unsigned short getitemtype(in long long aitemid); a
string getkeywordforbookmark(in long long aitemid); obsolete since gecko 40.0 a
string getkeywordforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in a
string 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 w
string adialogtitle, in w
string atext); void alertcheck(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext, in w
string acheckmsg, inout boolean acheckstate); boolean confirm(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext); boolean confirmcheck(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext, in w
string acheckmsg, inout boo...
...lean acheckstate); print32 confirmex(in nsidomwindow aparent,in w
string adialogtitle,in w
string atext, in unsigned long abuttonflags,in w
string abutton0title, in w
string abutton1title,in w
string abutton2title,in w
string acheckmsg, inout boolean acheckstate); boolean prompt(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext, inout w
string avalue, in w
string acheckmsg, inout boolean acheckstate); boolean promptusernameandpassword(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext, inout w
string ausername, inout w
string apassword, in w
string acheckmsg, inout boolean acheckstate); boolean promptpassword(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext, inout w
string apassword, in w
string acheckmsg, inout boolean ac...
...heckstate); boolean select(in nsidomwindow aparent, in w
string adialogtitle, in w
string atext, in pruint32 acount, [array, size_is(acount)] in w
string 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 a
string getproperty(in
string propertyname); void setproperty(in
string propertyname, in a
string propertystr); void set
stringproperty(in
string propertyname, in
string propertyvalue);
string get
stringproperty(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 setpriority
string(in
string priority); unsigned long orflags(in unsigned long flags); unsigned long andflags(in unsigned long flags); void setreferences(in
string references); ac
string get
stringreference(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 dom
string representing a single character that switches input focus to the hyperlink.
... htmlanchorelement.download is a dom
string indicating that the linked resource is intended to be downloaded rather than displayed in the browser.
... htmlhyperlinkelementutils.hash is a usv
string 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 read
string 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.read
string(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 .to
string()/.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_versionto
string 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 jserrorformat
string 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 ac
string acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in ac
string aurl); void loadurl(in nsidomwindow ptr, in ac
string aurl); void launchexternalurl(in ac
string 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 ac
string characterset); void saveas(in ac
string auri, in boolean aasfile, in nsimsgidentity aidentity, in a
string amsgfilename); void openattachment(in ac
string contenttpe, in ac
string url, in ac
string displayname, in ac
string messageuri, in boolean isexternalattachment); void saveattachment(in ac
string contenttpe, in ac
string url, in ac
string displayname, in ac
string 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 ac
string aurl, in ac
string amessageuri, in ac
string 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 getformatted
string(
string key,
string params);
string get
string(
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
nsi
stringenumerator / nsiutf8
stringenumerator - 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 ns
string& amedium); private: nstarray<ns
string> mmedia; }; // typesafety of mmedia ensures that we only append an ns
string void nodecontainer::addmedium(const ns
string& 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(); a
string generateprettynameformigration(); boolean getboolattribute(in
string name); boolean getboolvalue(in
string attr); ac
string getcharattribute(in
string name); ac
string 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 ac
string auri); void getnewmessages(in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); ac
string getpasswordwithui(in a
string aprompt
string, in a
string aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); a
string getunicharattribute(in
string name); a
string getunicharvalue(in
string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in ac
string oldname, in ac
string 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 ac
string value); void setcharvalue(in
string attr, in ac
string 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 a
string value); void setunicharvalue(in
string attr, in a
string value); void shutdown(); void storepassword(); a
string to
string(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome a
string 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); autf8
string resolve(in autf8
string relativepath); boolean schemeis(in
string scheme); attributes attribute type description asciihost ac
string the uri host with an ascii compatible encoding.
... asciispec ac
string (us-ascii) the uri spec with an ascii compatible encoding.
... host autf8
string 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 to
string() 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 dom
string 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 dom
string 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 sub
string 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 scrollsub
stringto([in] long startindex, [in] long endindex, [in] enum ia2scrolltype scrolltype ); hresult scrollsub
stringtopoint([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 autf8
string 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 dom
string containing a single character that switches input focus to the control.
... htmlareaelement.alt is a dom
string that reflects the alt html attribute, containing alternative text for the element.
... htmlareaelement.coords is a dom
string 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 bind
stringbyindex(in unsigned long aindex, in a
string avalue); native code only!
... void bindutf8
stringbyindex(in unsigned long aindex, in autf8
string avalue); native code only!
... void bindbyname(in autf8
string aname, in nsivariant avalue); void bindblobbyname(in autf8
string aname, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyname(in autf8
string 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 ac
string finish(in prbool aascii); void init(in unsigned long aalgorithm); void initwith
string(in ac
string 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...
... ac
string 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 dom
string object that contains the serialization of the <counter-style-name> defined for the associated rule.
... csscounterstylerule.system is a dom
string 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 dom
string 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 dom
string specifying the cors setting for this image element.
... htmlimageelement.currentsrc read only returns a usv
string 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 usv
string 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 usv
string 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.get
string("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 a
string name, in nsicontentprefobserver observer); void getbydomainandname(in a
string domain, in a
string name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void getbysubdomainandname(in a
string domain, in a
string name, in nsiloadcontext context, in nsicontentprefcallback2 callback); nsicontentpref getcachedbydomainandname(in a
string doma...
...in, in a
string name, in nsiloadcontext context); void getcachedbysubdomainandname(in a
string domain, in a
string name, in nsiloadcontext context, out unsigned long len, [retval,array,size_is(len)] out nsicontentpref prefs); nsicontentpref getcachedglobal(in a
string name, in nsiloadcontext context); void getglobal(in a
string 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 a
string domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); ...
... void removebydomainandname(in a
string domain, in a
string name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebyname(in a
string name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebysubdomain(in a
string domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebysubdomainandname(in a
string domain, in a
string name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeglobal(in a
string name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeobserverforname(in a
string 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 dom
string commandid, in boolean doshowui, in dom
string value); boolean execcommandshowhelp(in dom
string commandid); obsolete since gecko 14.0 dom
string getselection(); nsidomdocument open(in ac
string acontenttype, in boolean areplace); boolean querycommandenabled(in dom
string commandid); boolean querycommandindeterm(in dom
string commandid); boolean quer...
...ycommandstate(in dom
string commandid); boolean querycommandsupported(in dom
string commandid); dom
string querycommandtext(in dom
string commandid); obsolete since gecko 14.0 dom
string querycommandvalue(in dom
string 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 dom
string same as body.alink bgcolor dom
string same as body.bgcolor compatmode dom
string returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode.
... designmode dom
string 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); a
string getcellproperties(in long row, in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); a
string getcelltext(in long row, in nsitreecolumn col); a
string getcellvalue(in long row, in nsitreecolumn col); a
string getcolumnproperties(in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); a
string 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); a
string 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 w
string action); void performactiononcell(in w
string action, in ...
...long row, in nsitreecolumn col); void performactiononrow(in w
string action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in a
string value); void setcellvalue(in long row, in nsitreecolumn col, in a
string 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 autf8
string.
... method overview void close(); void extract(in autf8
string zipentry, in nsifile outfile); void extract(in
string zipentry, in nsifile outfile); obsolete since gecko 10 nsiutf8
stringenumerator findentries(in autf8
string apattern); nsiutf8
stringenumerator findentries(in
string apattern); obsolete since gecko 10 nsiprincipal getcertificateprincipal(in autf8
string aentryname); nsiprincipal getcertificateprincipal(in
string aentryname); obsolete since gecko 10 nsizipentry getentry(in autf8
string zipentry); nsizipentry getentry(in str...
...ing zipentry); obsolete since gecko 10 nsiinputstream getinputstream(in autf8
string zipentry); nsiinputstream getinputstream(in
string zipentry); obsolete since gecko 10 nsiinputstream getinputstreamwithspec(in autf8
string ajarspec, in autf8
string zipentry); nsiinputstream getinputstreamwithspec(in autf8
string ajarspec, in
string zipentry); obsolete since gecko 10 boolean hasentry(in autf8
string zipentry); void init(in nsifile zipfile); obsolete since gecko 1.9 void open(in nsifile zipfile); void openinner(in nsizipreader zipreader, in autf8
string zipentry); void openinner(in nsizipreader zipreader, in
string zipentry); obsolete since gecko 10 void test(in autf8
string 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.todate
string() 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
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 usv
string 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.) js
string *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 autf8
string asqlstatement); obsolete since gecko 1.9.1 void finalize(); mozistoragestatement clone(); autf8
string getparametername(in unsigned long aparamindex); unsigned long getparameterindex(in autf8
string aname); autf8
string getcolumnname(in unsigned long acolumnindex); unsigned long getcolumnindex(in autf8
string aname); void reset(); ...
... a
string escape
stringforlike(in a
string avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8
stringparameter(in unsigned long aparamindex, in autf8
string avalue); void bind
stringparameter(in unsigned long aparamindex, in a
string 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 autf8
string 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 w
string word); boolean canspellcheck(); void checkcurrentdictionary(); boolean checkcurrentword(in w
string suggestedword); boolean checkcurrentwordnosuggest(in w
string suggestedword); a
string getcurrentdictionary(); void getdictionarylist([array, size_is(count)] out w
string dictionarylist, out pruint32 count); w
string getnextmisspelledword...
...(); void getpersonaldictionary(); w
string getpersonaldictionaryword(); w
string getsuggestedword(); void ignorewordalloccurrences(in w
string word); void initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void removewordfromdictionary(in w
string word); void replaceword(in w
string misspelledword, in w
string replaceword, in boolean alloccurrences); void savedefaultdictionary(); obsolete since gecko 9.0 void setcurrentdictionary(in a
string dictionary); void setfilter(in nsitextservicesfilter filter); void uninitspellchecker(); void updatecurrentdictionary(); methods addwordtodictionary() adds the specified word to the current personal dictionary.
... void addwordtodictionary( in w
string 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 geterror
stringbundle(in short errormodule);
string geterror
stringbundlekey(in nsresult error); void registererror
stringbundle(in short errormodule, in
string stringbundleurl); void registererror
stringbundlekey(in nsresult error, in
string stringbundlekey); void unregistererror
stringbundle(in short errormodule); void unregistererror
stringbundlekey(in nsresult error); methods geterror
stringbundle() 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 ac
string relativefilepath); native code only!
... void appendrelativepath(in a
string relativefilepath); ac
string getrelativedescriptor(in nsilocalfile fromfile); void initwithfile(in nsilocalfile afile); void initwithnativepath(in ac
string filepath); native code only!
... void initwithpath(in a
string 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); a
string getunicharattribute(in
string name); void setunicharattribute(in
string name, in a
string value); ac
string getcharattribute(in
string name); void setcharattribute(in
string name, in ac
string 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); a
string to
string(); attributes attribute type description identityname a
string fullname a
string user's full name, i.e.
... john doe email a
string 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 autf8
string name, in nsivariant defaultvalue); [noscript] a
string getpropertyasa
string(in
string name); [noscript] autf8
string getpropertyasautf8
string(in
string name); [noscript] pruint32 getpropertyasuint32(in
string name); [noscript] boolean getpropertyasbool(in
string name); void setproperty(in autf8
string name, in nsivariant value); [noscript] void s...
...etpropertyasa
string(in
string name, in a
string value); [noscript] void setpropertyasautf8
string(in
string name, in autf8
string value); [noscript] void setpropertyasuint32(in
string name, in pruint32 value); [noscript] void setpropertyasbool(in
string name, in boolean value); void deleteproperty(in autf8
string name); autf8
string translateto(in autf8
string atype); void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) a
string 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 a
string shorthand for getproperty and setproperty.
...And 15 more matches
Using the clipboard
this component implements the interface nsiclipboardhelper, which has a function copy
string that can be used to copy a
string.
... const gclipboardhelper = components.classes["@mozilla.org/widget/clipboardhelper;1"] .getservice(components.interfaces.nsiclipboardhelper); gclipboardhelper.copy
string("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 autf8
string or ac
string 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 w
string const char16_t* char16_t**
string full unicode set permitted most of the time you don't want to use this type but a
string.
...ns[c]
string, refptr<t>, or uint32_t)
string, w
string, [ptr] native and [ref] native are unsupported as element types.
...And 15 more matches
Add to iPhoto
among these are routines for managing cf
string, cfurl, and cfarray objects, among others.
... cf
string a cf
string 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 cf
strings, 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().tolocaletime
string(); 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); a
string gettext(in long startoffset, in long endoffset); a
string gettextafteroffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); a
string 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); a
string gettextbeforeoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); void removeselection(in long selectionnum); void scrollsub
stringto(in long startindex, in long endindex, in unsigned long scrolltype); void scrollsub
stringtopoint(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 ac
string charset, out boolean overriden); void getcharactersetoverride(out boolean charactersetoverride); obsolete since gecko 1.8
string getcharptrcharacterset();
string getcharptrproperty(in
string propertyname); void getlocale(in ns
string result); nat...
...obsolete since gecko 1.8 void getmailboxname(in ns
string boxname); native code only!
... obsolete since gecko 1.8 a
string 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 autf8
string url); autf8
string geturlspecfromactualfile(in nsifile file); autf8
string geturlspecfromdir(in nsifile file); autf8
string 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 autf8
string 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 a
string prop); ac
string getpropertyasac
string(in a
string prop); a
string getpropertyasa
string(in a
string prop); autf8
string getpropertyasautf8
string(in a
string prop); boolean getpropertyasbool(in a
string prop); double getpropertyasdouble(in a
string prop); print32 getpropertyasint32(in a
string prop); print64 getpropertyasint64(in a
string prop); void getpropertyasinterface(in a
string prop, in nsiidref iid, [iid_is(iid), retval] out nsqiresult result); pruint32 getprope...
...rtyasuint32(in a
string prop); pruint64 getpropertyasuint64(in a
string prop); prbool haskey(in a
string prop); methods get() this method returns null if the value does not exist, or exists but is null.
... nsivariant get( in a
string prop ); parameters prop property to return the value of.
...And 14 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
<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 nsisupports
string 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} search
string * @param {number} searchresult * @param {number} defaultindex * @param {
string} errordescription * @param {array.<
string>} results * @param {array.<
string>|null=} comments */ function providerautocompleteresult(search
string, searchresult, defaultindex, errordescription, results, comments) { this._search
string = search
string; this._searchresult = searchresult; this._def...
...aultindex = defaultindex; this._errordescription = errordescription; this._results = results; this._comments = comments; } providerautocompleteresult.prototype = { _search
string: "", _searchresult: 0, _defaultindex: 0, _errordescription: "", _results: [], _comments: [], /** * @return {
string} the original search
string */ get search
string() { return this._search
string; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid search
string) * 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 readinputstreamto
string(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 autf8
string afunctionname, in long anumarguments, in mozistorageaggregatefunction afunction); mozistorageasyncstatement createasyncstatement(in autf8
string asqlstatement); void createfunction(in autf8
string afunctionname, in long anumarguments, in mozistoragefunction afunction); mozistoragestatement createstatement(in autf8
string 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 autf8
string asqlstatement); boolean indexexists(in autf8
string aindexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8
string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8
string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boole...
...an tableexists(in autf8
string 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 getcookie
string(in nsiuri auri, in nsichannel achannel);
string getcookie
stringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel); void setcookie
string(in nsiuri auri, in nsiprompt aprompt, in
string acookie, in nsichannel achannel); void setcookie
stringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in
string acookie, in
string as...
... methods getcookie
string() 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 a
string alocation, in a
string afilename); nsifile getfilewithpath(in a
string afilepath); nsisupports newinputstream(in nsivariant abase, in a
string amode, [optional] in a
string acharset, [optional] in a
string areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant abase, in a
string amode, [optional] in a
string achar...
...set, [optional] in a
string 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 autf8
string getcommonbasespec(in nsiuri auritocompare); autf8
string getrelativespec(in nsiuri auritocompare); attributes attribute type description directory autf8
string 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 autf8
string 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 a
string the application version of this update.
... billboardurl a
string the url to a page that is typically localized to display in the update prompt.
... buildid a
string 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 sub
string 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 sub
string 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 dom
string representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... htmlobjectelement.archive is a dom
string that reflects the archive html attribute, containing a list of archives for resources for this object.
... htmlobjectelement.border is a dom
string 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 to
string 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 hwnd
string = 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(hwnd
string)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.to
string()); 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(nsc
string 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 nsc
string& 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 nsc
string& 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 dom
string apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in dom
string 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 w
string aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in dom
string 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); a
string 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 dom
string apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in a
string apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in dom
string ainput); void removepseudoclasslock(in nsidomelement aelement, in dom
string apseudoclass); a
string rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in dom
string 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 w
string message, in w
string sourcename, in w
string sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in
string category); void initwithwindowid(in w
string message, in w
string sourcename, in w
string sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in
string category, in unsigned long long innerwindowid); autf8
string to
string(...
...); attributes attribute type description category
string a
string indicating the category of error that occurred see categories for a list.
... errormessage a
string the error message in a
string format without any context/line number information.
...And 12 more matches
nsIUpdateItem
method overview void init(in a
string id, in a
string version, in a
string installlocationkey, in a
string minappversion, in a
string maxappversion, in a
string name, in a
string downloadurl, in a
string xpihash, in a
string iconurl, in a
string updateurl, in a
string updatekey, in long type, in a
string targetappid); attributes attribute type description iconurl a
string the url of the icon that can be show...
... id a
string the guid of the item.
... installlocationkey a
string 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); ac
string 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 ac
string aemailaddress, in ac
string apassword, in ac
string afirstname, in ac
string alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequ...
...estobserver acallback); ac
string providerurlforerror(in unsigned long aerror); attributes attribute type description type ac
string 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, msg
string) { var isunique = true; var i; for (i=0; i<connectionarray.length; i++) { if (connectionarray[i].username === target) { connectionarray[i].send(msg
string); 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
value a dom
string 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 dom
string 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 sub
string matches, if any.
... input the
string against which a regular expression is matched.
... lastparen the last parenthesized sub
string 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 to
string is a property (to be specific, however, to
string() is a method).
... the 2 in years[2] is coerced into a
string by the javascript engine through an implicit to
string conversion.
...And 12 more matches
Index - XPath
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.to
string());" + "}, 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 byte
string (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.to
string(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 dom
string, 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<dom
string> echo(dom
string some
string); }; 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 new
string(cdata ajenv,
string astr);
string read
string(cdata ajenv, cdata ajava
string); void unloadclasses(); methods getforthread() blah blah cdata getforthread(); parameters this function does not take any arguments.
... return value blah blah new
string() blah blah cdata new
string( 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 to
string 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 dom
string getattribute(in dom
string name); nsidomattr getattributenode(in dom
string name); nsidomattr getattributenodens(in dom
string namespaceuri, in dom
string localname); dom
string getattributens(in dom
string namespaceuri, in dom
string localname); nsidomnodelist getelementsbytagname(in dom
string name); nsidomnodelist getelementsbytagnamens(in dom
string namespaceuri, in dom
string localname); boolean hasattribute(in dom
string name); boolean hasattributens(in dom
string namespaceuri, in dom
string localname); void removeattribute(in dom
string name) nsidomattr removeattributenode(in ns...
...idomattr oldattr) void removeattributens(in dom
string namespaceuri, in dom
string localname) void setattribute(in dom
string name, in dom
string value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in dom
string namespaceuri, in dom
string qualifiedname, in dom
string value) attributes attribute type description tagname dom
string the element tag name.
...dom
string getattribute( in dom
string name ); parameters name attribute name return value a dom
string 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 ac
string getbasedomain(in nsiuri auri, [optional] in pruint32 aadditionalparts); ac
string getbasedomainfromhost(in autf8
string ahost, [optional] in pruint32 aadditionalparts); ac
string getpublicsuffix(in nsiuri auri); ac
string getpublicsuffixfromhost(in autf8
string ahost); methods getbasedomain() returns the base domain of a uri; that is, the public suffix with a given ...
... ac
string 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 ac
string aheader, in nsihttpheadervisitor avisitor); ac
string getrequestheader(in ac
string aheader); ac
string getresponseheader(in ac
string header); boolean isnocacheresponse(); boolean isnostoreresponse(); void redirectto(in nsiuri anewuri); void setemptyrequestheader(in ac
string aheader); void setreferrerwithpolicy(in nsiuri referrer, in ...
...unsigned long referrerpolicy); void setrequestheader(in ac
string aheader, in ac
string avalue, in boolean amerge); void setresponseheader(in ac
string header, in ac
string 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 ac
string 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 a
string asearch
string, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in a
string ahostname, in a
string aactionurl, in a
string ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in a
string ahostname, in a
string aactionurl, in a
string ahttprealm, [retval, array, size_is...
...(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out w
string hostnames); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in a
string 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 a
string ahost, in boolean isenabled); methods addlogin() stores a new login in the login manager.
... nsiautocompleteresult autocompletesearch( in a
string asearch
string, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearch
string 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 a
string ahostname, in a
string aactionurl, in a
string ahttprealm); void findlogins(out unsigned long count, in a
string ahostname, in a
string aactionurl, in a
string ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out w
string 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 a
string 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 a
string ahost, in boolean isenabled); attributes attribute type description uibusy boolean true when a master password prompt is being shown.
...unsigned long countlogins( in a
string ahostname, in a
string aactionurl, in a
string 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 ac
string aguid, in ac
string 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 ac
string 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 autf8
string atitle, in prtime adateadded, in ac
string aguid, in ac
string aparentguid); void onitemchanged(in long long aitemid, in ac
string aproperty, in boolean aisannotationproperty, in autf8
string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in ac
string aguid, in ac
string 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 ac
string aguid, in ac
string aoldparentguid, in ac
string anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in ac
string aguid, in ac
string 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 ac
string aguid, in ac
string 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 dom
string objects providing each line of the address not included among the other properties.
... paymentaddress.country read only a dom
string 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 dom
string 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
(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
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 to
string(); 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_add
stringroot, js_remove
stringroot, etc.) that are easier to use correctly.
... js_get
stringbytes and js_get
stringchars are gone.
... there is no longer an infallible way to examine
string characters.
...And 10 more matches
XPCOM Stream Guide
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) ns
stringstream @mozilla.org/io/
string-input-stream;1 nsi
stringinputstream 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.nsi
stringinputstream); 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 a
string getcardvalue(in
string name) void setcardvalue(in
string attrname, in a
string value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card)
string converttobase64encodedxml() a
string converttoxmlprintdata()
string converttoescapedvcard() a
string generatename(in long agenerateformat,[optional] in nsi
stringbundle abundle) ...
... a
string generatephoneticname(in boolean alastnamefirst) attributes attribute type description firstname a
string lastname a
string phoneticfirstname a
string phoneticlastname a
string displayname a
string nickname a
string primaryemail a
string secondemail a
string workphone a
string homephone a
string faxnumber a
string pagernumber a
string cellularnumber a
string workphonetype a
string homephonetype a
string faxnumbertype a
string pagernumbertype a
string cellularnumbertype a
string ...
... homeaddress a
string homeaddress2 a
string homecity a
string homestate a
string homezipcode a
string homecountry a
string workaddress a
string workaddress2 a
string workcity a
string workstate a
string workzipcode a
string workcountry a
string jobtitle a
string department a
string company a
string aimscreenname a
string anniversaryyear a
string anniversarymonth a
string anniversaryday a
string spousename a
string familyname a
string 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); a
string get
stringeventtype(in unsigned long aeventtype); a
string get
stringrelationtype(in unsigned long arelationtype); a
string get
stringrole(in unsigned long arole); nsidomdom
stringlist get
stringstates(in unsigned long astates, in unsigned long aextrastates); methods getaccessiblefor() return an nsiaccessible for a dom node in pres shell 0.
...get
stringeventtype() get the type of accessible event as a
string.
... a
string get
stringeventtype( in unsigned long aeventtype ); parameters aeventtype the accessible event type constant.
...And 10 more matches
nsIINIParser
nsiutf8
stringenumerator getkeys(in autf8
string asection); nsiutf8
stringenumerator getsections(); autf8
string get
string(in autf8
string asection, in autf8
string akey); methods getkeys() returns an nsiutf8
stringenumerator providing the keys available within the specified section of the ini file.
... nsiutf8
stringenumerator getkeys( in autf8
string asection ); parameters asection the name of the section whose keys you wish to enumerate.
... return value an nsiutf8
stringenumerator 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); ac
string extractscheme(in autf8
string url
string); unsigned long getprotocolflags(in
string ascheme); nsiprotocolhandler getprotocolhandler(in
string ascheme); nsichannel newchannel(in autf8
string aspec, in
string aorigincharset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8
string 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 autf8
string 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.to
string()); // '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.to
string()); // 'true' mystruct.v = false; console.log(mystruct.v.tostr...
...ing()); // 'false' mystruct.v = 1; console.log(mystruct.v.to
string()); // 'true' mystruct.v = 0; console.log(mystruct.v.to
string()); // '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.to
string()); // "a" mystruct.v = true; console.log(mystruct.v.to
string()); // "\x01" mystruct.v = "x"; console.log(mystruct.v.to
string()); // "x" ...
...mystruct.v = "xx"; // throws error var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.int16_t } ])(); mystruct.v = 0x41; console.log(mystruct.v.to
string()); // 65 mystruct.v = true; console.log(mystruct.v.to
string()); // 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 dom
string specifying the name of the command to execute.
... avalueargument for commands which require an input argument, is a dom
string providing that information.
...this requires a <color> value
string to be passed in as a value argument.
...And 10 more matches
Element - Web APIs
element.classname is a dom
string representing the class of the element.
... element.computedname read only returns a dom
string containing the label exposed to accessibility.
... element.computedrole read only returns a dom
string 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.nsisupports
string).data; } function setucharpref(prefname,text,branch) // unicode setcharpref { var
string = components.classes["@mozilla.org/supports-
string;1"] .createinstance(components.interfaces.nsisupports
string);
string.data = text; branch = branch ?
... branch : services.prefs; branch.setcomplexvalue(prefname, components.interfaces.nsisupports
string,
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
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 js
string 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_errorto
string introduced in nss 3.13.
... on earlier versions of nss that * don't support error tables, pr_errorto
string will return "unknown code".
... */ #ifndef port_errorto
string #define port_errorto
string(err) pr_errorto
string((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
-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 (js
string), 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 js
string.
... this can be obtained with js_get
stringchars.
...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, bit
strings 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 w
string line, out unsigned long loglinestart) void findurlinplaintext(in w
string text, in long alength, in long apos, out long astartpos, out long aendpos) w
string scanhtml(in w
string text, in unsigned long whattodo) w
string scantxt(in w
string text, in unsigned long whattodo) constants conversion control attributes these bits allow you to control the conversion of text...
... w
string scantxt( in w
string 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 ); w
string get
string( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumber
strings( in print32 innum
strings ); void set
string( in print32 inindex, in w
string in
string); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports.
...get
string() 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 a
string 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 query
stringtoqueries(in autf8
string aquery
string, [array, size_is(aresultcount)] out nsinavhistoryquery aqueries, out unsigned long aresultcount, out nsinavhistoryqueryoptions options); autf8
string queriestoquery
string([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); a
string getcharsetforuri(in nsiuri auri); a
string setcharsetforuri(in nsiuri auri, in a
string 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 startspeaking
string: @"hello, firefox!"]; // wait until start speaking.
... // [ns
string 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).
... ns
string literals another objective-c syntax used is the @"..." literal, which creates ns
string 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 long
stringactor.
... 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 dom
string indicating the single-character keyboard key to give access to the button.
... htmlbuttonelement.formaction is a dom
string reflecting the uri of a resource that processes information submitted by the button.
... htmlbuttonelement.formenctype is a dom
string 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 usv
string containing the whole url, and allows the href to be updated.
... htmlhyperlinkelementutils.protocol this is a usv
string containing the protocol scheme of the url, including the final ':'.
... htmlhyperlinkelementutils.host this is a usv
string 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 dom
string that specifies the alignment of the frame with respect to the surrounding context.
... htmliframeelement.frameborder is a dom
string that indicates whether to create borders between frames.
... htmliframeelement.height is a dom
string that reflects the height html attribute, indicating the height of the frame.
...And 9 more matches
HTMLTableCellElement - Web APIs
htmltablecellelement.abbr a dom
string which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell..
... htmltablecellelement.scope a dom
string 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
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 dom
stringlist 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 usv
string containing the entire url.
... location.protocol is a usv
string containing the protocol scheme of the url, including the final ':'.
...And 9 more matches
content - CSS: Cascading Style Sheets
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 dom
string representing a date and time (in the local time zone), or empty.
... methods select(), stepdown(), stepup() value a dom
string 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 contentscript
string = 'document.body.innerhtml = "<h1>this page has been eaten</h1>";' tabs.activetab.attach({ contentscript: contentscript
string }); 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.read
stringvalue("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 read
stringvalue().
...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 nsa
string and nsac
string.
...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 a
string ahostname, in a
string aformsubmiturl, in a
string ahttprealm, in a
string ausername, in a
string apassword, in a
string ausernamefield, in a
string apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description formsubmiturl a
string the origin, not url, a form-based login was submitted to.
... hostname a
string the origin, not hostname, to which the login applies (for example, "https://www.site.com").
... httprealm a
string 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 autf8
string 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); a
string 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); ac
string 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 a
string acolumn, in nsimsgcustomcolumnhandler ahandler); void removecolumnhandler(in a
string acolumn); nsimsgcustomcolumnhandler getcolumnhandler(in ...
...a
string 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 ac
string convertfromunicode(in a
string asrc); ac
string finish(); a
string converttounicode(in ac
string asrc); a
string convertfrombytearray([const,array,size_is(acount)] in octet adata, in unsigned long acount); void converttobytearray(in a
string a
string,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsiinputstream converttoinpu...
...tstream(in a
string a
string); 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 w
string methodname);
string cancreatewrapper(in nsiidptr iid);
string cangetproperty(in nsiidptr iid, in w
string propertyname);
string cansetproperty(in nsiidptr iid, in w
string 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 w
string 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 setpropertyasac
string(in a
string prop, in ac
string value); void setpropertyasa
string(in a
string prop, in a
string value); void setpropertyasautf8
string(in a
string prop, in autf8
string value); void setpropertyasbool(in a
string prop, in boolean value); void setpropertyasdouble(in a
string prop, in double value); void setpropertyasint32(in a
string prop, in print32 value); void setpropertyasint64(in a
string prop, in print64 value); ...
... void setpropertyasinterface(in a
string prop, in nsisupports value); void setpropertyasuint32(in a
string prop, in pruint32 value); void setpropertyasuint64(in a
string prop, in pruint64 value); methods setpropertyasac
string() void setpropertyasac
string( in a
string prop, in ac
string value ); parameters prop property to set the value of.
... setpropertyasa
string() void setpropertyasa
string( in a
string prop, in a
string value ); parameters prop property to set the value of.
...And 8 more matches
nsIXULAppInfo
attributes attribute type description appbuildid ac
string the application's build id/date, for example "2004051604".
... id ac
string 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 dom
string representing the type of content being loaded by the html link.
... htmllinkelement.crossorigin is a dom
string that corresponds to the cors setting for this link element.
... htmllinkelement.href is a dom
string representing the uri for the target resource.
...And 8 more matches
MediaTrackConstraints - Web APIs
properties of all media tracks deviceid a constraindom
string object specifying a device id or an array of device ids which are acceptable and/or required.
... groupid a constraindom
string 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 dom
string containing the whole url.
... urlutilsreadonly.protocol read only is a dom
string containing the protocol scheme of the url, including the final ':'.
... urlutilsreadonly.host read only is a dom
string 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
value a dom
string 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 dom
string 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 sub
string 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
is
string(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 { is
string } = require('sdk/lang/type'); is
string('my
string'); // true is
string(100); // false is
string('100'); // true parameters value : mixed the variable to check.
...And 7 more matches
Miscellaneous - Archive of obsolete content
var os
string = 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().to
string(); 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" (c
string) docommand "state_attribute" (c
string) note for color values, use the c
string representation of rrggbb, e.g., red="#ff0000" and black="#000000".
... getcommandstate "state_attribute" (c
string) docommand "state_attribute" (c
string) note for color values, use the c
string representation of rrggbb, e.g., red="#ff0000" and black="#000000".
...And 7 more matches
Index - Archive of obsolete content
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 getformatted
string 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
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.tolocaledate
string().
... syntax dateobj.tolocaleformat(format
string) parameters format
string a format
string in the same format expected by the strftime() function in c.
...And 7 more matches
JSObject - Archive of obsolete content
to
string 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 dom
string the type of event.
...its properties are as follows: documenturi a dom
string representing the url of the document the menu is associated with.
... uri a dom
string.
...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 is
string = 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 is
string = v.is
string(); 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 = some
string; v = null; v = undefined; v = false; /* jsapi */ js::rootedvalue v(cx); js::rooted
string some
string(cx, ...); v.setint32(0); // or: v = js::int32value(0); v.setdouble(0.5); // or: v = js::doublevalue(0.5); v.set
string(some
string); // or: v = js::
stringvalue(some
string); 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::rooted
string name_str(cx, js_new
stringcopyz(cx, "dave")); if (!name_str) return false; js::autovaluearray<2> args(cx); args[0].set
string(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 & → & < → < > → > " → " ' → ' 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 w
string word,in w
string correction, in w
string lang); void addword(in w
string word, in w
string lang); boolean check(in w
string word, in w
string lang); void endsession(); void getcorrection(in w
string word, [array, size_is(count)] out w
string words, out pruint32 count); void ignoreword(in w
string word); void load(); void removecorrection(in w
string word,in w
string correction, in w
string lang...
...); void removeword(in w
string word, in w
string lang); void save(); attributes attribute type description wordlist nsi
stringenumerator get the (lexicographically sorted) list of words.
... void addcorrection( in w
string word, in w
string correction, in w
string 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 w
string word); void getdictionarylist([array, size_is(count)] out w
string dictionaries, out pruint32 count); void removedirectory(in nsifile dir); void suggest(in w
string word,[array, size_is(count)] out w
string suggestions, out pruint32 count); attributes attribute type description copyright wstrin...
...g a
string indicating the copyright of the engine.
... dictionary w
string the name of the current dictionary used by check() and suggest().
...And 7 more matches
nsIAuthInformation
attributes attribute type description authenticationscheme autf8
string 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 dom
string the city.
... country dom
string the country.
... countrycode obsolete since gecko 11 dom
string 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 ac
string aguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onclearhistory(); void ondeleteuri(in nsiuri auri, in ac
string aguid); void ondeletevisits(in nsiuri auri, in prtime avisittime, in ac
string aguid); void onendupdatebatch(); void onpagechanged(in nsiuri auri, in unsigned long awhat, in a
string avalue); void onpageexpi...
...red(in nsiuri auri, in prtime avisittime, in boolean awholeentry); obsolete since gecko 2.0 void ontitlechanged(in nsiuri auri, in a
string 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 ac
string 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 ac
string 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 w
string awindowtype); nsidomwindow getmostrecentwindow(in w
string awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in w
string awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native code only!
... nsisimpleenumerator getzorderdomwindowenumerator(in w
string awindowtype, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in w
string awindowtype, in boolean afronttoback); void registerwindow(in nsixulwindow awindow); native code only!
... void updatewindowtitle(in nsixulwindow awindow, in w
string 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 autf8
string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue); void addentrydirectory(in autf8
string azipentry, in prtime amodtime, in boolean aqueue); void addentryfile(in autf8
string azipentry, in print32 acompression, in nsifile afile, in boolean aqueue); void addentrystream(in autf8
string azipentry, in prtime amodtime, in print32...
... acompression, in nsiinputstream astream, in boolean aqueue); void close(); nsizipentry getentry(in autf8
string azipentry); boolean hasentry(in autf8
string azipentry); void open(in nsifile afile, in print32 aioflags); void processqueue(in nsirequestobserver aobserver, in nsisupports acontext); void removeentry(in autf8
string azipentry, in boolean aqueue); attributes attribute type description comment ac
string gets or sets the comment associated with the currently open zip file.
... void addentrychannel( in autf8
string 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
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 = imagecandidate
strings; let srcset = htmlimageelement.srcset; value a usv
string 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 dom
string name, in dom
string keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in dom
string name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in dom
string storename) raises (idbdatabaseexception); void setversion (in dom
string version); idbtransactionsync transaction...
... (in optional dom
stringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly dom
string the human-readable description of the connected database.
... name readonly dom
string 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 dom
string 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 dial
string = "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: dial
string 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 dom
string containing the whole url of the script executed in the worker.
... urlutilsreadonly.protocol read only is a dom
string containing the protocol scheme of the url of the script executed in the worker, including the final ':'.
... urlutilsreadonly.host read only is a dom
string 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
value a dom
string 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 dom
string 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
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 = 'my
string', 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("custom
string"))).
...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.to
string() 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_errorto
string(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_errorto
string(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_errorto
string(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); autf8
string getutf8
string(in unsigned long aindex); a
string get
string(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...
... getutf8
string() obtains a utf8
string 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 ac
string key); unsigned long gettypes(in ac
string key); void initashandle(in ac
string groupid, in ac
string clientid); void markentry(in ac
string key, in unsigned long typebits); void unmarkentry(in ac
string key, in unsigned long typebits); attributes attribute type description active boolean true if the cache is the ac...
... clientid ac
string the client id for this application cache.
... groupid ac
string 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 a
string); ac
string readc
string(); double readdouble(); float readfloat(); a
string read
string(); void setinputstream(in nsiinputstream ainputstream); methods read8() reads from the stream.
... void readbytes( in pruint32 alength, [size_is(alength), retval] out
string a
string ); parameters alength the number of bytes to read.
... a
string 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 dom
string atitle, in dom
string 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 dom
string documenturi, in boolean create); nsidomstorage getsessionstorageforuri(in nsiuri uri, in dom
string documenturi); void historypurged(in long numentries); void internalload(in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in w
string 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 ac
string acontenttype, in ac
string 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 a
string title, in a
string filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in a
string 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 a
string the extension for the type of files you want to work with.
... default
string a
string 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 autf8
string convertacetoutf8(in ac
string input); autf8
string converttodisplayidn(in autf8
string input, out boolean isascii); ac
string convertutf8toace(in autf8
string input); boolean isace(in ac
string input); autf8
string normalize(in autf8
string 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.
... autf8
string convertacetoutf8( in ac
string 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 set
stringproperty(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 a
string source
string, out octetptr key, out unsigned long len); native code only!
...And 6 more matches
nsIProfile
method overview void cloneprofile(in w
string profilename); void createnewprofile(in w
string profilename, in w
string nativeprofiledir, in w
string langcode, in boolean useexistingdir); void deleteprofile(in w
string name, in boolean candeletefiles); void getprofilelist(out unsigned long length, [retval, array, size_is(length)] out w
string profilenames); boolean profileexists(in w
string profilename); ...
... void renameprofile(in w
string oldname, in w
string newname); void shutdowncurrentprofile(in unsigned long shutdowntype); attributes attribute type description currentprofile w
string the name of the profile currently in use.
...void cloneprofile( in w
string 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); ac
string 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 dom
string delivery, in dom
string sender, in dom
string receiver, in dom
string body, in jsval timestamp, in bool read ); unsigned short getnumberofmessagesfortext(in dom
string text); boolean hassupport(); void send(in dom
string number, in dom
string message, in long requestid, [optional] in unsigned long long processid); methods createsmsmessage() [implicit_jscontext] nsido...
...mmozsmsmessage createsmsmessage( in long id, in dom
string delivery, in dom
string sender, in dom
string receiver, in dom
string body, in jsval timestamp, in bool read ); parameters id a number representing the id of the message.
... delivery a dom
string 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...
... response
string 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 nsisupportsc
string 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 get
stringvalue() method.
...the value can be obtained by using the get
stringvalue() 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
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.parsefrom
string() syntax let doc = domparser.parsefrom
string(
string, mimetype) return either document or xmldocument depending on the mimetype argument.
... parameters this method has 2 parameters (both required):
string the dom
string to be parsed.
...And 6 more matches
HTMLTableElement - Web APIs
htmltableelement.align is a dom
string containing an enumerated value reflecting the align attribute.
... htmltableelement.bgcolor is a dom
string containing the background color of the cells.
... htmltableelement.border is a dom
string containing the width in pixels of the border of the table.
...And 6 more matches
Node - Web APIs
node.baseuriread only returns a dom
string representing the base url of the document containing the node.
... node.nodenameread only returns a dom
string 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
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 dom
string valueas
string 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 + ", valueas
string: " + val.valueas
string); // 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 + ", valueas
string: " + val.valueas
string); // 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 + ", valueas
string: " + val.valueas
string); } ]]></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, valueas
string: 1cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueas
string: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, valueas
string: 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 dom
string identifying a user action to be displayed on the notification.
... title: a dom
string containing action text to be shown to the user.
... icon: a usv
string containing the url of an icon to display with the action.
...And 6 more matches
Window.open() - Web APIs
syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a dom
string 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 dom
string 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
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 dom
string 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 dom
string 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
<input type="submit" value="send request"> value a dom
string 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 dom
string 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
value a dom
string representing the text contained in the text field.
... value the value attribute is a dom
string 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
it, like chrome, uses a 12- or 24-hour format for inputting times, based on system locale: 12-hour 24-hour value a dom
string representing a time, or empty.
... value a dom
string 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.toxml
string()); // 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.toxml
string()); // gives: <foo a="he said "don't go there.""/> 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 dom
string the type of event.
... details the details property is an anonymous javascript object with the following properties: prompttype a dom
string defining the type of the prompt.
... title a dom
string 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_add
stringroot(jscontext *cx, js
string **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_addnamed
stringroot(jscontext *cx, js
string **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 js
string ** (in js_add
stringroot and js_addnamed
stringroot) the address of the js
string* 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 js
string* 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 js
string *, jsobject *, or jsval.
...And 5 more matches
SpiderMonkey 1.8.7
js_addroot has been replaced by js_addobjectroot, js_addvalueroot and js_add
stringroot; 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_addnamed
stringroot js_addnamedvalueroot js_addobjectroot js_add
stringroot 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_encode
stringtobuffer js_entercrosscompartmentcall js_evaluatescriptforprincipalsversion js_evaluateucscriptforprincipalsversion js_executeregexp js_executeregexpnostatics js_executescriptversion js_forget_
string_flatness js_fileescaped
string js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flat
stringequalsascii js_flatten
string js_flushcaches js_freezeobject js_getcompartmentprivate js_getempty
string js_getflat
stringchars 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 a
string searchterms readonly attribute boolean hassearchterms attribute long minvisits attribute long maxvisits attribute boolean onlybookmarked attribute boolean domainishost attribute autf8
string domain readonly attribute boolean hasdomain attribute boolean uriisprefix attribute nsiuri uri readonly attribute boolean hasuri attribute boolean annotationisnot attribute autf8
string 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 autf8
string 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 queriestoquery
string.
...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 embed
string 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\embed
string\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, embed
string, 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& a
string, index_type aposition ); parameters a
string [in] a nsac
string 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& a
string, index_type aposition ); parameters a
string [in] a nsa
string 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 ac
string key); nsiapplicationcache chooseapplicationcache(in ac
string key); nsiapplicationcache createapplicationcache(in ac
string group); void deactivategroup(in ac
string group); nsiapplicationcache getactivecache(in ac
string group); nsiapplicationcache getapplicationcache(in ac
string clientid); void getgroups([optional] out unsigned long count, [array, size_is(count), retval] out
string grou...
...void cacheopportunistically( in nsiapplicationcache cache, in ac
string key ); parameters cache the cache in which the entry is currently cached.
...nsiapplicationcache chooseapplicationcache( in ac
string 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 a
string, in pruint32 alength); void writedouble(in double adouble); void writefloat(in float afloat); void write
stringz(in
string a
string); void writeutf8z(in w
string a
string); void writew
stringz(in w
string a
string); methods setoutputstream() sets the stream to which output is directed.
...void writebytes( [size_is(alength)] in
string a
string, in pruint32 alength ); parameters a
string the byte array to write to the stream.
... write
stringz() writes an 8-bit pascal style
string to the stream.
...And 5 more matches
nsIBrowserSearchService
method overview void addengine(in a
string engineurl, in long datatype, in a
string iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback); void addenginewithdetails(in a
string name, in a
string iconurl, in a
string alias, in a
string description, in a
string method, in a
string url); void getdefaultengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out ...
...nsisearchengine engines); nsisearchengine getenginebyalias(in a
string alias); nsisearchengine getenginebyname(in a
string 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 a
string engineurl, in long datatype, in a
string 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 a
string aflag, in boolean acasesensitive); a
string getargument(in long aindex); boolean handleflag(in a
string aflag, in boolean acasesensitive); a
string handleflagwithparam(in a
string aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in a
string aargument); nsiuri resolveuri(in a
string aargument); attributes attribute type descript...
...long findflag( in a
string aflag, in boolean acasesensitive ); parameters aflag the flag name to locate.
...a
string 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 log
stringmessage(in w
string message); void registerlistener(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsolelistener listener); methods getmessagearray() to obtain an array of all logged messages.
... log
stringmessage() a convenient method for logging simple messages.
... void log
stringmessage( in w
string 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 a
string policy
string, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in a
string blockeduri, in a
string violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in ac
string amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri a...
...contentlocation, in nsiuri arequestorigin, in nsisupports acontext, in ac
string 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 a
string a read-only
string version of the policy for debugging.
...And 5 more matches
nsIEditorIMESupport
obsolete since gecko 1.9.1 void getreconversion
string(in nsreconversioneventreplyptr areply); native code only!
...obsolete since gecko 2.0 void setcomposition
string(in dom
string acomposition
string, in nsiprivatetextrangelistptr atextrange, in nstexteventreplyptr areply); native code only!
...void getquerycaretrect( in nsquerycaretrecteventreplyptr areply ); parameters areply native code only!getreconversion
string 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 autf8
string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata); obsolete since gecko 22.0 a
string 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 autf8
string amimetype, in prtime aexpiration); obsolete since gecko 22.0 void setfavicondatafromdataurl(in nsiuri afaviconuri, in a
string 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 autf8
string 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 a
string getidforlocation(in nsifile file); nsifile getitemfile(in a
string id, in a
string path); nsifile getitemlocation(in a
string id); nsifile getstagefile(in a
string id); boolean itemismanagedindependently(in a
string id); void removefile(in nsifile file); nsifile stagefile(in nsifile file, in a
string id); attributes attribute type description canaccess boolean whether or not the ...
... name a
string the
string identifier of this install location.
...a
string 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 id
string);
string to
string(); 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.getsort
stringforrow() nsimsgcustomcolumnhandler.getsortlongforrow() nsimsgcustomcolumnhandler.is
string() 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) { }, getsort
stringforrow: function(ahdr) { return ""; }, is
string: 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 a
string getsort
stringforrow(in nsimsgdbhdr ahdr); unsigned long getsortlongforrow(in nsimsgdbhdr ahdr); boolean is
string(); methods getsort
stringforrow() 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 w
string 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 dom
string cid, in dom
string reason); void dial(in dom
string number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in dom
string 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 dom
string number, in dom
string message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in dom
string apn, in dom
string user, in dom
string passwd, in long chappap, in dom
string pdptype); void starttone(in dom
string 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 dom
string cid, in dom
string 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 a
string name, in a
string value, in a
string responsetype); nsisearchsubmission getsubmission(in a
string data, [optional] in a
string responsetype, [optional] in a
string purpose); boolean supportsresponsetype(in a
string responsetype); attributes attribute type description alias a
string an optional shortcut alias for the engine.
... description a
string a text description describing the engine.
... name a
string the display name of the search engine.
...And 5 more matches
nsIStackFrame
inherits from: nsisupports last changed in gecko 1.7 method overview
string to
string(); 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 ac
string the wifi access point's mac address.
... this
string is in the format "xx-xx-xx-xx-xx-xx".
... rawssid ac
string 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 a
string source, in jscontextptr cx, in nsixpconnectjsobjectholder sandbox, in prbool return
stringonly); 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 to
string() 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
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 dom
string specifying the name of the attribute whose value is to be set.
... value a dom
string 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
fontface.display a cssom
string that determines how a font face is displayed based on whether and when it is downloaded and ready to use.
... fontface.family a cssom
string that retrieves or sets the family of the font.
... fontface.featuresettings a cssom
string 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 dom
string representing the access key assigned to the element.
... htmlelement.accesskeylabel read only returns a dom
string containing the element's assigned access key.
... htmlelement.contenteditable is a dom
string, 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 dom
string reflecting the value of the form's name html attribute, containing the name of the form.
... htmlformelement.method a dom
string reflecting the value of the form's method html attribute, indicating the http method used to submit the form.
... htmlformelement.target a dom
string 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 dom
string that reflects the challenge html attribute, containing a challenge
string that is packaged with the submitted key.
... keytype is a dom
string that reflects the keytype html attribute, containing the type of key used.
... name is a dom
string 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 dom
string reflecting the name html attribute, containing the name of this control used by servers and dom search functions.
... htmlselectelement.typeread only a dom
string represeting the form control's type.
... htmlselectelement.validationmessageread only a dom
string 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 dom
strings, such as text/plain or image/jpeg.
... const dt = event.datatransfer; dt.setdata("application/x.bookmark", bookmark
string); 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 dom
stringmap 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 dom
string with the code value of the physical key represented by the event.
... keyboardevent.key read only returns a dom
string representing the key value of the key represented by the event.
... keyboardevent.locale read only returns a dom
string 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 dom
string 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 dom
string 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
navigatorid.appname read only returns a dom
string with the official name of the browser.
... navigatorid.appversion read only returns the version of the browser as a dom
string.
... navigatorlanguage.language read only returns a dom
string 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 dom
string 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 dom
string 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 usv
string representing the uri of the resource that was blocked because it violates a policy.
... securitypolicyviolationevent.documenturiread only a usv
string representing the uri of the document or worker in which the violation was found.
... securitypolicyviolationevent.effectivedirectiveread only a dom
string representing the directive whose enforcement uncovered the violation.
...And 5 more matches
attr() - CSS: Cascading Style Sheets
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
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 dom
string representing a month and year, or empty.
... value a dom
string 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 to
string // 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 "ns
stringapi.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_c
string("libraries")); library->appendnative(ns_literal_c
string("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentc
string(*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 console
string console.log("hello world!"); arn()this method does stuff.
...methods show(title
stringbody
stringicon
string)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.write
string("umlaute: \u00fc \u00e4\n"); os.write
string("hebrew: \u05d0 \u05d1\n"); // etc.
... os.close(); you can also write character arrays using the write function, although using write
string 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; np
string 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_get
stringidentifier() npn_get
stringidentifiers() npn_getintidentifier() npn_identifieris
string() 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_get
stringidentifier 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(date
string); to convert a date object into a date
string: date
string = iso8601dateutils.create(dateobj); method overview
string create(adate); date parse(adate
string); 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 my
string { private: char *mbuffer; // heap-allocated size_t mlen; // ...
... size_t my
string::sizeofexcludingthis(mozilla::mallocsizeof amallocsizeof) const { return amallocsizeof(mbuffer); } size_t my
string::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 my
string 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.evaluate
string(scope, s, "<cmd>", 1, null); uses the context cx to evaluate a
string.
... printing the result the code system.out.println(cx.to
string(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.cons
string) 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::handle
string 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::handle
string 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_getflat
stringcharat (bug 1034627) js_getfunctionscript (bug 1069694) js_getlatin1flat
stringchars (bug 1037869) js_getlatin1interned
stringchars (bug 1037869) js_getlatin1
stringcharsandlength (bug 1032726) js_get
stringcharat (bug 1034627) js_gettwobyteexternal
stringchars (bug 1034627) js_gettwobyteflat
stringchars (bug 1037869) js_gettwobyteinterned
stringchars (bug 1037869) js_gettwobyte
stringcharsandlen...
...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_preconditionmacronsac
stringthe nsac
string 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.nsac
string (external)class declarationnsac
string_internalclass declarationnsadoptingc
stringclass declarationnsadopting
stringclass declarationnsa
stringthe nsa
string abstract class represents a character
string composed of double-byte storage units.
... this class is typically used to represent unicode character arrays.nsa
string (external)class declarationnsa
string_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>nsauto
stringclass declarationnsauto
string (external)class declarationnscauto
stringclass declarationnscauto
string (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 a
string 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 a
string outputoptions); void startimageencode(in pruint32...
... width, in pruint32 height, in pruint32 inputformat, in a
string 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 a
string 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 sub
string 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 sub
string 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 sub
string 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 autf8
string ahost, in autf8
string apath, in ac
string aname, in ac
string avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry); boolean cookieexists(in nsicookie2 acookie); unsigned long countcookiesfromhost(in autf8
string ahost); boolean findmatchingcookie(in nsicookie2 acookie, out unsigned long acountfromhost); obsolete since gecko 1.9...
... nsisimpleenumerator getcookiesfromhost(in autf8
string ahost); void importcookies(in nsifile acookiefile); methods add() adds a cookie.
... void add( in autf8
string ahost, in autf8
string apath, in ac
string aname, in ac
string 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 dom
string feature, in dom
string 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 dom
string read only.
... namespaceuri dom
string 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(); dom
string getitem(in dom
string key); dom
string key(in unsigned long index); void removeitem(in dom
string key); void setitem(in dom
string key, in dom
string data); attributes attribute type description length unsigned long the number of keys stored in local storage.
...dom
string getitem( in dom
string 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 a
string sourceattrname, in a
string sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in dom
string 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 a
string attributestr,in a
string attvalue); boolean getattributevalue(in nsidomelement aelement, in a
string attributestr, out a
string resultvalue); void removeattribute(in nsidomelement aelement, in a
string aattribute); void cloneattribute(in a
string aattribute, in nsidomnode asourcenode); void cloneattributes(in nsidomnode destnode, in nsidomnode sourcenode); ...
...nsidomnode createnode(in a
string 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 a
string outputto
string(in a
string 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 a
string aquotedtext, in a
string acitation, in boolean ainserthtml); nsidomnode insertasquotation(in a
string aquotedtext); void inserttextwithquotations(in dom
string a
stringtoinsert); void pasteascitedquotation(in a
string 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 a
string aquotedtext, in a
string 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 to
string(); 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 ac
string aextra
stringdata); 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 aextra
stringdata 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 ac
string aextra
stringdata ); 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 a
string amessagename /* [optional] in jsval v1, [optional] in jsval v2, ...
... */); void registerreceiver(in a
string amessagename, in jsval areceiver); void unregisterreceiver(in a
string amessagename, in jsval areceiver); void unregisterreceivers(in a
string amessagename); void evalscript(in a
string ascript); nsivariant createhandle(); void destroy(); methods sendmessage() this method asynchronously sends a message to the jetpack process.
... void sendmessage( in a
string 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 a
string getcategory(in a
string category); methods getcategory() retrieves a
string with the current locale name.
... a
string getcategory( in a
string 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 a
string decrypt(in a
string ciphertext); a
string encrypt(in a
string 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.
...a
string decrypt( in a
string 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 a
string messagename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed) void removemessagelistener(in a
string messagename, in nsimessagelistener listener); void addweakmessagelistener(in a
string messagename, in nsimessagelistener listener); ...
... void removeweakmessagelistener(in a
string messagename, in nsimessagelistener listener); methods addmessagelistener() register listener to receive messagename.
... void addmessagelistener(in a
string 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 autf8
string 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 autf8
string 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...
...utf8
string anewtitle); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8
string 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 w
string action); void onperformactiononrow(in w
string action, in long row); void onperformactiononcell(in w
string 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 w
string 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 autf8
string 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 ac
string 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 ac
string id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in ac
string id); void capturestack(in ac
string name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession...
..., in boolean aclear); void sethistogramrecordingenabled(in ac
string id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in ac
string aname, in jsval avalue); void scalarset(in ac
string aname, in jsval avalue); void scalarsetmaximum(in ac
string aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in ac
string aname, in a
string akey, in jsval avalue); void keyedscalarset(in ac
string aname, in a
string akey, in jsval avalue); void keyedscalarsetmaximum(in ac
string aname, in a
string akey, in jsval avalue); jsval snapshotkeyedscalars(in uint32_t ad...
...ataset, [optional] in boolean aclear); void clearscalars(); test only void flushbatchedchildtelemetry(); void recordevent(in ac
string acategory, in ac
string amethod, in ac
string aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in ac
string acategory, in boolean aenabled); jsval snapshotevents(in uint32_t adataset, [optional] in boolean aclear); void registerevents(in ac
string acategory, in jsval aeventdata); void registerscalars(in ac
string 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 autf8
string auritext, in unsigned long afixupflags); nsiuri keywordtouri(in autf8
string akeyword); nsiurifixupinfo getfixupuriinfo(in autf8
string 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 autf8
string convert
stringtoutf8(in ac
string a
string, in
string acharset, in boolean askipcheck); autf8
string converturispectoutf8(in ac
string aspec, in
string acharset); methods convert
stringtoutf8() ensure that a
string 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.
... autf8
string convert
stringtoutf8( in ac
string a
string, in
string acharset, in boolean askipcheck, in boolean aallowsubstitution ); parameters a
string 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 dom
string mimetype, in dom
string uri, in dom
string title, in nsidomwindow contentwindow) void registerprotocolhandler(in dom
string protocol,in dom
string uri, in dom
string title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in dom
string ...
...mimetype, in dom
string uri, in dom
string 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 ac
string aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext); void close(in unsigned short acode, in autf8
string areason); void sendbinarymsg(in ac
string amsg); void sendmsg(in autf8
string amsg); attributes attribute type description extensions ac
string sec-websocket-extensions response header value.
... protocol ac
string sec-websocket-protocol value.
...void asyncopen( in nsiuri auri, in ac
string 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 a
string 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 a
string aref
string); 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 dom
string 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 dom
string to the characterdata.data
string; when this method returns, data contains the concatenated dom
string.
...And 4 more matches
Element.innerHTML - Web APIs
syntax const content = element.innerhtml; element.innerhtml = html
string; value a dom
string 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 html
string.
... 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 dom
string newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional dom
string newname) raises (fileexception); dom
string tourl(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file system w...
... fullpath readonly dom
string the full absolute path from the root to the entry.
... name readonly dom
string the name of the entry, excluding the path leading to it.
...And 4 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.crossorigin a dom
string indicating the cors setting for this media element.
... htmlmediaelement.currentsrc read only returns a dom
string with the absolute url of the chosen media resource.
... htmlmediaelement.mediagroup a dom
string 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 dom
string representing the default value of the element, initially the empty
string.
... htmloutputelement.name a dom
string reflecting the name html attribute, containing the name for the control that is submitted with form data.
... htmloutputelement.typeread only the dom
string "output".
...And 4 more matches
HTMLScriptElement - Web APIs
htmlscriptelement.type is a dom
string representing the mime type of the script.
... htmlscriptelement.src is a dom
string representing the url of an external script.
... htmlscriptelement.event is a dom
string; 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 dom
string name, in dom
string storename, in dom
string 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 dom
string 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 dom
string indexname) raises (idbdatabaseexception); attributes attribute type description indexnames readonly dom
stringlist a list of the names of the indexes on this object store.
... keypath readonly dom
string 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
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 dom
string listing the tones to be played.
...And 4 more matches
RTCIceCandidateInit.candidate - Web APIs
value a dom
string 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
texttrack.id read only a dom
string 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 dom
string 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.get
string(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.tobase64
string( 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.to
string(), 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 to
string() 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
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 byte
string 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
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(target
string, regexp
string[, flags
string]) parameters target
string the
string to perform regular expression matching upon.
... regexp
string the javascript style regular expression to evaluate.
...And 4 more matches
regexp:replace() - EXSLT
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(original
string, regexp
string, flags
string, replace
string) parameters original
string the
string perform a search-and-replace operation upon.
... regexp
string 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
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
value a dom
string 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 dom
string 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
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 huge
string = 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.tolocale
string() returns a
string with a language-sensitive representation of this number.
... overrides the object.prototype.tolocale
string() method.
...And 4 more matches
Date() constructor - JavaScript
syntax new date() new date(value) new date(date
string) 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 date
string 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
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 gmt
string 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 gmt
string 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(…)</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 query
string 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
result
string = crypto.importusercertificates("nickname
string","cert
string",forcebackup); argument description "nickname
string" 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>"nickname
string"</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
result
string = crypto.popchallengeresponse("challenge
string"); argument description "challenge
string" a base-64 encoded cmmf popodeckeychallcontent message.
... the result
string 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(content
stringflavor
string)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(content
stringflavor
string)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.bind
stringparameter(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.bind
stringparameter(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 write
string method.
... var file = io.getfile("desktop", "myinfo.txt"); var stream = io.newoutputstream(file, "text"); stream.write
string("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
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.to
string();} 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, '"').replace(/'/g, '''); } if (typeof s === 'xml') { return s.to
string().replace(/"/g, '"').replace(/'/g, '''); } return
string(s).replace...
...(/"/g, '"').replace(/'/g, '''); } 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.nsi
stringbundleservice).
... createbundle('chrome://myeext/locale/myext.properties'); if (args){ args = array.prototype.slice.call(arguments, 1); return strs.format
stringfromname(msg,args,args.length); } return strs.get
stringfromname(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 java
string = new java.lang.
string("hello world!"); var bytearray = java
string.getbytes(); bytearray[0] // returns 72 bytearray[1] // returns 101 any java data brought into javascript is converted to javascript data types.
...in addition, the to
string 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 to
string: in javascript 1.4, this method is overridden by the inherited method java.lang.object.to
string.
...And 3 more matches
JavaObject - Archive of obsolete content
examples example: instantiating a java object in javascript the following code creates the javaobject the
string, which is an instance of the class java.lang.
string: var the
string = 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 the
string = new java.lang.
string("hello, world"); example: accessing methods of a java object because the javaobject the
string ...
...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 the
string 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 version
string = player.versioninfo; alert(version
string); } 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 .to
string() 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 to
string = (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, to
string(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, to
string(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(myurl
string, 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(myurl
string, 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 ns
string objects (i.e.
... pointed to by ns
string*!).
... attribute values ns
strings 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 iter
stringenumerator(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); iter
stringenumerator() wraps an nsi
stringenumerator or nsiutf8
stringenumerator 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, rooted
string, rootedscript, etc.
...instead, spidermonkey has a convenient suite of c++ raii classes to do this for you, called js::rootedt: rooted
string str1(cx, js_valueto
string(cx, val)); rooted
string str2(rt, js_valueto
string(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, handle
string, handlescript, etc.
...And 3 more matches
JS::Add*Root
syntax bool js::addvalueroot(jscontext *cx, js::heap<js::value> *vp); bool js::add
stringroot(jscontext *cx, js::heap<js
string *> *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::addnamed
stringroot(jscontext *cx, js::heap<js
string *> ...
... rp js::heap<js
string *> the address of the js
string * variable to root.
... vp/rp is the address of a c/c++ variable (or field, or array element) of type js::value, js
string *, 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::handle
string src, js::mutablehandlevalue rval); typedef bool (* jslocaletolowercase)(jscontext *cx, js::handle
string src, js::mutablehandlevalue rval); typedef bool (* jslocalecompare)(jscontext *cx, js::handle
string src1, js::handle
string 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/c
string 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 (ns
string*) nsclasshashtable <nsuint32hashkey, ns
string> <ns(c)
stringhashkey, ns
string> <nsidhashkey, ns
string> <nsisupportshashkey, ns
string> 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& a
string ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
...a
string [in] a nsac
string 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& a
string ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
...a
string [in] a nsa
string to append to this
string.
...And 3 more matches
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsac
string::assign family of functions.
... self_type& operator=( const self_type& a
string ); parameters a
string [in] a nsembedc
string to append to this
string.
... self_type& operator=( const abstract_
string_type& a
string ); parameters a
string [in] a nsac
string to append to this
string.
...And 3 more matches
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsa
string::assign family of functions.
... self_type& operator=( const self_type& a
string ); parameters a
string [in] a nsembed
string to append to this
string.
... self_type& operator=( const abstract_
string_type& a
string ); parameters a
string [in] a nsa
string 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 autf8
string amimetype, [optional] in prtime aexpiration); void replacefavicondatafromdataurl(in nsiuri afaviconuri, in a
string 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 autf8
string 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 a
string getnamespaceuriforid(in short namespaceid); attributes attribute type description caretaccessible nsiaccessible read only.
... obsolete since gecko 1.9 doctype a
string the doc type of the document, as specified in the document.
...obsolete since gecko 1.9 mimetype a
string 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 autf8
string the url this crl was last fetched from.
... lastupdatelocale a
string lastupdate formatted as a human readable
string formatted according to the environment locale.
... nameindb a
string the key identifying the crl in the database.
...And 3 more matches
nsIContentFrameMessageManager
methods void dump(in dom
string astr); dom
string atob(in dom
string aascii
string); dom
string btoa(in dom
string abase64data); dump() prints the specified
string to standard output.
... parameters name type description astr
string the message to log.
... parameters name type description aascii
string string ascii
string to decode.
...And 3 more matches
nsIDOMFontFace
attribute type description cssfamilyname dom
string 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 dom
string full font name as obtained from the font resource.
... attribute type description format dom
string 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 dom
string uri); boolean mozhasitem(in dom
string uri); dom
string mozitem(in unsigned long index); void mozremove(in dom
string 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 dom
string uri ); parameters uri the uri of the resource to add to the list.
... void mozhasitem( in dom
string 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 autf8
string charset); a
string serializeto
string(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 autf8
string 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(); dom
string getitem(in dom
string key); dom
string key(in unsigned long index); void removeitem(in dom
string key); void setitem(in dom
string key, in dom
string data); attributes attribute type description length unsigned long the number of keys stored in the session store.
...dom
string getitem( in dom
string key ); parameters key the key for which data should be returned.
...dom
string 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 a
string aname, in a
string avalue); a
string get(in a
string aname); boolean exists(in a
string aname); methods set() set the value of an environment variable.
... void set( in a
string aname, in a
string avalue ); parameters aname the variable name to set.
... a
string get( in a
string aname ); parameters aname the variable name to retrieve.
...And 3 more matches
nsIExternalProtocolService
method overview boolean externalprotocolhandlerexists(in
string aprotocolscheme); a
string getapplicationdescription(in autf8
string ascheme); nsihandlerinfo getprotocolhandlerinfo(in ac
string aprotocolscheme); nsihandlerinfo getprotocolhandlerinfofromos(in ac
string 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.
...a
string getapplicationdescription( in autf8
string ascheme ); parameters ascheme the scheme to look up.
...And 3 more matches
nsIFeedTextConstruct
method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); a
string 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 a
string the language of the text (such as "en-us" for u.s.
... text a
string the actual text content.
...And 3 more matches
nsIFormHistory2
method overview void addentry(in a
string name, in a
string value); boolean entryexists(in a
string name, in a
string value); boolean nameexists(in a
string name); void removeallentries(); void removeentriesbytimeframe(in long long abegintime, in long long aendtime); void removeentriesforname(in a
string name); void removeentry(in a
string name, in a
string value); attributes attribute type description dbconnection mozistor...
...void addentry( in a
string name, in a
string value ); parameters name value entryexists() gets whether a name and value pair exists in the form history.
... boolean entryexists( in a
string name, in a
string 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 ac
string 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 autf8
string the local ip address to which the channel is bound, in the same format produced by pr_netaddrto
string().
... obsolete since gecko 1.9 remoteaddress autf8
string the ip address of the remote host to which this channel is bound, in the same format produced by pr_netaddrto
string().
...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(); a
string getlocalecomponentforuseragent(); nsilocale getlocalefromacceptlanguage(in
string acceptlanguage); nsilocale getsystemlocale(); nsilocale newlocale(in a
string 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.).
...a
string getlocalecomponentforuseragent(); parameters none.
...And 3 more matches
nsINavHistoryQuery
annotation autf8
string the annotation name.
... domain autf8
string 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 autf8
string 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 autf8
string 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 autf8
string anewtitle); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long aoldindex); void nodetagschanged(in nsinavhistoryresultnode anode); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8
string anewuri); void nodereplaced(in nsinavhistorycontainerresultnode parent, in nsinavhistoryresultnode olditem, in nsinavh...
... void nodeannotationchanged( in nsinavhistoryresultnode anode, in autf8
string 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 w
string args, in unsigned long count); void runwasync([array, size_is(count)] in w
string 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 a
string title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in ac
string 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 a
string atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void setviewerbounds(in nsintrect bounds); native code only!
... contenttype ac
string 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(); a
string getdataasbase64(); void initfrombase64(in a
string 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 a
string the final url this patch was being downloaded from.
... hashfunction a
string the hash function to use when determining the integrity of the patch file.
... hashvalue a
string 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 ac
string amsg); void onmessageavailable(in nsisupports acontext, in autf8
string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8
string 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 ac
string amsg ); parameters acontext user defined context.
...void onmessageavailable( in nsisupports acontext, in autf8
string amsg ); parameters acontext user defined context.
...And 3 more matches
nsIXULBrowserWindow
method overview a
string onbeforelinktraversal(in a
string originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); void setjsdefaultstatus(in a
string status); void setjsstatus(in a
string status); void setoverlink(in a
string link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
...a
string onbeforelinktraversal( in a
string 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 a
string getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id a
string id of the result.
... type a
string 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
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 dom
string 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 dom
string contenttype); file getfile(in dom
string name, [optional] in dom
string 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 dom
string representing the css property name (hyphen case) to be modified.
... value optional is a dom
string containing the new property value.
... if not specified, treated as the empty
string.
...And 3 more matches
ChildNode.after() - Web APIs
the childnode.after() method inserts a set of node or dom
string objects in the children list of this childnode's parent, just after this childnode.
... dom
string objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.after((node or dom
string)...
...And 3 more matches
ChildNode - Web APIs
childnode.before() inserts a set of node or dom
string objects in the children list of this childnode's parent, just before this childnode.
... dom
string objects are inserted as equivalent text nodes.
... childnode.after() inserts a set of node or dom
string 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
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 to
string() 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.to
string() 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 dom
string that represents the color of active hyperlinks.
... htmlbodyelement.background is a dom
string that represents the description of the location of the background image resource.
... htmlbodyelement.bgcolor is a dom
string that represents the background color for the document.
...And 3 more matches
HTMLEmbedElement - Web APIs
htmlembedelement.align is a dom
string representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... htmlembedelement.height is a dom
string reflecting the height html attribute, containing the displayed height of the resource.
... htmlembedelement.name is a dom
string 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 dom
string 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 dom
string representing a bcp 47 language tag.
... badge: a usv
string containing the url of the image used to represent the notification when there isn't enough space to display the notification itself.
... body: a dom
string representing the body text of the notification, which is displayed below the title.
...And 3 more matches
ParentNode.append() - Web APIs
the parentnode.append() method inserts a set of node objects or dom
string objects after the last child of the parentnode.
... dom
string objects are inserted as equivalent text nodes.
... differences from node.appendchild(): parentnode.append() allows you to also append dom
string 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 constraindom
string 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 constraindom
string 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 exportedas
string = ab2str(exported); const exportedasbase64 = window.btoa(exportedas
string); 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 usv
string as input, and returns a uint8array containing utf-8 encoded text.
... textencoder.prototype.encodeinto() takes a usv
string 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 dom
string specifying a media segment data type for the sourcebuffer to contain.
... language a dom
string specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track.
... label a dom
string 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.to
string() returns a
string containing a query
string suitable for use in a url.
... examples var params
string = "q=urlutils.searchparams&topic=api"; var searchparams = new urlsearchparams(params
string); //iterate the search parameters.
...And 3 more matches
VideoTrack.kind - Web APIs
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 dom
string 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.addfrom
string() method.
...And 3 more matches
Window.prompt() - Web APIs
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 usv
string 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 byte
string values.
... body any body that you want to add to your request: this can be a blob, buffersource, formdata, urlsearchparams, usv
string, or readablestream object.
...And 3 more matches
XMLHttpRequest - Web APIs
xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a dom
string, depending on the value of xmlhttprequest.responsetype, that contains the response entity body.
... xmlhttprequest.responsetext read only returns a dom
string 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 serializeto
string() method to construct an xml
string representing a dom tree.
... methods serializeto
string() 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
stallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthqueuingstrategy byte
string c cdatasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssom
string 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 constraindom
string 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 dom
string dom
stringlist dom
stringmap 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, animation
string = '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 ]...
...; animation
string = pfx + 'animation'; keyframeprefix = '-' + pfx.tolowercase() + '-'; animation = true; break; } } } for starters we define a few variables.
...we set the animation
string to animation which is the property we want to set later on.
...And 3 more matches
counters() - CSS: Cascading Style Sheets
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
value a dom
string representing the value of the checkbox.
... events change and input supported common attributes checked idl attributes checked, indeterminate and value methods select() value a dom
string 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
value a dom
string 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 dom
string 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
value a dom
string representing the value contained in the search field.
... value the value attribute contains a dom
string 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
alignobsolete since html5 a dom
string 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 dom
string specifying a color to apply to the backgrounds of each of the row's cells.
... charobsolete since html5 a dom
string 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 sub
string 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 longest
string() { 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.tolocale
string() 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.tolocale
string() 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 my
string = new
string('hello'); //
string object var s = boolean(my
string); // 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 to
string 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.tolocale
string() 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.tolocale
string() 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.tolocale
string() 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.tolocale
string() 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.tolocale
string() 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 sub
string 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.to
string() // shows [object object] > ocn.to
string() // throws error: ocn.to
string 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.to
string = object.to
string; // since new object lacks method then try assigning it directly from standard-object > ocn.to
string // shows "to
string() { [native code] }" -- missing method seems to be there now > ocn.to
string == object.to
string // shows "true" -- method seems to be same as the standard object-method > ocn.to
string() // error: function.prototype.to
string 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.to
string = object.to
string; // error: cannot set property 'to
string' of undefined ocn.prototype = {}; // try to create a prototype ocn.prototype.to
string = object.to
string; // since new object lacks method then try assigning it from standard-object > ocn.to
string() // error: ocn.to
string 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 sub
strings.
...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 sub
strings 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 sub
string matches.
... the number of possible parenthesized sub
strings is unlimited, but the regexp object can only hold the first nine.
... you can access all parenthesized sub
strings 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.tolocale
string() 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.tolocale
string() 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.tolocale
string() 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.tolocale
string() 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.tolocale
string() 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 to
string 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 to
string() 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
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(unicode
string, "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().to
string();' + ' 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().to
string();' + ' 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(ahtml
string){ 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(ahtml
string, 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) my
string; }; 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(content
stringflavor
string)
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(content
stringflavor
string)
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.parsefrom
string(
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.
... sub
string matching selectors these selectors allow for more advanced matching of sub
strings 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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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 dom
string 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 a
string 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 a
string 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 nsi
stringbundleservice has been set with a badly encoded property file.
...see nsi
stringbundle.
... ns_error_dom_dom
string_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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: name a dom
string representing the <meta> name attribute value.
... content a dom
string 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); fm
string = pr_exportfilemapas
string( fm ); addr = pr_memmap(fm); ...
... application specific technique to pass fm
string 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_errorto
string was introduced with nss 3.13.
... * though pr_errorto
string was available, support for it in nss wasn't.
... */ #ifndef port_errorto
string #ifndef sec_error_base #define sec_error_base (-0x2000) #define port_errorto
string(err) pr_errorto
string((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_decodetrust
string 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_getoid
string 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_nickname
stringsfromcertlist 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
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* js
string* 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<js
string*> js::rooted
string 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<js
string*> js::handle
string 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; } js
string *str = rval.to
string(); printf("%s\n", js_encode
string(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; } js
string *str = rval.to
string(); printf("%s\n", js_encode
string(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; } js
string *str = rval.to
string(); printf("%s\n", js_encode
string(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, handle
string filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handle
string message, mutablehandlevalue rval); // obsolete since jsapi 39 bool js::createerror(jscontext *cx, jsexntype type, handle
string stack, handle
string filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handle
string message, mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... stack js::handle
string or js::handleobject the value of error.prototype.stack.
... filename js::handle
string 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.is
string() js::
stringvalue(js
string*) val.to
string() val.set
string(js
string *) object val.isobject() js::objectvalue(jsobject&), 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.to
string() must only be called if val.is
string(), 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 js
string.
... syntax js
string * js_getfunctionid(jsfunction *fun); js
string * 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 js
string, 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 js
string * 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::handle
string 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::handle
string the
string to test.
...And 2 more matches
Gecko object attributes
this is in contrast to text attributes, which apply only to sub
strings 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 a
string aname) extipreference get(in a
string aname) nsivariant getvalue(in a
string aname, in nsivariant adefaultvalue) void setvalue(in a
string aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute a
string the name of the branch root.
... boolean has(in a
string 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 a
string 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 a
string 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, nsc
string& 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 nsc
string& 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 nsac
string& 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& a
string ); parameters a
string [in] a nsac
string 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& a
string ); parameters a
string [in] a nsac
string 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& a
string ); parameters a
string [in] a nsa
string 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& a
string ); parameters a
string [in] a nsa
string 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 a
string 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 a
string 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 dom
string pseudoelt, in dom
string propertyname); dom
string getcomputedstylevalue(in dom
string pseudoelt, in dom
string 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 dom
string 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 dom
string 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 autf8
string aname); void onitemannotationset(in long long aitemid, in autf8
string aname); void onpageannotationremoved(in nsiuri auri, in autf8
string aname); void onpageannotationset(in nsiuri apage, in autf8
string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item.
...void onitemannotationremoved( in long long aitemid, in autf8
string aname ); parameters aitemid the item whose annotation is to be deleted.
...void onitemannotationset( in long long aitemid, in autf8
string 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 w
string dialogtitle, in w
string text, in w
string passwordrealm, in pruint32 savepassword, in w
string defaulttext, out w
string result); boolean promptpassword(in w
string dialogtitle, in w
string text, in w
string passwordrealm, in pruint32 savepassword, inout w
string pwd); boolean promptusernameandpassword(in w
string dialogtitle, in w
string text, in w
string passwordrealm, in pruint32 savep...
...assword, inout w
string user, inout w
string pwd); constants constant value description save_password_never 0 never saves the password.
... boolean prompt( in w
string dialogtitle, in w
string text, in w
string passwordrealm, in pruint32 savepassword, in w
string defaulttext, out w
string 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 w
string 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 autf8
string 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 autf8
string 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 dom
string 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 dom
string the name of the event (case-insensitive).
... void initevent( in dom
string eventtypearg, in boolean canbubblearg, in boolean cancelablearg ); parameters eventtypearg specifies the event type.
...And 2 more matches
nsIDOMWindowInternal
void alert(in dom
string text) boolean confirm(in dom
string text) dom
string prompt([optional] in dom
string amessage, [optional] in dom
string ainitial, [optional] in dom
string 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 dom
string url, in dom
string name, in dom
string options) nsidomwindow nsisupports aextraargument) void close() void updatecommands(in dom
string action) boolean find([optional] in dom
string 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) dom
string atob(in dom
string aascii
string) dom
string btoa(in dom
string abase64data) nsivariant showmodaldialog(in nsivariant aargs, [optional] in dom
string aoptions) void postmessage(in dom
string message, in dom
string 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 dom
string this should be set to a character that is used as a shortcut key.
... command dom
string this property reflects the element's command attribute.
... crop dom
string 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(); a
string tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events.
... type a
string 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 ac
string id; /* action name to display in action list.
...*/ readonly attribute a
string 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 is
stringattribute(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 ac
string arbitraryheader; hdrproperty /** * not to be confused with arbitraryheader, which is a header in the * rfc822 message.
... */ attribute ac
string hdrproperty; customid /// identifier for a custom id used for this term, if any.
... attribute ac
string customid; beginsgrouping attribute boolean beginsgrouping; endsgrouping attribute boolean endsgrouping; methods matchrfc822
string boolean matchrfc822
string(in
string a
string, in
string charset, in boolean charsetoverride); matchrfc2047
string boolean matchrfc2047
string(in
string a
string, 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 autf8
string auri
string, 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 autf8
string a
string representing the dynamic container api service responsible for this container.
... remotecontainertype obsolete since gecko 1.9 autf8
string a
string representing the remote container service api that is responsible for this container.
...And 2 more matches
nsINavHistoryResultNode
icon autf8
string 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 a
string 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 a
string converttoplaintext(in a
string src, in unsigned long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in a
string fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); a
string sanitize(in a
string src, in unsigned long flags); constants constant value description sanitizerallowcommen...
... a
string converttoplaintext( in a
string 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 a
string 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 autf8
string ahost, in a
string auser, in a
string apassword); void removeuser(in autf8
string ahost, in a
string auser); void addreject(in autf8
string ahost); void removereject(in autf8
string ahost); attributes attribute type description enumerator nsisimpleenumerator readonly: an enumeration of the st...
... a
string adduser(in autf8
string ahost, in a
string auser, in a
string apassword); parameters ahost the hostname of the password to store.
... void removeuser(in autf8
string ahost, in a
string 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 w
string aprinter, in nsiprintsettings aprintsettings); void enumerateprinters(out pruint32 acount,[retval, array, size_is(acount)] out w
string aresult); obsolete since gecko 1.9 void initprintsettingsfromprinter(in w
string aprintername, in nsiprintsettings aprintsettings); attributes attribute type description defaultprintername w
string the name of the system default printer.
... printernamelist nsi
stringenumerator the list of printer names.
... methods displaypropertiesdlg() void displaypropertiesdlg( in w
string 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 dom
string scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void getsubscription(in dom
string scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void unsubscribe(in dom
string scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback); methods subscribe() creates a push subscription.
... void subscribe( in dom
string 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 dom
string 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 a
string fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element); a
string unescape(in a
string src); methods parsefragment() parses a
string of html or xml source into a sanitized documentfragment.
... nsidomdocumentfragment parsefragment( in a
string 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 dom
string asender, in dom
string abody, in unsigned long long adate); long savesentmessage(in dom
string areceiver, in dom
string 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 dom
string asender, in dom
string abody, in unsigned long long adate ); parameters asender a dom
string with the sender of the text message.
... abody a dom
string 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 autf8
string 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 autf8
string 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 ac
string ab, in ac
string agvb, in ac
string arb, in ac
string ahkdfinfo, out ac
string aaes256key, out ac
string ahmac256key); void round1(in ac
string asignerid, out ac
string agx1, out ac
string agv1, out ac
string ar1, out ac
string agx2, out ac
string agv2, out ac
string ar2); void round2(in ac
string apeerid, in ac
string apin, in ac
string agx3, in ac
string agv3, in ac
string ar3, in ac
string agx4, in ac
string agv4, in ac
string ar4, out ac
string aa, out ac
string agva, out ac
string ara); methods final() perform the fin...
...void final( in ac
string ab, in ac
string agvb, in ac
string arb, in ac
string ahkdfinfo, out ac
string aaes256key, out ac
string ahmac256key ); parameters ab schnorr signature value b, in hex representation.
...void round1( in ac
string asignerid, out ac
string agx1, out ac
string agv1, out ac
string ar1, out ac
string agx2, out ac
string agv2, out ac
string ar2 ); parameters asignerid
string identifying the signer.
...And 2 more matches
XPCOM Interface Reference
nsicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicomposition
stringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2...
...esulttreeviewernsinavhistoryresultviewobservernsinavhistoryresultviewernsinavhistoryservicensinavhistoryvisitresultnodensinetworklinkservicensiobservernsiobserverservicensioutputstreamnsioutputstreamcallbacknsiparentalcontrolsservicensiparserutilsnsipasswordnsipasswordmanagernsipermissionnsipermissionmanagernsipipensiplacesimportexportservicensiplacesviewnsipluginhostnsiprefbranch2nsipreflocalized
stringnsiprefservicensiprincipalnsiprinterenumeratornsiprintingpromptnsiprivatebrowsingservicensiprocessnsiprocess2nsiprocessscriptloadernsiprofilensiprofilelocknsiprofileunlockernsiprogramminglanguagensiprogresseventsinknsipromptnsipromptservicensipropertiesnsipropertynsipropertybagnsipropertybag2nsipropertyelementnsiprotocolhandlernsiprotocolproxycallbacknsiprotocolproxyfilternsiprotocolproxyservicens...
...selectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketlistenernsiservicemanagernsisessionstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandardurlnsistreamconverternsistreamlistenernsi
stringbundlensi
stringbundleoverridensi
stringbundleservicensi
stringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportsc
stringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspruint8nsisupportspruint16nsisup...
...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 to
string(); }; a
string nsisupports
string @mozilla.org/supports-
string;1 [scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)] interface nsisupports
string : nsisupportsprimitive { attribute a
string data; w
string to
string(); }; prbool nsisupportsprbool @mozilla.org/supports-prbool;1 [scriptable, uuid(ddc3b490-4a1c-11d3-9890-006008962422)] interface nsisupportsprbool : nsisupportsprim...
...itive { attribute prbool data;
string to
string(); }; pruint8 nsisupportspruint8 @mozilla.org/supports-pruint8;1 [scriptable, uuid(dec2e4e0-4a1c-11d3-9890-006008962422)] interface nsisupportspruint8 : nsisupportsprimitive { attribute pruint8 data;
string to
string(); }; pruint16 nsisupportspruint16 @mozilla.org/supports-pruint16;1 [scriptable, uuid(dfacb090-4a1c-11d3-9890-006008962422)] interface nsisupportspruint16 : nsisupportsprimitive { attribute pruint16 data;
string to
string(); }; pruint32 nsisupportspruint32 @mozilla.org/supports-pruint32;1 [scriptable, uuid(e01dc470-4a1c-11d3-9890-006008962422)] interface nsisupportspruint32 : nsisupportsprimitive { attribute pruint32 data;
string to
string(); }; pruint64 nsisupportspruint64 @mozilla.org/supports-prui...
...nt64;1 [scriptable, uuid(e13567c0-4a1c-11d3-9890-006008962422)] interface nsisupportspruint64 : nsisupportsprimitive { attribute pruint64 data;
string to
string(); }; prtime nsisupportsprtime @mozilla.org/supports-prtime;1 [scriptable, uuid(e2563630-4a1c-11d3-9890-006008962422)] interface nsisupportsprtime : nsisupportsprimitive { attribute prtime data;
string to
string(); }; char nsisupportschar @mozilla.org/supports-char;1 [scriptable, uuid(e2b05e40-4a1c-11d3-9890-006008962422)] interface nsisupportschar : nsisupportsprimitive { attribute char data;
string to
string(); }; 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_c
string("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_c
string("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 w
string 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 w
string 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 to
string() methods tosource() returns the
string "ctypes.***_abi".
...
string tosource() parameters none.
... to
string() 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 sub
string 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 dom
string which uniquely identifies the track within the media.
... kind read only a dom
string specifying the category into which the track falls.
... label read only a dom
string providing a human-readable label for the track.
...And 2 more matches
Blob - Web APIs
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 usv
string 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 get
stringvalue() method.
...the value can be obtained by using the get
stringvalue() 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 dom
string specifying the selector portion of the css rule.
... the default is the
string undefined.
... styleblock a dom
string indicating the style block to apply to elements matching the selector.
...And 2 more matches
ChildNode.before() - Web APIs
the childnode.before() method inserts a set of node or dom
string objects in the children list of this childnode's parent, just before this childnode.
... dom
string objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.before((node or dom
string)...
...And 2 more matches
console.assert() - Web APIs
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
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 dom
string representing a message or description associated with the given error name.
... domexception.name read only returns a dom
string 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 dom
string) 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 dom
string representing the type of data to retrieve.
...And 2 more matches
Document.querySelector() - Web APIs
syntax element = document.queryselector(selectors); parameters selectors a dom
string 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
it can also be set to replace the element with nodes parsed from the given
string.
... syntax var content = element.outerhtml; element.outerhtml = html
string; value reading the value of outerhtml returns a dom
string 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 html
string.
...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.readasbinary
string() this method converts a specified blob or a file into a dom
string representing the input data as a binary
string.
... filereadersync.readastext() this method converts a specified blob or a file into a dom
string representing the input data as a text
string.
...And 2 more matches
HTMLFieldSetElement - Web APIs
htmlfieldsetelement.name a dom
string reflecting the name html attribute, containing the name of the field set.
... htmlfieldsetelement.typeread only the dom
string "fieldset".
... htmlfieldsetelement.validationmessage a dom
string 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 dom
strings (dom
stringmap) 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 dom
stringmap 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 dom
string that indicates the horizontal alignment of the cell data in the column.
... htmltablecolelement.ch is a dom
string representing the alignment character for cell data.
... htmltablecolelement.choff is a dom
string representing the offset for the alignment character.
...And 2 more matches
HTMLTableRowElement - Web APIs
htmltablerowelement.align is a dom
string containing an enumerated value reflecting the align attribute.
... htmltablerowelement.bgcolor is a dom
string containing the background color of the cells.
... htmltablerowelement.ch is a dom
string 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 dom
string.
... 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 dom
string containing a unique identifier (guid) for the track; it is generated by the browser.
... mediastreamtrack.kind read only returns a dom
string 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 dom
string 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 dom
string 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 usv
string containing a url pointing to an image for an icon.
... passwordcredential.idname secure context a usv
string 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 usv
string 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 dom
string representing the type of performance metric such as, for example, "mark".
... mark performancemark dom
string the name used when the mark was created by calling performance.mark().
... measure performancemeasure dom
string 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 dom
string 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 dom
string 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
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 usv
string (text) representation of the request body.
...And 2 more matches
SVGAngle - Web APIs
setting this attribute will cause valueinspecifiedunits and valueas
string to be updated automatically to reflect this setting.
...setting this attribute will cause value and valueas
string to be updated automatically to reflect this setting.
... valueas
string the value as a dom
string value, in the units expressed by unittype.
...And 2 more matches
SVGDocument - Web APIs
interface overview also implement none methods none properties dom
string domain dom
string referrer svgsvgelement rootelement dom
string title dom
string url normative document svg 1.1 (2nd edition) properties name type description ...
... domain dom
string 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 dom
string 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 dom
string representing the url of the script the worker will execute.
... name optional a dom
string 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 dom
string 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 usv
string, which will be parsed from application/x-www-form-urlencoded format.
... a sequence of usv
string pairs, representing names/values.
... a record of usv
string keys and usv
string values.
...And 2 more matches
VideoTrack - Web APIs
id read only a dom
string which uniquely identifies the track within the media.
... kind read only a dom
string specifying the category into which the track falls.
... label read only a dom
string 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
the window.find() method finds a
string in a window.
... syntax window.find(a
string, acasesensitive, abackwards, awraparound, awholeword, asearchinframes, ashowdialog); a
string 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 dom
string representing the language version of the browser.
... navigatorlanguage.languagesread only returns an array of dom
strings 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(binary
string); parameters binary
string a dom
string which encodes the binary content to be sent.
... you can create the binary
string using the filereader method readasbinary
string().
...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
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(test
string, regexp
string[, flags
string]) parameters test
string the
string to test..
... regexp
string 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
value a dom
string 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 dom
string 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
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 {to
string: 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 to
string 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).to
string(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.to
string());" + " 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.to
string()," + " 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 data
string = "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.nsi
stringinputstream); if ("data" in
stringstream) // gecko 1.9 or newer
stringstream.data = data
string; else // 1.8 or older
stringstream.setdata(data
string, data
string.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(uri
string, 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(uri
string, 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), uri
string, uricharset, baseuri); in all cases the baseuri can be null if the uri
string 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.get
string("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 dump
string = 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 dom
string signtext(dom
string stringtosign, dom
string caoption /* ...
... */); loading pkcs #11 modules long deletemodule(dom
string modulename); long addmodule(dom
string modulename, dom
string 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 dom
string 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.
...
stringmountpath
string 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.
...
stringmountpath
string 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
methods import(
stringmountpath
string)imports the requested experimental feature into the script.
...
stringmountpath
string 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 sub
string 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 a
string 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.read
string(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.read
string(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, read
string 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 push
string "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 push
string "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 push
string "convert_o null" push
string "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 push
string "convert_o null" // test name push
string "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 setvalue
string 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).to
string(); } 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.to
string().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, aref
string) { // 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
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
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
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 w
string 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
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 "ns
stringapi.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_c
string("libraries")); library->appendnative(ns_literal_c
string("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentc
string(*dependent)); prlibrary *lib; library->load(&lib); // 1) we don't care if this failed!
... } library->setnativeleafname(ns_literal_c
string(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::[methodname
string].
...observe: var element = <foo> <!-- my comment --> <bar/> </foo>; element.comments().length(); // returns 0 element.toxml
string(); // returns <foo><bar/></foo> xml.ignorecomments = false; element = <foo> <!-- my comment --> <bar/> </foo>; element.comments().length(); // returns 1 element.toxml
string(); // returns <foo><!-- my comment --><bar/></foo> ignoreprocessinginstructions true by default.
...for example var element = <foo> <?process x="true"?> <bar/> <?process x="false"?> </foo>; element.toxml
string(); // returns <foo><bar/></foo> xml.ignoreprocessinginstructions = false; var element = <foo> <?process x="true"?> <bar/> <?process x="false"?> </foo>; element.toxml
string(); // returns <foo><?process x="true"?><bar/><?process x="false"?></foo> ignorewhitespace true by default.
...when true, toxml
string() 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.toutc
string() 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 to
string().
...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.to
string() now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its to
string() 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.tolocaledate
string().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.
... */ dom
string getvalue(); /** * set value of instance node.
... */ void setvalue(in dom
string 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 immutable
string = "hello"; // in the above code, a new object with
string value is created.
... immutable
string = immutable
string + "world"; // we are now appending "world" to the existing value.
... on appending the "immutable
string" with a
string value, following events occur: existing value of "immutable
string" is retrieved "world" is appended to the existing value of "immutable
string" the resultant value is then allocated to a new block of memory "immutable
string" 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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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 new
string = mytext.replace('
string', 'sausage'); console.log(new
string); // 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(madea
string); // 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 sub
string to find in the main
string, and the sub
string to replace that
string with: let mytext = 'i am a
string'; let new
string = 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 madea
string = myarray.join(' '); // returns 'i love chocolate frogs' let madea
string = 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 new
string = mytext.replace('cold', 'warm'); console.log(new
string); // should print "the weather is warm" // the replace()
string function takes a
string, // replaces one sub
string 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 sub
string 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 new
string.
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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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: my
string.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 — to
string, valueof, etc — these are defined on person1's prototype object's prototype object, which is object.prototype.
... so object.prototype.to
string(), 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 my
string = 'this is my
string.'; my
string 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.queriestoquery
string([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 filter
string, array folderrestrict ); parameters filter
string 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(search
string, casesensitivity); returns void.
... parameters search
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: href a dom
string representing the path to the new icon.
... sizes a dom
string listing the sizes the new icon is available in, e.g.
...the any keyword can also be used, to represent "any size." rel a dom
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: url a dom
string representing the url of the document loaded within the frameelement property.
... name a dom
string representing the name of the new browser window.
... features a dom
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: state a dom
string representing the current state of ssl security.
... trackingstate a dom
string representing the current loading state of tracking content.
... mixedstate a dom
string representing the current loading state of mixed active content.
Overview of Mozilla embedding APIs
ns
string 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.to
string and object.prototype.to
string version 1.2 only returns array or object literal notation ("[1]" or "{a:1, b:2}" for example).
...
string.prototype.sub
string 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 js
strings must be 8-byte-aligned.
... lifetime invariants in some places, pointers to jsobjects and js
strings must refer to live heap objects, but this is not a hard fast rule, especially for
strings.
... some js
strings are allocated on the stack for quick operations.
... some commonly used
strings are allocated statically; see js
string::isstatic().
JS::Remove*Root
syntax void removevalueroot(jscontext *cx, js::heap<js::value> *vp); void remove
stringroot(jscontext *cx, js::heap<js
string *> *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 remove
stringrootrt(jsruntime *rt, js::heap<js
string *> *rp); void removeobjectrootrt(jsruntime *rt, js::heap<jsobject *> *rp); void removescriptrootrt...
... rp js::heap<js
string *> address of the js
string * variable to remove from the root set.
... this must have been passed to either js::add
stringroot or js::addnamed
stringroot.
... see also mxr id search for js::removevalueroot mxr id search for js::remove
stringroot mxr id search for js::removeobjectroot mxr id search for js::removescriptroot mxr id search for js::removevaluerootrt mxr id search for js::remove
stringrootrt 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::handle
string 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::handle
string 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::handle
string 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::handle
string 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_valueto
string bug 1037718 ...
JS_Remove*Root
syntax jsbool js_removevalueroot(jscontext *cx, jsval *vp); jsbool js_remove
stringroot(jscontext *cx, js
string **spp); jsbool js_removeobjectroot(jscontext *cx, jsobject **opp); jsbool js_removegcthingroot(jscontext *cx, void **rp); name type description cx jscontext * a context.
... spp js
string * address of the js
string* variable to remove from the root set.
... this must have been passed to either js_add
stringroot or js_addnamed
stringroot.
...see also mxr id search for js_removevalueroot mxr id search for js_remove
stringroot 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_get
stringchars.
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_setc
stringsareutf8.
... js_encode
string is a new variation on js_get
stringbytes 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_newgrowable
string (can be replaced with js_newuc
string) 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_valueto
string (replaced by js::to
string) 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_sub
string [ test_path_sub
string_2 ...
... ] this runs all the tests whose paths contain test_path_sub
string.
... thus, you can run one test by giving its filename, or any sub
string that is a sub
string 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 to
string 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.parsefrom
string(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 parsefrom
string() method.
extISessionStorage
return type method boolean has(in a
string aname) void set(in a
string aname, in nsivariant avalue) nsivariant get(in a
string 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 a
string aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise.
... void set(in a
string 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 a
string 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 parsefrom
string() 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 to
string, 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 foowith
string(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 (ns
string, 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 ns
stringhashkey/nsc
stringhashkey 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<nsc
stringhashkey, 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<ns
stringhashkey> 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_c
stringgetdata function can be used to determine if a nsac
string instance has null-terminated storage.
... see also beginreading, ns_c
stringgetdata, nsac
string ...
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_c
stringgetdata function can be used to determine if a nsa
string instance has null-terminated storage.
... see also beginreading, ns_c
stringgetdata, nsa
string ...
operator+=
self_type& operator+=( const self_type& a
string ); parameters a
string [in] a nsa
string 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 a
string [in] a nsa
string to append to this
string.
IAccessibleEditableText
the sub
strings used with this interface are specified as follows: if startoffset is less than endoffset, the sub
string 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 a
string aurl, in a
string askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in a
string 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 a
string aurl, in a
string askin ); parameters atype unused, retained for backwards compatibility.
... boolean startsoftwareupdate( in a
string 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 a
string 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); a
string getrowdescription(in long rowindex); long getrowextentat(in long ...
... note: renamed from selectedrowscount in gecko 1.9.2 summary a
string the summary description for the table.
... a
string getcolumndescription( in long columnindex ); parameters columnindex the column index.
... a
string 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 sub
string match.
... method overview void init(in unsigned long itemtype, in ac
string namespacespec, in ac
string data); attributes attribute type description data ac
string data associated with the namespace, such as a fallback.
... namespacespec ac
string the prefix of this namespace.
... void init( in unsigned long itemtype, in ac
string namespacespec, in ac
string data ); parameters itemtype the namespace type.
nsIAutoCompleteInput
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview ac
string 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 a
string an additional parameter used for configuring searches.
... textvalue a
string the value of the text in the autocomplete text field.
...ac
string 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 a
string appversion, [optional] in a
string toolkitversion); unsigned long getpluginblockliststate(in nsiplugintag plugin, [optional] in a
string appversion, [optional] in a
string toolkitversion); boolean isaddonblocklisted(in jsval addon, [optional] in a
string appversion, [optional] in a
string toolkitversion); constants constant value description state_not_blocked 0 state_softblocked 1 ...
...unsigned long getaddonblockliststate( in jsval addon, in a
string appversion, optional in a
string toolkitversion optional ); parameters addon the addon object whose blocklist state is to be determined.
...unsigned long getpluginblockliststate( in nsiplugintag plugin, in a
string appversion, optional in a
string toolkitversion optional ); parameters plugin the plugin to get the state for.
...boolean isaddonblocklisted( in jsval addon, in a
string appversion, optional from gecko 1.9.1 in a
string 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 ac
string key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in ac
string key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in ac
string key, in nsicachelistener listener); attributes attribute type description doomentri...
...void asyncopencacheentry( in ac
string key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait ); parameters key the key for cache entry.
...void doomentry( in ac
string key, in nsicachelistener listener ); parameters key the key for cache entry.
...nsicacheentrydescriptor opencacheentry( in ac
string 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 ac
string 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 ac
string 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 ac
string charset, in nsisupports closure); ac
string 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 ac
string charset, in nsisupports closure ); parameters charset the detected charset.
...ac
string 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 copy
string(in a
string a
string); void copy
stringtoclipboard(in a
string a
string, in long aclipboardid); methods copy
string() this method copies
string to (default) clipboard.
... void copy
string( in a
string a
string ); parameters a
string the
string to copy to the clipboard.
... copy
stringtoclipboard() this method copies
string to given clipboard.
... void copy
stringtoclipboard( in a
string a
string, in long aclipboardid ); parameters a
string the
string to copy to the clipboard.
nsICookie
host autf8
string the host (possibly fully qualified) of the cookie.
... name ac
string the name of the cookie.
... path autf8
string the path pertaining to the cookie.
... value ac
string the cookie value.
nsIDNSRecord
ac
string getnextaddras
string(); boolean hasmore(); void rewind(); attributes attribute type description canonicalname ac
string for example, www.mozilla.org --> rheet.mozilla.org.
...getnextaddras
string() this function returns the value of the next ip address as a
string and increments the internal address iterator.
... ac
string getnextaddras
string(); parameters none.
... return value the value of the next ip address as a
string.
nsIDNSService
method overview nsicancelable asyncresolve(in autf8
string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8
string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8
string read only.
...nsicancelable asyncresolve( in autf8
string 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 autf8
string 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.getnextaddras
string(); 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 dom
string atype); void addsystemeventlistener(in nsidomeventtarget target, in dom
string type, in nsidomeventlistener listener, in boolean usecapture); void removesystemeventlistener(in nsidomeventtarget target, in dom
string type, in nsidomeventlistener listener, in boolean usecapture); attributes attribute type description ...
...boolean haslistenersfor( in nsidomeventtarget aeventtarget, in dom
string atype ); parameters aeventtarget the nsidomeventtarget for which to check if this has any listener for atype.
...void addsystemeventlistener( in nsidomeventtarget target, in dom
string 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 dom
string type, in nsidomeventlistener listener, in boolean usecapture ); parameters target the nsidomeventtarget for the event target listening the event.
nsIFrameLoader
method overview void activateframeevent(in a
string atype, in boolean capture); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in a
string atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcrossprocessmouseevent(in a
string atype, in float ax, in float ay, ...
... void activateframeevent( in a
string atype, in boolean capture ); parameters atype the event type for which to enable forwarding.
... void sendcrossprocesskeyevent( in a
string atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault ); parameters atype the event type.
... void sendcrossprocessmouseevent( in a
string 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 a
string amessage, in nsiframemessagelistener alistener, [optional] in boolean listenwhenclosed); void removemessagelistener(in a
string amessage, in nsiframemessagelistener alistener); void sendasyncmessage(in a
string amessage, in a
string json); methods addmessagelistener() adds a message listener to the local frame.
... void addmessagelistener( in a
string amessage, in nsiframemessagelistener alistener [optional in boolean listenwhenclosed ); parameters amessage the name of the message for which to add a listener.
... void removemessagelistener( in a
string amessage, in nsiframemessagelistener alistener ); parameters amessage the name of the message for which to remove a listener.
... void sendasyncmessage( in a
string amessage, in a
string json ); parameters amessage the name of the message to send to the listeners.
nsIINIParserWriter
once the writer object is created, you can use the set
string() 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 set
string(in autf8
string asection, in autf8
string akey, in autf8
string 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 set
string() set the value of a property
string for a particular section and key.
... void set
string( in autf8
string asection, in autf8
string akey, in autf8
string 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 a
string name, in nsiuri siteuri, in nsiuri feeduri, in long index); long long createlivemarkfolderonly(in long long folder, in a
string 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 a
string 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 a
string 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 a
string returns the display name of the application bundle (usually the human readable name of the application) read only.
... bundleidentifier autf8
string 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 autf8
string a human-readable description of this memory usage report.
... path autf8
string the path that this memory usage should be reported under.
... process ac
string 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 a
string body a
string bodyisasciionly prbool cc a
string characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc a
string fcc2 a
string followupto char * forcemsgencoding prbool forceplaintext ...
... prbool from a
string hasrecipients prbool readonly new in thunderbird 23 indicates whether something is filled in in the to, cc, or bcc attribute.
...(bug 249530) newsgroups a
string newshost char * newsposturl char * organization a
string otherrandomheaders a
string no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto a
string securityinfo nsisupports subject ...
... a
string templatename a
string temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to a
string 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 ac
string 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 ac
string nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned l...
...ong filterindex ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in a
string 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 a
string 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 ac
string olduri, in ac
string 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 ac
string id; name /// name to display in term list.
...*/ readonly attribute a
string 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 autf8
string searchvalue, in nsmsgsearchopvalue searchop); ...
nsIPermission
host autf8
string the host, that is uri, on which the permission is applied.
... type ac
string 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 dom
string name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint dom
string the subscription url.
... void getkey( in dom
string 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 ac
string entityid); attributes attribute type description entityid ac
string the entity id for this uri.
...pass an empty
string to use anything.
...void resumeat( in unsigned long long startpos, in ac
string 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 w
string message, in w
string sourcename, in w
string 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 w
string message, in w
string sourcename, in w
string 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 dom
string alter, in dom
string direction, in dom
string granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); dom
string to
string(); attributes attribute type description anchornode nsidomnode returns the n...
...void modify( in dom
string alter, in dom
string direction, in dom
string 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.
... to
string() returns the whole selection into a plain text
string.
... dom
string to
string(); 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 to
string(); attributes attribute type description data char provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsDouble
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data double provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsFloat
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data float provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsID
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data nsidptr provides access to the native type represented by the object.
... methods to
string() this method returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsInterfacePointer
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data nsisupports provides access to the native type represented by the object.
... methods to
string() returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRBool
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data prbool provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRInt16
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data print16 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); 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 to
string(); attributes attribute type description data print32 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRInt64
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data print64 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRTime
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data prtime provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRUint16
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data pruint16 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRUint32
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data pruint32 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRUint64
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data pruint64 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISupportsPRUint8
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview
string to
string(); attributes attribute type description data pruint8 provides access to the native type represented by the object.
... methods to
string() this methods returns a
string valued representation of the object.
...
string to
string(); 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 a
string atag); nsivariant gettagsforuri(in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out w
string atags); attributes attribute type description alltags nsivariant retrieves all tags used to tag uris in the data-base (sorted by name).
... tagcontainericonspec autf8
string 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 a
string atag ); parameters atag the tag name.
...nsivariant gettagsforuri( in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out w
string 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 a
string formaturl(in a
string aformat); a
string formaturlpref(in a
string apref); methods formaturl() formats a
string url.
...a
string formaturl( in a
string aformat ); parameters aformat unformatted url as a
string.
...formaturlpref() formats a
string url stored in a preference.
...a
string formaturlpref( in a
string 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 a
string 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 a
string 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 w
string 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 w
string 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 w
string 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 w
string, 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 dom
string namespaceuri, in dom
string localname); void importstylesheet(in nsidomnode style); void removeparameter(in dom
string namespaceuri, in dom
string localname); void reset(); void setparameter(in dom
string namespaceuri, in dom
string localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in ...
...nsivariant getparameter( in dom
string namespaceuri, in dom
string localname ); parameters namespaceuri the namespaceuri of the xslt parameter.
...void removeparameter( in dom
string namespaceuri, in dom
string localname ); parameters namespaceuri the namespaceuri of the xslt parameter.
...void setparameter( in dom
string namespaceuri, in dom
string localname, in nsivariant value ); parameters namespaceuri the namespaceuri of the xslt parameter.
nsPIPromptService
this interface defines the meaning of each indexes of getint(), setint(), get
string() and set
string() of the nsidialogparamblock interface but they are defined on in c++.
... the indexes for get
string() and set
string() 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: getsort
stringforrow(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 is
string(): return true / false warning!
... do not get confused between getcelltext() and getsort
string/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.get
stringproperty("replyto"); }, getsort
stringforrow: function(hdr) {return hdr.get
stringproperty("replyto");}, is
string: 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 to
string() 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 to
string() 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 to
string() pointertype cdata syntax cdata pointertype(); pointertype is pointertype ctype.
... pointertype cdata method_overview bool isnull() methods inherited from cdata cdata address()
string tosource()
string to
string() 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.to
string()); } 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 dom
string representing the name of the type of the animationevent.
... animationname optional a dom
string containing the value of the animation-name css property associated with the transition.
... pseudoelement optional is a dom
string, 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
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 dom
string representing the namespace uri of the attribute, or null if there is no namespace.
... localname read only a dom
string representing the local part of the qualified name of the attribute.
... prefix read only a dom
string 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 dom
string 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 dom
string 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
syntax var newblob = new blob(array, options); parameters array an array of arraybuffer, arraybufferview, blob, usv
string objects, or a mix of any of such objects, that will be put inside the blob.
... usv
string 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 dom
string 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 dom
string that provides all explicitly set priorities on the css property.
... syntax var priority = style.getpropertypriority(property); parameters property is a dom
string representing the property name to be checked.
... return value priority is a dom
string that represents the priority (e.g.
...if none exists, returns the empty
string.
CSSStyleDeclaration.getPropertyValue() - Web APIs
the cssstyledeclaration.getpropertyvalue() method interface returns a dom
string containing the value of a specified css property.
... syntax var value = style.getpropertyvalue(property); parameters property is a dom
string representing the property name to be checked.
... return value value is a dom
string 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 dom
string 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 dom
string objects.
... dom
string objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.replacewith((node or dom
string)...
... nodes); parameters nodes a set of node or dom
string objects to replace.
CompositionEvent.data - Web APIs
syntax mydata = compositionevent.data value a dom
string 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
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) usv
string inherited from credentialdata.
... name: optional usv
string tbd iconurl: optional usv
string tbd password: (required) usv
string tbd federated: optional an federatedcredentialinit object.
...the available options are: id: (required) usv
string inherited from credentialdata.
... name: optional usv
string tbd iconurl: optional usv
string tbd provider: (required) usv
string tbd protocol: optional usv
string tbd publickey: optional an publickeycredentialcreationoptions object that describes the options for creating a webauthn credential.
DOMError - Web APIs
properties domerror.name read only returns a dom
string representing one of the error type names (see below).
... domerror.message read only returns a dom
string 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 dom
string 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].getas
string(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 constraindom
string 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 constraindom
string 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 dom
string 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
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 dom
string of the internal subset, or null if there is none.
... documenttype.name read only a dom
string, eg "html" for <!doctype html>.
... documenttype.publicid read only a dom
string, eg "-//w3c//dtd html 4.01//en", empty
string for html5.
... documenttype.systemid read only a dom
string, 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.sub
string(1, data.length); if (data.charat(data.length - 1) == " ") data = data.sub
string(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 dom
string 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
syntax new file(bits, name[, options]); parameters bits an array of arraybuffer, arraybufferview, blob, usv
string objects, or a mix of any of such objects, that will be put inside the file.
... usv
string objects are encoded as utf-8.
... name a usv
string representing the file name or the path to the file.
...available options are as follows: type: a dom
string representing the mime type of the content that will be put into the file.
File.getAsText() - Web APIs
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
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.
... readasbinary
string() 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
this can be a usv
string 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 usv
string), 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
this can be a usv
string 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 usv
string), 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 dom
string, an enumerated attribute indicating alignment of the rule with respect to the surrounding context.
... htmlhrelement.color is a dom
string representing the name of the color of the rule.
... htmlhrelement.size is a dom
string representing the height of the rule.
... htmlhrelement.width is a dom
string 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 usv
string 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 dom
string containing the mime type of the media.
... return value a dom
string 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 dom
string gets or sets the value of meta-data property.
... httpequiv dom
string gets or sets the name of an http response header to define for a document.
... name dom
string gets or sets the name of a meta-data property to define for a document.
... scheme dom
string 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 dom
string representing the name of the parameter.
... htmlparamelement.value is a dom
string representing the value associated to the parameter.
... htmlparamelement.type is a dom
string containing the type of the parameter when valuetype has the "ref" value.
... htmlparamelement.valuetype is a dom
string containing the type of the value.
HTMLSourceElement - Web APIs
htmlsourceelement.media is a dom
string reflecting the media html attribute, containing the intended type of the media resource.
... htmlsourceelement.sizes is a dom
string representing image sizes between breakpoints htmlsourceelement.src is a dom
string reflecting the src html attribute, containing the url for the media resource.
... htmlsourceelement.srcset is a dom
string reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma).
... htmlsourceelement.type is a dom
string reflecting the type html attribute, containing the type of the media resource.
HTMLTableSectionElement - Web APIs
htmltablesectionelement.align is a dom
string containing an enumerated value reflecting the align attribute.
... htmltablesectionelement.ch is a dom
string containing one single chararcter.
... htmltablesectionelement.choff is a dom
string 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 dom
string 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 dom
string 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 datetime
string = ...
...timeelt.datetime; timeelt.datetime = datetime
string 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 dom
string that reflects the kind html attribute, indicating how the text track is meant to be used.
... htmltrackelement.src is a dom
string that reflects the src html attribute, indicating the address of the text track data.
... htmltrackelement.srclang is a dom
string that reflects the srclang html attribute, indicating the language of the text track data.
... htmltrackelement.label is a dom
string 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 dom
strings rather than a dom
stringlist (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.nsisupports
string).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.nsisupports
string).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 getas
string() 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 dom
string 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 margin
string = 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 dom
string representing the medialist as text, and also allows you to set a new medialist.
... syntax medialistinstance.mediatext; medialistinstance.mediatext =
string; value a dom
string 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 usv
string representing the origin of the message emitter.
... this defaults to an empty
string ("") if not specified.
... lasteventid: a dom
string 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 dom
string 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 dom
string objects before the first child of the parentnode.
... dom
string 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 dom
string 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 dom
string 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 dom
string objects after the last child of the parentnode.
... dom
string objects are inserted as equivalent text nodes.
... parentnode.prepend() inserts a set of node objects or dom
string objects before the first child of the parentnode.
... dom
string 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 dom
string 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 dom
string 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 dom
string 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 (dom
string) 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 dom
string 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 dom
string 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 dom
string 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
dom
string performancemark mark the name used when the mark was created by calling performance.mark().
... dom
string performancemeasure measure name used when the measure was created by calling performance.measure().
... dom
string 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 usv
string fido appid.
... txauthsimple usv
string simple transaction authorization.
...the client outputs a usv
string which is the text as it was displayed (line breaks may have been added).
... txauthgeneric an object with two properties: contenttype (usv
string) content (arraybuffer) generic transaction authorization.
RTCConfiguration - Web APIs
peeridentity optional a dom
string 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 dom
string 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 dom
string 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 !== "") { dial
stringbox.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 dom
string 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 dom
string 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 hex
string = ""; bytearray.foreach(function(byte) { hex
string += byte.to
string(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 dom
string 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 dom
string 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 dom
string 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 dom
string 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
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 dom
string 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 dom
string indicating which gathering state the ice agent is currently in.
... role read only returns a dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 time
string = ""; if (!isnan(elapsedtime)) { time
string = ` representing ${elapsedtime}s`; } let frame
string = ""; if (!isnan(framesdecoded)) { frame
string = `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 ${time
string}.<br>` + `${frame
string}` + `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 dom
string which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream.
... kind a dom
string whose value is "audio" if the associated mediastreamtrack is audio-only or "video" if the track contains video.
... trackid a dom
string which uniquely identifies the rtcmediastreamtrackstats object representing the associated mediastreamtrack.
... transportid a dom
string 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 dom
string 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 dom
string 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
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 dom
string 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 dom
string 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
this can either be: a usv
string 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 byte
string values.
... body: any body that you want to add to your request: this can be a blob, buffersource, formdata, urlsearchparams, usv
string, or readablestream object.
... referrer: a usv
string 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 dom
string that reflects the hreflang attribute, indicating the language of the linked resource.
... svgaelement.ping is a dom
string 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 dom
string being a synonym for the node.textcontent property.
... svgaelement.type is a dom
string that reflects the type attribute, indicating the mime type of the linked resource.
format - Web APIs
the svgaltglyphelement.format property is a dom
string 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 dom
string 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 dom
string type, in boolean canbubble, in boolean cancelable, in dom
string key, in dom
string oldvalue, in dom
string newvalue, in usv
string url, in storage storagearea ); attributes attribute type description key dom
string represents the key changed.
... newvalue dom
string the new value of the key.
... oldvalue dom
string the original value of the key.
... url usv
string the url of the document whose key changed.
SubtleCrypto.digest() - Web APIs
syntax const digest = crypto.subtle.digest(algorithm, data); parameters algorithm is a dom
string 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.to
string(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 dom
string 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 dom
string representing the name of the type of the transitionevent.
... propertyname optional is a dom
string containing the value of the property-name css property associated with the transition.
... pseudoelement optional is a dom
string, 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.to
string(); // "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.to
string() ) 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.to
string() ) // 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 dom
string 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
syntax var myworker = new worker(aurl, options); parameters aurl a usv
string representing the url of the script the worker will execute.
...available properties are as follows: type: a dom
string specifying the type of worker to create.
... credentials: a dom
string specifying the type of credentials to use for the worker.
... name: a dom
string 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 dom
string, 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 dom
string 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 dom
string 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
/* 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
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
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
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
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
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
value a dom
string 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 dom
string 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
value a dom
string containing the
string representation of the selected numeric value; use valueasnumber to get the value as a number.
... value the value attribute contains a dom
string 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
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
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
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 query
string 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 query
string 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
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.to
string(); this.message = message.to
string(); 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.to
string(); } 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.to
string(); this.message = message.to
string(); } 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.to
string() or the bigint.prototype.to
string() 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: to
string() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong?
... the optional radix parameter of the number.prototype.to
string() or the bigint.prototype.to
string() method was specified.
... examples invalid cases (42).to
string(0); (42).to
string(1); (42).to
string(37); (42).to
string(150); // you cannot use a
string like this for formatting: (12071989).to
string('mm-dd-yyyy'); valid cases (42).to
string(2); // "101010" (binary) (13).to
string(8); // "15" (octal) (0x42).to
string(10); // "66" (decimal) (100000).to
string(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.tolocaledate
string 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.tolocaledate
string('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').toiso
string(); new date('foo-bar 2014').to
string(); 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 sub
string 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 sub
string of the complete data
string.
... specifically, the property returns the sub
string 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.to
string()); // 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.to
string()); // 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.to
string() 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 sub
strings 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.) 'to
string' 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.to
string = 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.to
string = function() { return this.value + this.message; }; } /* * this could be in a script that validates address data * for us addresses.
<ms> - MathML
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 ("); 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
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 ("); 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
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 be
string.
... 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.to
string());" + "}, 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.to
string()" + " });" + "}, false);" + "window.addeventlistener('mouseout', function(event) {" + " self.postmessage({" + " kind: 'mouseout'," + " element: event.target.to
string()" + " });" + " }, 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.to
string());" + "}, false);" + "window.addeventlistener('mouseout', function(event) {" + " self.port.emit('mouseout', event.target.to
string());" + "}, 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.my
string = "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; }, to
string: function to
string() { 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); }, to
string: function to
string() { return this.hex() + '@' + point.prototype.to
string.call(this) } }); var pixel...
... = pixel(11, 23, 'cc3399'); pixel.to
string(); // => #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 query
string 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.sub
string(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.sub
string(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.sub
string(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"), to
string: 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"), to
string: 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 to
string function which will allow this code to work with versions of firefox 0.8 and earlier.
... to
string() the to
string() 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: sub
string 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.parsefrom
string(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.parsefrom
string(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.parsefrom
string(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.to
string().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.
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
blah(length
stringfocused
stringto
stringstringpop
stringpush
stringreverse
stringshift
stringsort
stringsplice
stringunshift
string)this is some default text lengththe number of open tabs
string focusedthe current tab in your browser
string to
stringstuff
string popstuff
string pushstuff
string reversestuff
string shiftstuff
string sortstuff
string splicestuff
string unshiftstuff
string onready()when the inherited document is fully loaded.
...methods open(url
string)opens a new tab in your browser with a defined url.
... urlurl to be opened
string jetpack.tabs.open("http://www.example.com/"); blah(length
stringfocused
stringto
stringstringpop
stringpush
stringreverse
stringshift
stringsort
stringsplice
stringunshift
string)this is some default text lengththe number of open tabs
string focusedthe current tab in your browser
string to
stringstuff
string popstuff
string pushstuff
string reversestuff
string shiftstuff
string sortstuff
string splicestuff
string unshiftstuff
string 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 getvalue
string 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 setvalue
string 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 dom
string id); nodelist getelementsbyattribute(in dom
string name, in dom
string value); }; getelementbyid works like html's getelementbyid.
... interface xulelement : element { nodelist getelementsbyattribute(in dom
string name, in dom
string 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
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 sub
string 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 ac
string amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in ac
string 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 ac
string 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 ac
string 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 ns
string class implementation (1999) this document is intended to briefly describe the new ns
string class architecture, and discuss the implications on memory management, optimizations, internationalization and usage patterns.
Extentsions FAQ - Archive of obsolete content
you can use nsisecretdecoderring.encrypt
string() and nsisecretdecoderring.decrypt
string().
... 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.
... to
string(): 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.to
string (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.to
string (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.readasbinary
string( 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.readasbinary
string( 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 dom
stringmap 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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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 tolocaletime
string(), 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.tolocaletime
string(); 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 my
string, 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", color
string); setcharpref("browser.display.focus_text_color", color
string); setcharpref("browser.display.focus_ring_width", numpixels); /* 0-4 */ moz 0.9.2 text selection appearance setcharpref("browser.selection.background_color", color
string); setcharpref("browser.sele...
...ction.foreground_color", color
string); setcharpref("browser.selection.border", cssborderstyle
string); /* 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 tonewc
string() 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 dom
string 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 dom
string 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 dom
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: title a dom
string representing the title of the search engine.
... href a dom
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following members: host a dom
string representing the host requesting the http authentification.
... realm a dom
string 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; nsxpidlc
string 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_decodetrust
string 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_getoid
string 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_nickname
stringsfromcertlist 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 *in
string, 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 *in
string, secitem *outbuf, prbool ishexdata) { int len = strlen((const char *)in
string); 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 (*in
string) { if ((*in
string == '\n') || (*in
string == ':')) { in
string++; continue; } digit1 = getdigit(*in
string++); digit2 = getdigit(*in
string++); if ((digit1 == -1) || (digit2 == -1)) { port_free(outbuf->data); outbuf->data = null; return -1; } outbuf->data[truelen++] = digit1 << 4 | digit2; } } else { while (*in
string) { if (*in
string == '\n') { in
string++; 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 sub
string foo or the sub
string 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 js
strings 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_versionto
string use these values.
...each version has a name, which is a
string used by js_
stringtoversion and js_versionto
string.
...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_versionto
string 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 js
string * unicode
string, accessed by a js
string 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 js
string * 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::handle
string 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::handle
string or int32_t or uint32_t or double or jsval initial value to assign to the property.
...value is one of js::value, jsobject, js
string, 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::handle
string input, bool multiline); name type description cx jscontext * the context.
... input js::handle
string 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 to
string 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_setc
stringsareutf8 ...list other deleted apis...
... js_getprototype, takes context as first argument js_encode
stringtobuffer 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::buildstack
string (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_internjs
string renamed to js_atomizeandpinjs
string (bug 1178581) js_intern
stringn renamed to js_atomizeandpin
stringn (bug 1178581) js_intern
string renamed to js_atomizeandpin
string (bug 1178581) js_internuc
stringn renamed to js_atomizeandpinuc
stringn (bug 1178581) js_internuc
string renamed to js_atomizeandpinuc
string (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_getlatin1interned
stringchars js_gettwobyteinterned
stringchars 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: setpageannotation
string(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: setitemannotation
string(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++: getpageannotation
string(auri, aname); getpageannotationint32(auri, aname); getpageannotationint64(auri, aname); getpageannotationdouble(auri, aname); getpageannotationbinary(auri, aname, adata, adatalen, amimetype); getitemannotation
string(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.queriestoquery
string: 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.query
stringtoqueries: 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 a
string the id of the application.
... name readonly attribute a
string the name of the application.
... version readonly attribute a
string the version number of the application.
extIExtension
method overview fixme: attributes attribute type description id readonly attribute a
string the id of the extension.
... name readonly attribute a
string the name of the extension.
... version readonly attribute a
string 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 w
string 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 a
string 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 "ns
stringapi.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 */ ns
string 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 a
string name; */ ns_imethodimp cspecialthing::getname(nsa
string & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsa
string & 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.to
string()); // "[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.to
string()); // "[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 nsa
string& 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(nsembed
string(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.
...nsembed
string is used to convert the ucs-2 character array to an object that can be passed as a const nsa
string& parameter.
NS_NewNativeLocalFile
#include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newnativelocalfile( const nsac
string& 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(nsembedc
string("c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; here, nsembedc
string is used to convert the ascii
string literal to an object that can be passed as a const nsac
string& parameter.
operator=
self_type& operator=( const self_type& a
string ); parameters a
string [in] a nsac
string 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& a
string ); parameters a
string [in] a nsac
string 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& a
string ); parameters a
string [in] a nsa
string 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 sub
string 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 sub
string of the containing
string where the sub
string 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 a
string amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in w
string auris, [array, size_is(ainstallcount)] in w
string ahashes, [array, size_is(ainstallcount)] in w
string anames, [array, size_is(ainstallcount)] in w
string aicons, [optional] in amiinstallcallback acallback, [optional] in pruint32 ainstallcount); boolean isinstallenabled(in a
string amimetype, in nsiuri areferer); note: prior ...
...boolean installaddonsfromwebpage( in a
string amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in w
string auris, [array, size_is(ainstallcount)] in w
string ahashes, [array, size_is(ainstallcount)] in w
string anames, [array, size_is(ainstallcount)] in w
string aicons, in amiinstallcallback acallback, optional in pruint32 ainstallcount optional ); parameters amimetype the mimetype for the add-ons.
...boolean isinstallenabled( in a
string amimetype, in nsiuri areferer ); parameters amimetype the mime type for the add-on to be installed.
jsdIStackFrame
method overview boolean eval(in a
string bytes, in autf8
string filename, in unsigned long line, out jsdivalue result); attributes attribute type description callee jsdivalue function object running in this stack frame.
... functionname autf8
string function name executing in this stack frame.
...boolean eval( in a
string bytes, in autf8
string 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.
... nsidomdom
stringlist 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 a
string text, in long position); void pastetext(in long position); void setattributes(in long startpos, in long endpos, in nsisupports attributes); unimplemented void settextcontents(in a
string text); attributes attribute type description associatededitor nsieditor returns an editor associated with the accessible.
... void inserttext( in a
string text, in long position ); parameters text text to be inserted.
... void settextcontents( in a
string 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 a
string imageurl, in a
string title, in a
string text, [optional] in boolean textclickable, [optional] in a
string cookie, [optional] in nsiobserver alertlistener, [optional] in a
string name, [optional] in a
string dir, [optional] in a
string lang, [optional] in a
string data, [optional] in nsiprincipal principal,[optional] in boolean inprivatebrowsing); void closealert([optional] in a
string name, [op...
... void showalertnotification( in a
string imageurl, in a
string title, in a
string text, in boolean textclickable, optional in a
string cookie, optional in nsiobserver alertlistener, optional in a
string name, optional in a
string dir, optional in a
string lang, optional in a
string 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 a
string 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); a
string 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.
... a
string 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 w
string an extra comment that will be displayed next to the value but that will not be part of the value itself.
... value a
string the result value using a
string to avoid excess allocations.
nsIBoxObject
method overview w
string getlookandfeelmetric(in w
string propertyname); obsolete since gecko 1.9 w
string getproperty(in w
string propertyname); nsisupports getpropertyassupports(in w
string propertyname); void removeproperty(in w
string propertyname); void setproperty(in w
string propertyname, in w
string propertyvalue); void setpropertyassupports(in w
string propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only.
... methods getlookandfeelmetric() obsolete since gecko 1.9 (firefox 3) w
string getlookandfeelmetric( in w
string propertyname ); parameters propertyname return value getproperty() w
string getproperty( in w
string propertyname ); parameters propertyname return value getpropertyassupports() nsisupports getpropertyassupports( in w
string propertyname ); parameters propertyname return value removeproperty() void removeproperty( in w
string propertyname ); pa...
...rameters propertyname setproperty() void setproperty( in w
string propertyname, in w
string propertyvalue ); parameters propertyname propertyvalue setpropertyassupports() void setpropertyassupports( in w
string propertyname, in nsisupports value ); parameters propertyname value ...
nsICRLManager
inherits from: nsisupports last changed in gecko 1.7 method overview w
string 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 w
string crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in w
string url, in w
string key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() w
string 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 w
string crlkey ); parameters data length uri type dosilentdownload crlkey reschedulecrlautoupdate() this would reschedule the autoupdate of crls with auto update enable.
...boolean updatecrlfromurl( in w
string url, in w
string 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 ac
string get the key identifying the cache entry.
nsICacheService
method overview nsicachesession createsession(in
string clientid, in nscachestoragepolicy storagepolicy, in boolean streambased); ac
string 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.
... ac
string 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 a
string aurl, in boolean aallowdelayedload); void removedelayedframescript(in a
string aurl); methods loadframescript() loads a script into the remote frame.
... void loadframescript( in a
string 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 a
string 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 a
string agroup, in a
string aname); void oncontentprefset(in a
string agroup, in a
string aname, in nsivariant avalue); methods oncontentprefremoved() called when a content preference is removed.
... void oncontentprefremoved( in a
string agroup, in a
string aname ); parameters agroup the group to which the removed preference belonged; this may be the uri of a web site.
... void oncontentprefset( in a
string agroup, in a
string 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 ac
string 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.
...ac
string 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.nsipreflocalized
string).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.sub
string(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 autf8
string ahost, in ac
string aname, in autf8
string 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 autf8
string ahost, in ac
string aname, in autf8
string 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 ac
string key, in ac
string data); void appendappnotestocrashreport(in ac
string data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only!
...void annotatecrashreport( in ac
string key, in ac
string data ); parameters key name of the data to be added.
...void appendappnotestocrashreport( in ac
string 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 ac
string 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.
...ac
string 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) .keyfrom
string(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.
... a
string 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 dom
string 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 dom
string obsolete since gecko 1.9.1 windowstate unsigned short returns current window state, the value is one of state_* constants.
...void setcursor( in dom
string cursor ); parameters cursor you can specify same values of css cursor property (including -moz- prefixed values).
nsIDOMHTMLSourceElement
attributes attribute type description src dom
string the src attribute gives the address of the media resource.
... type dom
string 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 dom
string 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 dom
string adocumenturi); long getusage(in a
string aownerdomain); methods clearofflineapps() clears keys owned by offline applications.
...nsidomstorage getlocalstorageforprincipal( nsiprincipal aprincipal, dom
string adocumenturi ); parameters aprincipal the principal for which to return the local storage object.
...long getusage( a
string aownerdomain ); parameters aownerdomain the domain to check.
nsIDOMWindow
method overview nsidomcssstyledeclaration getcomputedstyle(in nsidomelement elt, [optional] in dom
string 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 dom
string get or set the name of this window.
... nsidomcssstyledeclaration getcomputedstyle( in nsidomelement elt, in dom
string 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 dom
string expression, in nsidomxpathnsresolver resolver) nsidomxpathnsresolver creatensresolver(in nsidomnode noderesolver); nsisupports evaluate(in dom
string 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 dom
string expression, in nsidomxpathnsresolver resolver ); parameters expression a
string representing the xpath to be created.
...nsisupports evaluate( in dom
string 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 dom
string command dom
string control nsidomxulselectcontrolelement read only.
... crop dom
string disabled boolean image dom
string label dom
string selected boolean read only.
... value dom
string ...
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 ac
string adata, in ac
string asignature, in ac
string apublickey); methods verifydata() verifies that the data matches the data that was used to generate the signature.
... boolean verifydata( in ac
string adata, in ac
string asignature, in ac
string 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 w
string 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 a
string 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 a
string 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); a
string droplink(in nsidomdragevent aevent, out a
string 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.
... a
string droplink( in nsidomdragevent aevent, out a
string 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 dom
string url of the dropped link.
... name dom
string name of the dropped link.
... type dom
string 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 autf8
string aextension, in ac
string aencodingtype); nsistreamlistener docontent(in ac
string 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 autf8
string aextension, in ac
string aencodingtype ); parameters aextension the filename extension to check.
...nsistreamlistener docontent( in ac
string 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 autf8
string 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 autf8
string 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 a
string a
string that identifies the feed or entry.
... updated a
string 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 parsefrom
string(in a
string str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events.
... parsefrom
string() parses a feed from an a
string.
... void parsefrom
string( in a
string 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 a
string anamespace, in a
string 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 a
string the version of the feed; null if a non-feed is processed.
... void registerextensionprefix( in a
string anamespace, in a
string aprefix ); parameters anamespace the namespace for the extension.
nsIFrameScriptLoader
methods void loadframescript(in a
string aurl, in boolean aallowdelayedload, [optional] in boolean aruninglobalscope) void removedelayedframescript(in a
string 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 a
string 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 a
string 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 ac
string forcecharacterset ac
string fullzoom float the amount by which to scale all lengths.
... hintcharacterset ac
string hintcharactersetsource print32 minfontsize long the minimum font size to allow.
... prevdoccharacterset ac
string 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); a
string generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded.
... name autf8
string an arbitrary descriptive name for this microsummary generator.
...a
string 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 ac
string 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 ac
string chrome package, where the files for the new panel are located.
nsIMsgFilter
throws an exception if the action is not move to folder attribute ac
string targetfolderuri; label // target label.
... throws an exception if the action is not label attribute nsmsglabelvalue label; junkscore attribute long junkscore; strvalue attribute autf8
string strvalue; customid // action id if type is custom attribute ac
string 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 ac
string arbitraryheader ) getterm() void nsimsgfilter::getterm ( in long termindex, in nsmsgsearchattribvalue attrib, in ns...
...msgsearchopvalue op, in nsimsgsearchvalue value, out boolean booleanand, out ac
string 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 a
string title, in a
string 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 ac
string this is used to track the character set of the currently displayed message.
...void displayhtmlinmessagepane(in a
string title, in a
string body, in boolean clearmsghdr); parameters title not used.
nsIMsgWindowCommands
method overview void selectfolder(in ac
string folderuri); void selectmessage(in ac
string messageuri); void clearmsgpane(); methods selectfolder() this method is called by the backend to change the folder displayed in the message window.
...void selectfolder( in ac
string folderuri ); parameters folderuri the uri of the folder to select.
...void selectmessage( in ac
string messageuri ); parameters messageuri the uri of the message to open.
nsIProcessScriptLoader
methods void loadprocessscript(in a
string aurl, in boolean aallowdelayedload) void removedelayedprocessscript(in a
string 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 w
string 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 w
string 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 autf8
string the key used to refer to this property.
... value a
string 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 ac
string atype, in autf8
string 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 ac
string atype, in autf8
string 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<ac
string> asockettypes, in autf8
string 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<ac
string> asockettypes, in autf8
string 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_c
string 2 corresponding to nsisupportsc
string.
... type_
string 3 corresponding to nsisupports
string.
...see also nsisupportsc
string nsisupportschar nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupports
string nsisupportsvoid ...
nsISupportsVoid
inherits from: nsisupportsprimitive last changed in gecko 1.0 method overview
string to
string(); attributes attribute type description data voidptr this attribute provides access to the native type represented by the object.
... methods to
string()
string to
string(); parameters none.
... return value a
string valued representation of the object.
nsISyncMessageSender
methods jsval sendsyncmessage([optional] in a
string messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); jsval sendrpcmessage([optional] in a
string 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 ac
string 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 autf8
string aname); void flush(); nsitoolkitprofile getprofilebyname(in autf8
string 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 autf8
string aname ); parameters arootdir the profile directory.
...nsitoolkitprofile getprofilebyname( in autf8
string 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 ac
string childelt); void getcoordsforcellitem(in long row, in nsitreecolumn col, in ac
string 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 ac
string 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 ac
string 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 w
string idconst); native code only!
... id a
string the id attribute of the nsitreecolumn.
... methods native code only!getidconst void getidconst( [shared] out w
string idconst ); parameters idconst getnext() get the next column in the nsitreecolumns.
nsIURIFixupInfo
keywordprovidername a
string the keyword search provider name expected to provide a keyword search; empty
string if no keyword search is performed.
... keywordassent a
string the keyword used for the search (post trimming etc.); empty
string if no keyword search is performed.
... originalinput autf8
string 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 w
string 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 w
string 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 a
string 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 a
string statustext, in nsisupports statuscontext ); parameters statustype indicates what is setting the text.
... statustext status
string.
nsIWebBrowserFind
search
string w
string 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 w
string 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 w
string 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 w
string title, in w
string uri, in w
string iconuri, in w
string icondata); boolean isapplicationinstalled(in w
string uri); methods installapplication() this method installs a web application.
... void installapplication( in w
string title, in w
string uri, in w
string iconuri, in w
string icondata ); parameters title the user-friendly name of the application.
...boolean isapplicationinstalled( in w
string 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 a
string 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 a
string the default application user model id the application registers with the system.
...void setgroupidforwindow( in nsidomwindow aparent, in a
string 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 dom
string atypearg, in boolean acanbubblearg, in boolean acancelablearg, in dom
string adataarg, in dom
string aoriginarg, in nsisupports asourcearg); attributes attribute type description data dom
string the event's data.
... origin dom
string the event's origin.
... void initmessageevent( in dom
string atypearg, in boolean acanbubblearg, in boolean acancelablearg, in dom
string adataarg, in dom
string 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 a
string name); void setproperty(in a
string name, in nsivariant value); methods deleteproperty() delete a property with the given name.
... void deleteproperty( in a
string name ); parameters name property to delete.
...void setproperty( in a
string name, in nsivariant value ); parameters name property to set the value of.
nsIXULRuntime
os autf8
string a
string tag identifying the current operating system.
... widgettoolkit autf8
string a
string tag identifying the target widget toolkit in use.
... xpcomabi autf8
string 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 a
string asortkey, in a
string 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 a
string asortkey, in a
string 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 to
string(); attributes attribute type description faultcode print32 read only.
... fault
string string read only.
... methods init() void getdata( in print32 faultcode, in
string fault
string ); parameters faultcode to
string()
string to
string(); ...
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
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" / "w
string" 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 nsabquery
stringtoexpression.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 date
string = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + date
string; } 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.get
stringproperty("x-superfluous"); dump("x-superfluous: " + retval + "\n"); return retval; }, getsort
stringforrow: function(hdr) { return hdr.get
stringproperty("x-superfluous"); }, is
string: 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.to
string()); // 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.to
string()); console.info('x:', x, x.to
string()); console.info('y:', y, y.to
string()); console.info('mask:', mask, mask.to
string()); ...
...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.to
string()); console.info('x:', x, x.to
string()); console.info('y:', y, y.to
string()); console.info('mask:', mask, mask.to
string()); 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 to
string() 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 dom
string 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 dom
string 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 dom
string 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 dom
string containing the value of the animation-name that generated the animation.
... animationevent.pseudoelement read only is a dom
string, 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
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 dom
string 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).to
string() + ".
... 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).to
string() + " 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 dom
strings 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 dom
strings 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 dom
string id; readonly attribute dom
string?
...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 dom
string that uniquely identifies a device.
... bluetoothdevice.name read only a dom
string that provices a human-readable name for the device.
Body.text() - Web APIs
it returns a promise that resolves with a usv
string object (text).
... return value a promise that resolves with a usv
string.
...when the fetch is successful, we read a usv
string (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
the css.escape() static method returns a cssom
string containing the escaped
string passed as parameter, mostly for use as part of a css selector.
... syntax escapedstr = css.escape(str); parameters str the cssom
string 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 dom
string indicating the name of the property being defined.
... syntax optional a dom
string representing the expected syntax of the defined property.
... initialvalue optional a dom
string representing the initial value of the defined property.
CSS.supports() - Web APIs
the first one allows to test the support of a pair property-value: propertyname a dom
string containing the name of the css property to check.
... value a dom
string containing the value of the css property to check.
... the second syntax takes one parameter matching the condition of @supports: supportcondition a dom
string containing the condition to check.
CSSKeyframesRule - Web APIs
the parameter is a dom
string 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 dom
string resolving as a number between 0% and 100%.
...the key is a dom
string 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 dom
string namespaceuri; readonly attribute dom
string?
...it has some specific properties: cssnamespacerule.namespaceuri returns a dom
string containing the text of the uri of the given namespace.
... cssnamespacerule.prefix returns a dom
string 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].to
string(); // 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].to
string(); 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 dom
string specifying the text
string to render into the context.
Client - Web APIs
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 dom
string 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 dom
string representing the name of the type of the clipboardevent.
... datatype : a dom
string containing the mime-type of the data contained in the data argument.
... data : a dom
string containing the data concerned by the clipboard event.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a dom
string representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
... dataarg a dom
string representing the value of the data attribute.
... localearg a dom
string representing the value of the locale attribute.
Console.error() - Web APIs
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
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
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 dom
string instances of identity providers to search for.
... protocols an array of dom
string 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 dom
string containing the qualified name, like svg:svg.
... publicid is a dom
string containing the public identifier.
... systemid is a dom
string 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 dom
string 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].getas
string(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 dom
string path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in dom
string 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 dom
string 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 dom
string 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
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
though document.location is a read-only location object, you can also assign a dom
string 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.to
string(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
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.to
string = domtokenlist.prototype.tolocale
string = 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
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 dom
string 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 dom
string representing the position relative to the element; must be one of the following
strings: 'beforebegin': before the element itself.
... element a dom
string 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, '&') // embed ampersand symbols .replace(/</g, '<') // embed less-than symbols ) } specification specification status comment domthe definition of 'insertadjacenttext()' in that specification.
Element.matches() - Web APIs
the matches() method checks to see if the element would be selected by the provided selector
string -- in other words -- checks if the element "is" the selector.
... syntax var result = element.matches(selector
string); parameters selector
string 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 some
string = 'data'; mybutton.addeventlistener('click', function () { console.log(this); // expected value: 'data' }.bind(some
string)); 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 some
string = 'data'; mybutton.addeventlistener('click', function() { console.log(some
string); // expected value: 'data' some
string = 'data again'; }); console.log(some
string); // 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 dom
string that defines the type of the message event being created.
... origin: a dom
string that defines the origin of the corresponding service worker's environment settings object.
... lasteventid: a dom
string that defines the last event id of the event source.
FetchEvent() - Web APIs
syntax var fetchevent = new fetchevent(type, init); parameters type a dom
string object specifying which event the object represents.
... replacesclientid read only a dom
string which identifies the client which is being replaced by resultingclientid.
... resultingclientid read only a dom
string 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 dom
string.
File.getAsBinary() - Web APIs
note: this method is obsolete; you should use the filereader method readasbinary
string() 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 dom
string 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
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 dom
string 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
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 dom
string 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 sub
string = "script error"; if (
string.indexof(sub
string) > -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 dom
string representing the text color using either a named color or a color specified in the hexadecimal #rrggbb format.
... htmlbasefontelement.face is a dom
string representing a list of one or more font names.
... htmlbasefontelement.size is a dom
string representing the font size as either a numeric or relative value.
HTMLCanvasElement.toBlob() - Web APIs
mimetype optional a dom
string 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('passthis
string'), '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('passthis
string'), '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 dom
string indicating the image format.
... return value a dom
string containing the requested data uri.
HTMLFontElement - Web APIs
htmlfontelement.color is a dom
string that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format.
... htmlfontelement.face is a dom
string that reflects the face html attribute, containing a comma-separated list of one or more font names.
... htmlfontelement.size is a dom
string 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 usv
string 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 usv
string 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 query
string.
... 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 query
string = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(query
string); 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 dom
string 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 dom
string 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 dom
string.
Option() - Web APIs
syntax var optionelementreference = new option(text, value, defaultselected, selected); parameters text optional a dom
string representing the content of the element, i.e.
...if this is not specified, a default value of "" (empty
string) is used.
... value optional a dom
string representing the value of the htmloptionelement, i.e.
HTMLOptionElement - Web APIs
htmloptionelement.label read only is a dom
string that reflects the value of the label html attribute, which provides a label for the option.
... htmloptionelement.text is a dom
string that contains the text content of the element.
... htmloptionelement.value is a dom
string 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 dom
string; 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 dom
string that reflects the height html attribute, which specifies the height of the display area, in css pixels.
... htmlvideoelement.poster is a dom
string that reflects the poster html attribute, which specifies an image to show while no video data is available.
... htmlvideoelement.width is a dom
string that reflects the width html attribute, which specifies the width of the display area, in css pixels.
Headers.get() - Web APIs
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 byte
string 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 dom
string 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 dom
stringlist that contains a list of the names of the object stores currently in the connected database.
IDBFactorySync - Web APIs
method overview idbdatabasesync open (in dom
string name, in dom
string description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database.
... idbdatabasesync open ( in dom
string name, in dom
string 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 dom
string the key path of this index.
... name readonly dom
string the name of this index.
... storename readonly dom
string this index's referenced object store.
InputEvent.data - Web APIs
the data read-only property of the inputevent interface returns a dom
string 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 a
string = inputevent.data; value a dom
string.
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 dom
string representing the name of the event.
... keyboardeventinitoptional is a keyboardeventinit dictionary, having the following fields: "key", optional and defaulting to "", of type dom
string, that sets the value of keyboardevent.key.
... "code", optional and defaulting to "", of type dom
string, that sets the value of keyboardevent.code.
Location: hash - Web APIs
the hash property of the location interface returns a usv
string 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
the search property of the location interface is a search
string, also called a query
string; that is, a usv
string 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 query
string.
... 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 query
string = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(query
string); 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 dom
string, that is a label describing this device (for example "external usb webcam").
... syntax var label = mediadeviceinfo.label; value a dom
string 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 dom
string that is an identifier for the represented device that is persisted across sessions.
... mediadeviceinfo.groupidread only returns a dom
string that is a group identifier.
... mediadeviceinfo.labelread only returns a dom
string that is a label describing this device (for example "external usb webcam").
MediaError.message - Web APIs
the read-only property mediaerror.message returns a dom
string 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 dom
string 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 dom
string 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 dom
string 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 constraindom
string 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 constraindom
string 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 dom
string which uniquely identifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session.
... syntax var deviceid = mediatracksettings.deviceid; value a dom
string 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 dom
string 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 dom
string 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 dom
string which identifies the group of devices which includes the source for the mediastreamtrack.
... syntax var groupid = mediatracksettings.groupid; value a dom
string 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 dom
string 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 usv
string 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(dom
string name); // shadows inherited nameditem() readonly attribute dom
string[] names; }; typedef sequence<any> propertyvaluearray; interface propertynodelist : nodelist { propertyvaluearray getvalues(); }; collection .
MimeType - Web APIs
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
the navigator.oscpu property returns a
string that identifies the current operating system.
... syntax oscpuinfo = navigator.oscpu value a dom
string 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
available options are: url: a usv
string representing a url to be shared.
... text: a usv
string representing text to be shared.
... title: a usv
string 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 dom
string.
... lang stores a
string representing the language version as defined in bcp 47.
Node.isSupported() - Web APIs
syntax boolvalue = element.issupported(feature, version) parameters feature is a dom
string containing the name of the feature to test.
... version is a dom
string 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 dom
string object.
PayerErrors.name - Web APIs
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 dom
string explaining the error.
... this
string will be displayed to the user by the user agent's payment handling user interface.
PayerErrors.phone - Web APIs
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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string representing the name of the measure.
... startmark optional a dom
string representing the name of the measure's starting mark.
... endmark optional a dom
string representing the name of the measure's ending mark.
PerformanceObserver.observe() - Web APIs
the performance entry types are specified as an array of dom
string 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 dom
string objects, each specifying one performance entry type to observe.
... type: a single dom
string 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 dom
string that is the json representation of the performanceresourcetiming object.
PerformanceServerTiming - Web APIs
properties performanceservertiming.descriptionread only a dom
string value of the server-specified metric description, or an empty
string.
... performanceservertiming.nameread only a dom
string value of the server-specified metric name.
... methods performanceservertiming.tojson() returns a dom
string 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 dom
string 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 usv
string value which points to an image resource which can be the logo/icon of the relying party.
... id a dom
string uniquely identifying a relying party.
... name a dom
string giving a human-readable name for the relying party.
PublicKeyCredentialCreationOptions.user - Web APIs
syntax useraccount = publickeycredentialcreationoptions.user properties displayname a dom
string which is human readable and intended for display.
... icon optional an url as a usv
string value which points to an image resource which can be the avatar image for the user.
... name a dom
string 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 dom
string 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 dom
string 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 usv
string, 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 json
string = 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 dom
string 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 dom
string 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 dom
string describing the domain name of the identity provider (idp) generating the error response.
... rtcidentityerrorevent.loginurl read only is a dom
string giving the url where the user can complete the authentication.
... rtcidentityerrorevent.protocol read only is a dom
string 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 = received
string => { const message = json.parse(received
string); 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 dom
string 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 dom
string is the domain name where the idp is.
... protocol optional is a dom
string representing the protocol used to communicate with the idp.
... username optional is a dom
string 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 dom
string 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
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 dom
string 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 dom
string which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... type a dom
string 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 dom
string corresponding to the type attribute of the given element.
... svgstyleelement.media a dom
string corresponding to the media attribute of the given element.
... svgstyleelement.title a dom
string corresponding to the title attribute of the given element.
SVGTests - Web APIs
properties svgtests.requiredfeatures read only an svg
stringlist corresponding to the requiredfeatures attribute of the given element.
... svgtests.requiredextensions read only an svg
stringlist corresponding to the requiredextensions attribute of the given element.
... svgtests.systemlanguage read only an svg
stringlist corresponding to the systemlanguage attribute of the given element.
SVGTextContentElement - Web APIs
svgtextcontentelement.getsub
stringlength() returns a float representing the computed length of the formatted text advance distance for a sub
string of text within the element.
... note that this method only accounts for the widths of the glyphs in the sub
string 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.selectsub
string() selects text within the element.
SVGViewElement - Web APIs
svgviewelement.viewtarget an svg
stringlist corresponding to the viewtarget attribute of the given <view> element.
... a list of dom
string values which contain the names listed in the viewtarget attribute.
... each of the dom
string values can be associated with the corresponding element using the getelementbyid() method call.
Selection - Web APIs
selection.typeread only returns a dom
string describing the type of the current selection.
... selection.to
string() returns a
string currently being represented by the selection object, i.e.
... notes
string representation of a selection calling the selection.to
string() 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 to
string method.
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
syntax var myswme = new serviceworkermessageevent(type, init); parameters type a dom
string that defines the type of the message event being created.
... origin: a dom
string that defines the origin of the corresponding service worker's environment settings object.
... lasteventid: a dom
string that defines the last event id of the event source.
SpeechGrammar.src - Web APIs
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 dom
string 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.addfrom
string(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.addfrom
string() takes a grammar present in a specific dom
string 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.addfrom
string 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.addfrom
string(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 dom
string representing the location of the stylesheet.
... stylesheet.title read only returns a dom
string representing the advisory title of the current style sheet.
... stylesheet.typeread only returns a dom
string 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 dom
string 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 usv
string 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 usv
string 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 dom
string containing the name css property associated with the transition.
... transitionevent.pseudoelement read only is a dom
string, 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
syntax const url = new url(url [, base]) parameters url a usv
string representing an absolute or relative url.
... base optional a usv
string 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
the hash property of the url interface is a usv
string 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 usv
string.
URL.search - Web APIs
the search property of the url interface is a search
string, also called a query
string, that is a usv
string 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 usv
string.
URL.search - Web APIs
the search property of the url interface is a search
string, also called a query
string, that is a usv
string 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 usv
string.
URL.toJSON() - Web APIs
the tojson() method of the url interface returns a usv
string containing a serialized version of the url, although in practice it seems to have the same effect as url.to
string().
... syntax const href = url.tojson() return value a usv
string.
... examples const url = new url("/docs/web/api/url/to
string"); url.tojson(); // should return the url as a
string specifications specification status comment urlthe definition of 'tojson()' in that specification.
VTTCue - Web APIs
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 dom
string 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
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 dom
string 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 dom
string.
... syntax dom
string gl.getshadersource(shader); parameters shader a webglshader object to get the source code from.
... return value a dom
string 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
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
it may be one of the following types: usv
string 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().encodeto
string(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 text
string = "i love mdn"; ctx.filltext(text
string, 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 mq
string = `(resolution: ${window.devicepixelratio}dppx)`; const updatepixelratio = () => { let pr = window.devicepixelratio; let pr
string = (pr * 100).tofixed(0); pixelratiobox.innertext = `${pr
string}% (${pr.tofixed(2)})`; } updatepixelratio(); matchmedia(mq
string).addlistener(updatepixelratio); the
string mq
string 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
though window.location is a read-only location object, you can also assign a dom
string 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 usv
string.
...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 dom
string 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 dom
string 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 dom
string object.
XRInputSource - Web APIs
handednessread only a dom
string that indicates which hand the device represented by this xrinputsource is being used in, if any.
... profilesread only an array of dom
string objects, each specifying the name of an input profile describing the preferred visual representation and behavior of this input source.
... targetraymoderead only a dom
string 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 dom
string 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 dom
string 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
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.
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
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
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
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
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
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.to
string()} </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.to
string()} </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.to
string()} </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
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
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=aboundary
string (other headers associated with the multipart document as a whole) --aboundary
string content-disposition: form-data; name="myfile"; filename="img.jpg" content-type: image/jpeg (data) --aboundary
string content-disposition: form-data; name="myfield" (data) --aboundary
string (more subparts) --aboundary
string-- 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
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
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
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(), tolocale
string: ƒ tolocale
string(), to
string: ƒ to
string(), 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(), tolocale
string: ƒ tolocale
string(), to
string: ƒ to
string(), 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(), tolocale
string: ƒ tolocale
string(), to
string: ƒ to
string(), 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.sub
string(1); // referenceerror: foo is not defined the "foo" variable isn't defined anywhere.
... it needs to be some
string, so that the
string.prototype.sub
string() method will work.
... var foo = 'bar'; foo.sub
string(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.to
string; 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 to
string(k).
... let elementk be the result of calling the get // internal method of o with the argument to
string(k).
Array.prototype.map() - JavaScript
let pk be to
string(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 toiso
string()) 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).tolocale
string('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.to
string().split('e'); value = math[type](+(value[0] + 'e' + (value[1] ?
... (+value[1] - exp) : -exp))); // shift back value = value.to
string().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.to
string().split('e'); value = math[type](+(value[0] + 'e' + (value[1] ?
... (+value[1] - exp) : -exp))); // shift back value = value.to
string().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 to
string 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.to
string().
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].to
string()] } 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('to
string'); // 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); // to
string 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 = !({ to
string: null }).propertyisenumerable('to
string'), dontenums = [ 'to
string', 'tolocale
string', '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 to
string() 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 (to
string() 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.to
string() as it does not contain the enclosing "symbol()"
string.
... examples using description symbol('desc').to
string(); // "symbol(desc)" symbol('desc').description; // "desc" symbol('').description; // "" symbol().description; // undefined // well-known symbols symbol.iterator.to
string(); // "symbol(symbol.iterator)" symbol.iterator.description; // "symbol.iterator" // global symbols symbol.for('foo').to
string(); // "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.to
string(); // "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().to
string()); // 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 some
string = 'hi'; console.log(typeof some
string[symbol.iterator]); // "function"
string's default iterator returns the
string's code points one by one: let iterator = some
string[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([...some
string]); // ["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 some
string = new
string('hi'); some
string[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([...some
string]); // ["bye"] console.log(some
string + ''); // "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 my
string = 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 my
string instanceof
string // returns true newstr instanceof
string // returns true my
string 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) my
string 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 to
string() 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
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
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).to
string(16).padstart(2,'0') const g = math.round(math.random() * 255).to
string(16).padstart(2,'0') const b = math.round(math.random() * 255).to
string(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
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
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: selectsub
string 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: selectsub
string 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: selectsub
string 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 dom
string title, in dom
string description, in dom
string 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 dom
string title, in dom
string description, in dom
string 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.to
string(), document.title ]); ...
Private Properties - Archive of obsolete content
when an object is used as a key, it's converted to a
string using its to
string method.
... to make the above code work, a unique identifier must be associated with each image and override its to
string 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 query
string 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.
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.
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).to
string()] = fcompiler; return true; } for (var nidx = 0; nidx < vmimetypes.length; nidx++) { odicts[(vmimetypes[nidx]).to
string()] = 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.
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.get
string("xulschoolhello.friendmessage.label"); let that = this; acceptbutton.label = this._bundle.get
string("xulschoolhello.acceptbutton.label"); acceptbutton.accesskey = this._bundle.get
string("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.get
string("xulschoolhello.greeting.title"); let message = this._bundle.get
string("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.
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.
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(title
string, [body as
string] icon
string)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.parsefrom
string(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 dom
string attrname, in dom
string attrvalue); element getbindingparent(in node node); void loadbindingdocument(in dom
string documenturl); }; methods getanonymousnodes the getanonymousnodes method retrieves the anonymous children of the specified element.
... parameters documenturl of type dom
string - 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.setvalue
string(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.write
string("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.
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.getvalue
string ( 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 getvalue
string 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.
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 to
string 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 get
string write
string winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvalue
string iskeywritable keyexists setrootkey setvalue setvaluenumber setvalue
string 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.
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
« 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...
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.
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 ...
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.
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.
param - Archive of obsolete content
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 w
string adata); nsiobserver method used internally to react to changes to preferences listed as children of this element.
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
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.
tabs - Archive of obsolete content
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
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>cfbundlegetinfo
string</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>cfbundleshortversion
string</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.parsefrom
string("<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' to
string 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 .toxml
string() var element1 = <foo/>; var element2 = <bar/>; element1.appendchild(element2); element1.toxml
string(); this will print <foo> <bar/> </foo> calling to
string() will achieve the same effect in this case, though calling to
string() on an element with only text content will product the text content (e.g., <foo>abc</foo>.to
string(); 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 to
string 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.to
string() 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 drive
string = ""; e.movefirst(); while (e.atend() == false) { var drv = e.item(); drive
string += drv.path + " - "; if (drv.isready){ var freegb = drv.freespace / bytespergb; var totalgb = drv.totalsize / bytespergb; drive
string += freegb.tofixed(3) + " gb free of "; drive
string += totalgb.tofixed(3) + " gb"; } else{ drive
string += "not ready"; ...
... } drive
string += "<br />";; e.movenext(); } document.write(drive
string); // 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.
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.parsefrom
string(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([code
string]); 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.
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.
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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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).sub
string(0, caretpos); var back = (textarea.value).sub
string(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 tolocaletime
string(), 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.tolocaletime
string(); 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 cat
string 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 sub
string 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", color
string); /* for example #ffeedd or the name of a color */ setcharpref("browser.display.focus_text_color", color
string); 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) nsauto
string=<mdata,su> ns
string=<mdata,su> nsc
string=<mdata,s> nscauto
string=<mdata,s> nsrect=x=<x,d> y=<y,d> width=<width,d>; height=<height,d> nsstaticatomwrapper=<mstaticatom->m
string,s> nsiatom=<m
string,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 nsa
string_internal=<mdata,su>, length=<mlength,u> nsac
string_internal=<mdata,s>, length=<mlength,u> ; xpcom
strings nsa
string=<ns
stringcontainer.v,su>, length=<ns
stringcontainer.d1,u> nsac
string=<nsc
stringcontainer.v,s>, length=<nsc
stringcontainer.d1,u> ns
stringcontainer=<v,su>, length=<d1,u> nsc
stringcontainer=<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 dom
string the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: type a dom
string 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 dom
string 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.) search
string a dom
string 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 dom
string the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: backgroundcolor a dom
string 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 dom
string the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: url a dom
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: url a dom
string 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 dom
string the type of event.
... details the details property returns an anonymous javascript object with the following properties: state a dom
string 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 dom
string 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(ns
string query); parent: returnresult(ns
string 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(ns
string query); } async protocol pasyncquery { parent: __delete__(ns
string 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; nsc
string 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 ns
string 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(nsa
string_internal const&) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:626) 0x7f6860fece79 #07: nsmemoryinfodumper::dumpmemoryreportstofile(nsa
string_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_compare
strings compare two character
strings using strcmp.
... see also pl_compare
strings, 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 *out
string = 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 = { siascii
string, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siascii
string, 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 *out
string = 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 = { siascii
string, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siascii
string, 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 *out
string = 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 = { siascii
string, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siascii
string, 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 *out
string = 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 = { siascii
string, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siascii
string, 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 *in
string, secitem *outbuf, prbool ishexdata) { int len = strlen(in
string); 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 (*in
string) { if ((*in
string == '\n') || (*in
string == ':')) { in
string++; continue; } digit1 = getdigit(*in
string++); digit2 = getdigit(*in
string++); if ((digit1 == -1) || (digit2 == -1)) { port_free(outbuf->data); outbuf->data = null; return -1; } outbuf->data[truelen++] = digit1 << 4 | digit2; } } else { while (*in
string) { if (*in
string == '\n') { in
string++; 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 *out
string = 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 = { siascii
string, enckeyid, pl_strlen(enckeyid) }; secitem mackeyid = { siascii
string, 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<nsc
stringhashkey, 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.evaluate
string(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, nsa
string_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::to
string instead.
... see also mxr id search for js::ordinarytoprimitive js::tonumber js::toboolean js::to
string 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<js
string*> persistentrooted
string; 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::persistentrooted
string 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 jserrorformat
string structure.
... see also mxr id search for jsexntype jserrorformat
string bug 684526 ...
JSObjectOps.defaultValue
it calls the javascript methods obj.valueof() and/or obj.to
string().
... js_convertstub implements the default behavior for the jsclass.convert hook, which is to call obj.valueof() and obj.to
string() 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::to
string.
JS_DecompileFunction
syntax js
string * 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 js
string * 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, js
string, jsfunction, or jsdouble.
...(here the term gc-thing refers to any value that is subject to garbage collection: a jsobject, js
string, 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 js
string * (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 jserrorformat
string * (* jserrorcallback)(void *userref, const unsigned errornumber); name type description userref void * the userref pointer that was passed to the reporterrornumber api.
...otherwise, if the jserrorformat
string 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::handle
string 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::handle
string 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_valueto
string ...
JS_ValueToSource
syntax js
string * 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
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="asearch
string"/> <argument name="resultlistener"/> <body> <![cdata[ return this.autocompletesession.autocomplete(null, anonymouscontent[0], asearch
string, 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, aoriginal
string, 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 nsembed
string and nsembedc
string 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
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.log
stringmessage("my component: " + amessage); } firefox 3: the error console will not display chrome errors by default.
nsIRegistry
js> rs.get
stringutf8(530, "directory") // 530: key corresponding with profiles/default the output is something like: /home/lion/.mozilla/default/awp83kud.slt boo-yah!
...js> rs.set
stringutf8(530, "directory", "/home/lion/somewhere/else") js> rs.get
stringutf8(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 nsac
string& 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 nsa
string& 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 nsembedc
string 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(nsa
string &result); void func() { nsembed
string 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 a
string aurl, in print32 astatus); methods oninstallended() called when an install completes or fails.
... void oninstallended( in a
string 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 w
string 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 w
string 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_c
string("stddev"), 1, func ); ns_ensure_success(rv, rv); // run some query that uses the function.
... nscomptr<mozistoragestatement> stmt; rv = dbconn->createstatement(ns_literal_c
string( "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 autf8
string 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_c
string("square"), 1, func ); ns_ensure_success(rv, rv); // run some query that uses the function.
... nscomptr<mozistoragestatement> stmt; rv = dbconn->createstatement(ns_literal_c
string( "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 autf8
string 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 autf8
string 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 a
string defaultkeybinding; see also nsiaccessible.getkeybindings() nsiaccessible.keyboardshortcut ...
KeyboardShortcut
« nsiaccessible page summary provides localized
string of accesskey name, such as alt+d (alt + d).
... attribute a
string 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 w
string adomain, in w
string ausername, in w
string 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 w
string adomain, in w
string ausername, in w
string 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 w
string statustext); attributes attribute type description param nsisupports private parameter used by the autocomplete widget.
...void onstatus( in w
string statustext ); parameters statustext ...
nsIAutoCompleteSearch
method overview void startsearch(in a
string search
string, in a
string 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 a
string search
string, in a
string searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener ); parameters search
string the
string to search for.
nsIBadCertListener2
method overview boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8
string targetsite); methods notifycertproblem() called in case of a broken ssl status.
... boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8
string 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 a
string read only.
... name a
string 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 ac
string 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 ac
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 parsefrom
string 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.parsefrom
string(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.parsefrom
string(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.parsefrom
string(astr, "application/xml"); ...
nsIDOMProgressEvent
method overview void initprogressevent(in dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string typearg, in boolean canbubblearg, in boolean cancelablearg, in dom
string keyarg, in dom
string oldvaluearg, in dom
string newvaluearg, in dom
string urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain dom
string the domain of the storage area which changed, or "#session" if the event represents a change to session storage.
... void initstorageevent( in dom
string typearg, in boolean canbubblearg, in boolean cancelablearg, in dom
string 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 dom
string domain); methods nameditem() called when the list of available access points changes.
... nsidomstorage nameditem( in dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string label, in dom
string value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in dom
string label, in dom
string value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only.
... selectedindex long selecteditem nsidomxulselectcontrolitemelement value dom
string methods appenditem() nsidomxulselectcontrolitemelement appenditem( in dom
string label, in dom
string 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 dom
string label, in dom
string 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 a
string ainfo); methods onindexavailable() called for each directory entry.
...void oninformationavailable( in nsirequest arequest, in nsisupports actxt, in a
string 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 w
string 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 w
string 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 a
string a user-readable description of the transfer.
... deprecated since gecko 19.0 guid a
string 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 w
string 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 w
string 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 a
string the name of the software that created the feed.
... version a
string 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 a
string the person's email address.
... name a
string 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 a
string errortext, in long linenumber, in boolean bozo); methods handleentry() called after each entry or item is processed.
... void reporterror( in a
string 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 a
string filter
string); 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 a
string filter
string ); parameters filter
string 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 autf8
string key); long getint(in autf8
string key); autf8
string get
string(in autf8
string key); void setboolean(in autf8
string key, in boolean value); void setint(in autf8
string key, in long value); void set
string(in autf8
string key, in autf8
string value); methods getboolean() boolean getboolean( in autf8
string key ); parameters key return value getint() long getint( in autf8
string key ); parameters key return value get
string() autf8
string get
string( in autf8
string key ); parameters ...
...key return value setboolean() void setboolean( in autf8
string key, in boolean value ); parameters key value setint() void setint( in autf8
string key, in long value ); parameters key value set
string() void set
string( in autf8
string key, in autf8
string 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 a
string atitle); methods adduri() add a uri to global history.
...void setpagetitle( in nsiuri auri, in a
string 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 ac
string aheader, in ac
string avalue); methods visitheader() called by the nsihttpchannel implementation when visiting request and response headers.
... void visitheader( in ac
string aheader, in ac
string 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
nsac
string* pbuf = (nsac
string*) 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, nsac
string& 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 a
string 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 ac
string process, in autf8
string path, in print32 kind, in print32 units, in print64 amount, in autf8
string description, in nsisupports closure); methods callback() called to provide information from a multi-reporter.
...void callback( in ac
string process, in autf8
string path, in print32 kind, in print32 units, in print64 amount, in autf8
string description, in nsisupports closure ); parameters process the value of the process attribute for the memory reporter.
nsIMessageBroadcaster
methods void broadcastasyncmessage([optional] in a
string 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 a
string 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); a
string to
string(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only.
... outgoing identity list (array of nsimsgidentity's) incomingserver nsimsgincomingserver incoming server stuff key ac
string 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 a
string asubject, in ac
string akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes.
... void displaymessagechanged(in nsimsgfolder afolder, in a
string asubject, in ac
string akeywords ); parameters afolder the folder containing selected message.
nsIMsgRuleAction
throws an exception if the action is not move to folder attribute ac
string 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 autf8
string strvalue; // action id if type is custom attribute ac
string customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsIMsgSearchValue
attribute a
string 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; a
string to
string(); }; ...
nsINavHistoryQueryOptions
excludeitemifparenthasannotation obsolete since gecko 13.0 autf8
string this option excludes items from a bookmarks query if the parent of the item has this annotation.
... sortingannotation autf8
string 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 w
string 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 w
string adata ); parameters asubject in general reflects the object whose change or action is being observed.
nsIPrivateBrowsingService
method overview void removedatafromdomain(in autf8
string adomain); attributes attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time.
...void removedatafromdomain( in autf8
string 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 w
string dialogtitle, in w
string text); void alertcheck(in w
string dialogtitle, in w
string text, in w
string checkmsg, inout boolean checkvalue); boolean confirm(in w
string dialogtitle, in w
string text); boolean confirmcheck(in w
string dialogtitle, in w
string text, in w
string checkmsg, inout boolean checkvalue); print32 confirmex(in w
string di...
...alogtitle, in w
string text, in unsigned long buttonflags, in w
string button0title, in w
string button1title, in w
string button2title, in w
string checkmsg, inout boolean checkvalue); boolean prompt(in w
string dialogtitle, in w
string text, inout w
string value, in w
string checkmsg, inout boolean checkvalue); boolean promptpassword(in w
string dialogtitle, in w
string text, inout w
string password, in w
string checkmsg, inout boolean checkvalue); boolean promptusernameandpassword(in w
string dialogtitle, in w
string text, inout w
string username, inout w
string password, in w
string checkmsg, inout boolean checkvalue); boolean select(in w
string dialogtitle, in w
string text, in pruint32 count, [array, size_is(count)] in w
string selectlist, out lon...
nsIPropertyBag
inherits from: nsisupports last changed in gecko 1.0 method overview nsivariant getproperty(in a
string name); attributes attribute type description enumerator nsisimpleenumerator get a nsisimpleenumerator whose elements are nsiproperty objects.
... nsivariant getproperty( in a
string name ); parameters name the name to return the matching property.
nsIProxyInfo
host autf8
string this attribute specifies the hostname of the proxy server.
... type ac
string this attribute specifies the type of the proxy server as a case insensitive ascii
string.
nsIPushMessage
method overview dom
string 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.
... dom
string text(); parameters none.
nsISSLErrorListener
method overview boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8
string targetsite); methods notifysslerror() called in case of an ssl error.
... boolean notifysslerror( in nsiinterfacerequestor socketinfo, in print32 error, in autf8
string 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 dom
string alter, in dom
string direction, in dom
string granularity); methods modify() modifies the selection.
... void modify( in dom
string alter, in dom
string direction, in dom
string 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(); w
string to
stringwithformat(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.
... to
stringwithformat() w
string to
stringwithformat( 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 a
string soundalias); constants sound event constants constant value description event_new_mail_received 0 the system receives email.
...void playsystemsound( in a
string 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 w
string text); prior versions of the interface named the methods using the initialcaps style instead of the intercaps style.
...void settitle( in w
string text ); parameters text title to set for the html document.
nsITaskbarPreview
tooltip dom
string 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 dom
string the
string displayed in the button's tooltip.
... by default, this is an empty
string.
nsITaskbarTabPreview
title dom
string 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 w
string error message on connection failure.
... shortsecuritydescription w
string 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 a
string id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
...nsitreecolumn getnamedcolumn( in a
string 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 ac
string 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 ac
string 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 ac
string acontenttype, in long long acontentlength, in ac
string 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 ac
string acontenttype, in long long acontentlength, in ac
string 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 a
string onbeforelinktraversal(in a
string originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); methods onbeforelinktraversal() determines the appropriate target for a link.
... a
string onbeforelinktraversal( in a
string 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 w
string 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( w
string 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 ac
string 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 ac
string atype, in nsiwebnavigation awebnav ); parameters atype the mime type to check.
nsIWorker
method overview void postmessage(in dom
string 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 dom
string 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 dom
string ascripturl); methods newchromeworker() returns a new chromeworker that will run a specified script.
... nsiworker newchromeworker( in dom
string 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 dom
string amessage); methods postmessage() posts a message into the event queue.
... void postmessage( in dom
string 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 dom
string 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 dom
string 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 a
string 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 a
string 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 w
string id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type description chromeflags pruint32 chromeflags are from nsiwebbrowserchrome.
... nsidocshelltreeitem getcontentshellbyid( in w
string 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 autf8
string 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 autf8
string 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 nsisupports
string 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 nsipreflocalized
string nsiprefservice nsi
stringbundle nsi
stringbundleservice security cookies nsicookie nsicookie2 nsicookieacceptdialog nsicookieconsent nsicookiemanager nsicookiemanager2 nsicookiepermission nsicookiepromptservice nsicooki...
nsIMsgSearchValue
attribute a
string 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; a
string to
string(); }; ...
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.log
stringmessage(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 query
string = '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 == query
string) { // found it!
Using nsISimpleEnumerator
using nsisimpleenumerator <
stringbundle>.
strings var enumerator = document.getelementbyid('a
stringbundleid').
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 ns
stringtokenizer probably belongs in the parser.
... p2 classes that parallel standard library classes should have compatible apis, i.e., nsdeque bug 18505 ns
string 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(search
string): perform a full-text search against plaintext message bodies.
...query.subjectmatches(search
string) 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 property
string = property.getunicode(); dump("onintpropertychanged has fired with property + " + property
string + "!\n"); if (property
string == "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 (property
string == "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, view
string) {}, onitemremoved: function(parent, item, view
string) {}, onitempropertychanged: function(parent, item, view
string) {}, 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 js
string = timestr.read
string(); // 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 read
string() method.
Working with ArrayBuffers
pixelbuffer.to
string(); // "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.to
string(); // "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.
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.
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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string offering a human-readable explanation of the validation error and offers suggestions for correcting it.
Animation.id - Web APIs
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 = newid
string; value a dom
string 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 dom
string identifying the specific type of animation event that occurred.
... animationnamearg a dom
string 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 dom
string, 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 dom
string 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 dom
string 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
the id property contains a
string which uniquely identifies the track represented by the audiotrack.
... syntax var trackid = audiotrack.id; value a dom
string 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 dom
string 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.
BasicCardRequest.supportedNetworks - Web APIs
the supportednetworks property of the basiccardrequest dictionary contains an array of dom
strings representing the card networks that the retailer supports (e.g.
...value]] value an array containing one or more dom
strings, 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 dom
strings representing the card types that the retailer supports (e.g.
... syntax basiccardrequest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more dom
strings, 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, dom
string, 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, dom
string, or formdata.
...the data argument is optional and its type may be an arraybufferview, blob, dom
string, or formdata.
BeforeInstallPromptEvent - Web APIs
beforeinstallpromptevent.platforms read only returns an array of dom
string items containing the platforms on which the event was dispatched.
... beforeinstallpromptevent.userchoice read only returns a promise that resolves to a dom
string 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
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 usv
string which contains the blob's data as a text
string.
id - Web APIs
the bluetoothdevice.id read-only property returns a dom
string that uniquely identifies a device.
... syntax var id = instanceofbluetoothdevice.id returns a dom
string.
BluetoothDevice.name - Web APIs
the bluetoothdevice.name read-only property returns a dom
string that provides a human-readable name for the device.
... syntax var name = instanceofbluetoothdevice.name returns a dom
string.
BluetoothRemoteGATTCharacteristic.uuid - Web APIs
the bluetoothremotegattcharacteristic.uuid read-only property returns dom
string 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 dom
string.
uuid - Web APIs
the bluetoothgattservice.uuid read-only property returns a dom
string representing the uuid of this service.
... syntax var uuid = bluetoothgattservice.uuid returns a dom
string.
CSSMathValue.operator - Web APIs
for example, if the current cssmathvalue subtype is cssmathsum, this property will return the
string "sum".
... syntax var a
string = cssmathvalue.operator; value a
string.
CSSNamespaceRule.namespaceURI - Web APIs
the cssnamespacerule.namespaceuri read-only property returns a dom
string containing the text of the uri of the given namespace.
... syntax var namespaceuri = cssnamespacerule.namespaceuri returns a dom
string containing a uri.
CSSNamespaceRule.prefix - Web APIs
the cssnamespacerule.prefix read-only property returns a dom
string with the name of the prefix associated to this namespace.
... syntax var prefix = cssnamespacerule.prefix returns a dom
string 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 cssom
string 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 dom
string 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 dom
string representing the property name to be removed.
... return value oldvalue is a dom
string 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 name
string = styleobj[i]; styleobj.removeproperty(name
string); } 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 dom
string containing the rule to be inserted.
... /*else*/ return originalinsertrule.call( this, // the sheet to be changed selectorandrule.sub
string(0, openbracketpos), // the selector selectorandrule.sub
string(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
the cssunitvalue.unit read-only property of the cssunitvalue interface returns a usv
string indicating the type of unit.
... syntax var a
string = cssunitvalue.unit; value a usv
string.
Cache.delete() - Web APIs
the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query
string in the url.
... cachename: a dom
string that represents a specific cache to search within.
Cache.keys() - Web APIs
the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query
string in the url.
... cachename: a dom
string 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 dom
string 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.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 dom
string specifying the text
string to render into the context.
Clipboard.readText() - Web APIs
return value a promise that resolves with a dom
string 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 dom
string representing the name of the event.
... "reason", optional and defaulting to '', of type dom
string, 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 dom
string describing the reason of the close in shuman-readable way.
console.count() - Web APIs
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
the id property of the credential interface returns a dom
string containing the credential's identifier.
... syntax var id = credential.id; value a a dom
string containing the credential's identifier.
Credential.name - Web APIs
the name property of the credential interface returns a dom
string, containing the name associated with a credential.
... syntax var credname = credential.name; value a dom
string containing the credential's given name.
Credential.type - Web APIs
the type property of the credential interface returns a dom
string containing the credential's type.
... syntax var credtype = credential.type; value a dom
string contains a credential's given name.
Credential - Web APIs
properties credential.id read only returns a dom
string containing the credential's identifier.
... credential.type read only returns a dom
string containing the credential's type.
CryptoKey - Web APIs
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 dom
string 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 dom
string representing a message or description associated with the given error name.
... syntax var domexceptionmessage = domexceptioninstance.message; value a dom
string.
DOMException.name - Web APIs
the name read-only property of the domexception interface returns a dom
string that contains one of the
strings associated with an error name.
... syntax var domexceptionname = domexceptioninstance.name; value a dom
string.
DOMImplementation.createDocument() - Web APIs
syntax var doc = document.implementation.createdocument(namespaceuri, qualifiednamestr, documenttype); parameters namespaceuri is a dom
string containing the namespace uri of the document to be created, or null if the document doesn't belong to one.
... qualifiednamestr is a dom
string 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 dom
string representing the feature name.
... version a dom
string representing the version of the specification defining the feature.
DOMMatrixReadOnly - Web APIs
dommatrixreadonly.to
string() creates and returns a dom
string 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
syntax tokenlist.item(index) parameters index a dom
string representing the index of the item you want to return.
... return value a dom
string representing the returned item.
DOMTokenList.remove() - Web APIs
syntax tokenlist.remove(token1[, token2[, ...tokenn]]); parameters tokenn a dom
string 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 dom
string representing the token you want to replace.
... newtoken a dom
string 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 dom
string, or clears and sets the list to the given value.
... syntax tokenlist.value; value a dom
string 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 dom
string 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 dom
string representing the type of the drag data to add to the drag object.
... data a dom
string 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].getas
string(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.getas
string() 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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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].getas
string(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.to
string()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command.
Document.URL - Web APIs
the url read-only property of the document interface returns the document location as a
string.
... living standard defines that the property is a usv
string instead of a dom
string.
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().parsefrom
string('<xml></xml>', 'application/xml') var cdata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializeto
string(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().parsefrom
string('<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().serializeto
string(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().parsefrom
string('<foo />', 'application/xml'); var pi = doc.createprocessinginstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'); doc.insertbefore(pi, doc.firstchild); console.log(new xmlserializer().serializeto
string(doc)); // displays: <?xml-stylesheet href="mycss.css" type="text/css"?><foo/> specifications specification status comment domthe definition of 'createp...
Document.domain - Web APIs
syntax const domain
string = document.domain document.domain = domain
string 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.referrer - Web APIs
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
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
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
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 dom
string 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 dom
string domtimestamp dom
stringlist 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 svg
stringlist svgtransform svgtransformlist animated type svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlist svganimatedpathdata svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimated
string svganimatedtransformlist smil-related interfaces elementtim...
EcKeyGenParams - Web APIs
properties name a dom
string.
... namedcurve a dom
string representing the name of the elliptic curve to use.
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 dom
string 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
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 svganimated
string if the element is an svgelement.
Element.insertAdjacentHTML() - Web APIs
syntax element.insertadjacenthtml(position, text); parameters position a dom
string 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
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 dom
string containing a human-readable error message describing the problem.
... errorevent.filename read only is a dom
string containing the name of the script file in which the error occurred.
Event.type - Web APIs
the type read-only property of the event interface returns a
string containing the event's type.
... syntax let eventtype = event.type; value a dom
string containing the type of event.
EventSource.url - Web APIs
the url read-only property of the eventsource interface returns a dom
string representing the url of the source.
... syntax var myurl = eventsource.url; value a dom
string representing the url of the source.
FederatedCredential.protocol - Web APIs
the protocol property of the federatedcredential interface returns a read-only dom
string containing a credential's federated identity protocol.
... syntax var protocol = federatedcredential.protocol value a dom
string containing a credential's federated identity protocol (e.g.
FederatedCredential.provider - Web APIs
the provider property of the federatedcredential interface returns a usv
string containing a credential's federated identity provider.
... syntax var provider = federatedcredential.provider value a usv
string containing a credential's federated identity provider.
FederatedCredential - Web APIs
federatedcredential.provider read only returns a usv
string containing a credential's federated identity provider.
... federatedcredential.protocol read only returns a dom
string 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 dom
string.
File.type - Web APIs
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 usv
string 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 usv
string 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.readasbinary
string() 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 dom
string representing a data url.
... return value an dom
string 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 dom
string.
... return value an dom
string representing the input data.
FileSystem.name - Web APIs
this usv
string is unique among all file systems currently exposed by the file and directory entries api.
... syntax var fsname = filesystem.name; value a usv
string representing the file system's name.
FileSystemEntry.fullPath - Web APIs
the read-only fullpath property of the filesystementry interface returns a usv
string 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 usv
string indicating the entry's full path.
FileSystemEntry.name - Web APIs
the read-only name property of the filesystementry interface returns a usv
string 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 usv
string indicating the entry's name.
FileSystemEntry - Web APIs
fullpath read only a usv
string 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 usv
string 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
gamepad.id read only a dom
string 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 dom
string describing the details of the error.
... syntax let msg = geolocationpositionerrorinstance.message value a human-readable dom
string describing the details of the error.
HTMLBaseElement - Web APIs
htmlbaseelement.href is a dom
string that reflects the href html attribute, containing a base url for relative urls in the document.
... htmlbaseelement.target is a dom
string 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 dom
string 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 dom
string indicating the file name to give the file representing the image file in memory.
... type optional a dom
string 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 dom
string reflecting the value html attribute.
... syntax var avalue = htmldataelement.value htmldataelement.value = avalue value a dom
string.
HTMLDialogElement.close() - Web APIs
an optional dom
string may be passed as an argument, updating the returnvalue of the the dialog.
... syntax dialoginstance.close(returnvalue); parameters returnvalue optional a dom
string representing an updated value for the htmldialogelement.returnvalue of the dialog.
HTMLDialogElement - Web APIs
htmldialogelement.returnvalue a dom
string that sets or returns the return value for the dialog.
...an optional dom
string may be passed as an argument, updating the returnvalue of the the dialog.
HTMLElement.dir - Web APIs
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
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 dom
string 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 color
string = fontobj.color; fontobj.color = color
string; 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 dom
string 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 face
string = fontobj.face; fontobj.face = face
string; 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 dom
string 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 size
string = fontobj.size; fontobj.size = size
string; 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 dom
string 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 dom
string structured as a comma-seperated list specifing the width of each column inside a frameset.
... htmlframesetelement.rows is a dom
string 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 usv
string 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 usv
string 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 usv
string 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 usv
string 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 usv
string 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 usv
string 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 usv
string 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 usv
string 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 usv
string 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 dom
string 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 dom
string 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 dom
string 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 usv
string 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 dom
string representing a single-character access key to give access to the element.
... htmllegendelement.align is a dom
string 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 dom
string 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 dom
string.
HTMLMediaElement.currentSrc - Web APIs
the value is an empty
string if the networkstate property is empty.
... syntax var mediaurl = audioobject.currentsrc; value a dom
string 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 dom
string 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 dom
string reflecting the cite html attribute, containing a uri of a resource explaining the change.
... htmlmodelement.datetime is a dom
string 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 dom
string that reflects the data html attribute, specifying the address of a resource's data.
... syntax var data = htmlobjectelement.data; htmlobjectelement.data; value a dom
string.
HTMLObjectElement.height - Web APIs
the height property of the htmlobjectelement interface returns a dom
string 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 dom
string.
HTMLObjectElement.name - Web APIs
the name property of the htmlobjectelement interface returns a dom
string that reflects the name html attribute, specifying the name of the browsing context.
... syntax var
string = htmlobjectelement.name; htmlobjectelement.name =
string; value a dom
string.
HTMLObjectElement.type - Web APIs
the type property of the htmlobjectelement interface returns a dom
string that reflects the type html attribute, specifying the mime type of the resource.
... syntax var
string = htmlobjectelement.type htmlobjectelement.type =
string; value a dom
string.
HTMLObjectElement.useMap - Web APIs
the usemap property of the htmlobjectelement interface returns a dom
string that reflects the usemap html attribute, specifying a <map> element to use.
... syntax var
string = htmlobjectelement.usemap; htmlobjectelement.usemap =
string; value a dom
string.
HTMLObjectElement.width - Web APIs
the width property of the htmlobjectelement interface returns a dom
string 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 dom
string.
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 dom
string.
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 dom
string containing the error message.
HTMLStyleElement - Web APIs
htmlstyleelement.media is a dom
string representing the intended destination medium for style information.
... htmlstyleelement.type is a dom
string 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
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 dom
string.
... hash a dom
string representing the digest algorithm to use.
IDBCursor.direction - Web APIs
the direction read-only property of the idbcursor interface is a dom
string 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
the name read-only property of the idbdatabase interface is a dom
string that contains the name of the connected database.
... syntax var dbname = idbdatabase.name; value a dom
string containing the name of the connected database.
IDBDatabase.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbdatabase interface is a dom
stringlist containing a list of the names of the object stores currently in the connected database.
... syntax var list[] = idbdatabase.objectstorenames; value a dom
stringlist 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
the name property of the idbindex interface contains a
string which names the index.
... syntax var indexname = idbindex.name; idbindex.name = indexname; value a dom
string specifying a name for the index.
IDBTransaction.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbtransaction interface returns a dom
stringlist of names of idbobjectstore objects.
... syntax var mydatabase = transactionobj.objectstorenames; returns a dom
stringlist of names of idbobjectstore objects.
IDBTransaction - Web APIs
idbtransaction.objectstorenames read only returns a dom
stringlist 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 dom
string name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
... idbobjectstoresync objectstore( in dom
string name ) raises (idbdatabaseexception); parameters name the name of the requested object store.
InputEvent - Web APIs
inputevent.dataread only returns a dom
string 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
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 dom
string 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 dom
string canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type dom
string keylocationarg of type unsigned long modifierslist of type dom
string); ...
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 dom
string 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 dom
string 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 dom
string 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 dom
string url ); parameter url the url of a local file in the file system.
Location: host - Web APIs
the host property of the location interface is a usv
string 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
the hostname property of the location interface is a usv
string 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
the href property of the location interface is a
stringifier that returns a usv
string 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
the origin read-only property of the location interface is a usv
string 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
the password property of the location interface is a usv
string 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
the pathname property of the location interface is a usv
string 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
the port property of the location interface is a usv
string 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
the protocol property of the location interface is a usv
string 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
the username property of the location interface is a usv
string 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: dom
string 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 dom
string that is an identifier for the represented device and is persisted across sessions.
... syntax var deviceid = mediadeviceinfo.deviceid value a dom
string.
MediaDeviceInfo.groupId - Web APIs
the groupid readonly property of the mediadeviceinfo interface returns a dom
string that is a group identifier.
... syntax var groupid = mediadeviceinfo.groupid; value a dom
string which uniquely identifies the group of related devices to which this device belongs.
MediaError - Web APIs
mediaerror.message a dom
string 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
properties medialist.mediatext a
stringifier that returns a dom
string representing the medialist as text, and also allows you to set a new medialist.
... medialist.item() a getter that returns a cssom
string 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 dom
string representing a serialized media query.
... syntax var media = mediaquerylist.media; value a dom
string representing a serialized media query.
MediaQueryListEvent.media - Web APIs
the media read-only property of the mediaquerylistevent interface is a dom
string representing a serialized media query.
... syntax var media = mediaquerylistevent.media; value a dom
string representing a serialized media query.
MediaSource.addSourceBuffer() - Web APIs
syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a dom
string 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 dom
string 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 dom
string 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 dom
string 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 constraindom
string 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 constraindom
string 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 constraindom
string 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 constraindom
string 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 constraindom
string 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 constraindom
string which specifies the type of display surface that's being captured.
MediaTrackConstraints.groupId - Web APIs
the mediatrackconstraints dictionary's groupid property is a constraindom
string 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 constraindom
string 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 dom
string 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 usv
string 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 dom
string representing a unique id for the event.
... syntax var myid = messageevent.lasteventid; value a dom
string representing the id.
MessageEvent.origin - Web APIs
the origin read-only property of the messageevent interface is a usv
string representing the origin of the message emitter.
... syntax var origin = messageevent.origin; value a usv
string representing the origin.
MessageEvent - Web APIs
messageevent.origin read only a usv
string representing the origin of the message emitter.
... messageevent.lasteventid read only a dom
string representing a unique id for the event.
MouseEvent() - Web APIs
syntax event = new mouseevent(typearg, mouseeventinit); values typearg is a dom
string representing the name of the event.
... "region", optional and defaulting to null, of type dom
string, 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 dom
string 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 usv
string containing the name of the encoding used to encode ndef payload if it contains textual data.
... syntax ndefrecord.encoding value a usv
string which can be one of the following: "utf-8", "utf-16", "utf-16le" or "utf-16be".
NDEFRecord.id - Web APIs
the id property ofthe ndefrecord interface is usv
string containing the record identifier.
... syntax ndefrecord.id value a usv
string.
NDEFRecord.lang - Web APIs
the lang property ofthe ndefrecord interface is usv
string containing the language tag of the record contents, if it is a vailable.
... syntax ndefrecord.lang value a usv
string.
NDEFRecord.mediaType - Web APIs
the mediatype property ofthe ndefrecord interface is usv
string containing the mime type of the record payload.
... syntax ndefrecord.mediatype value a usv
string, corresponding to a mime type of the record payload.
NDEFRecord.recordType - Web APIs
the recordtype property ofthe ndefrecord interface is usv
string containing the ndef record type.
... syntax ndefrecord.recordtype value a usv
string which can be one of the following: "empty" represents a empty ndef record.
NameList - Web APIs
namelist.getname() returns a dom
string.
... namelist.getnamespaceuri() returns a dom
string.
Navigator.requestMediaKeySystemAccess() - Web APIs
syntax ​promise = navigator.requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a dom
string identifying the key system.
... typeerror either keysystem is an empty
string or the supportedconfigurations array is empty.
Navigator.vendor - Web APIs
the value of the navigator vendor property is always either "google inc.", "apple computer, inc.", or (in firefox) the empty
string.
... syntax ven
string = 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 dom
string representing the preferred language of the user, usually the language of the browser ui.
... navigatorlanguage.languages read only returns an array of dom
string representing the languages known to the user, by order of preference.
Node.nodeName - Web APIs
the nodename read-only property returns the name of the current node as a
string.
... syntax var str = node.nodename; value a dom
string.
Node.textContent - Web APIs
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
properties notation.publicid read only is a dom
string.
... notation.systemid read only is a dom
string.
Notification.body - Web APIs
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 dom
string.
Notification.lang - Web APIs
the language itself is specified using a dom
string representing a bcp 47 language tag.
... syntax var language = notification.lang; value a dom
string specifying the language tag.
Notification.requestPermission() - Web APIs
returns a promise that resolves to a dom
string 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 dom
string 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 dom
string or node objects.
... syntax // [throws, unscopable] parentnode.replacechildren(...nodesordom
strings) // returns undefined parameters nodesordom
strings a set of node or dom
string objects to replace the parentnode's existing children with.
PasswordCredential.iconURL - Web APIs
the iconurl read-only property of the passwordcredential interface returns a usv
string containing a url pointing to an image for an icon.
... syntax url =passwordcredential.iconurl value a usv
string containing a url.
PasswordCredential.idName - Web APIs
the idname property of the passwordcredential interface returns a usv
string, 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 usv
string 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 usv
string containing a human-readable public name for display in a credential chooser.
... syntax name =passwordcredential.name value a usv
string containing a name.
PasswordCredential.password - Web APIs
the password read-only property of the passwordcredential interface returns a usv
string containing the password of the credential.
... syntax password =passwordcredential.password value a usv
string containing a password.
PasswordCredential.passwordName - Web APIs
the passwordname property of the passwordcredential interface returns a usv
string, 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 usv
string representing the password field name, used when submitting the current object to a remote endpoint via fetch.
Path2D() - Web APIs
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
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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string which provides an error message to be displayed if the specified information doesn't offer any valid shipping options.
... syntax error
string = paymentdetailsupdate.error; paymentdetailsupdate.error = error
string; value a dom
string 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 dom
strings 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 dom
string, 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 dom
string.
... hash a dom
string 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 dom
string that is the json representation of the performancenavigationtiming object.
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 dom
string that is the json representation of the performanceservertiming object.
... return value a dom
string containing json.
PointerEvent.PointerEvent() - Web APIs
syntax event = new pointerevent(type, pointereventinit); arguments type is a dom
string representing the name of the event (see pointerevent event types).
... pointertype — optional and defaulting to "", of type dom
string, 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.to
string(16); // make it a hex digit g = g.to
string(16); // make it a hex digit b = b.to
string(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 dom
string, inherited from credential, which represents the identifier of the current publickeycredential instance.
... syntax id = publickeycredential.id value a dom
string 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 usv
string.
... syntax rpid = publickeycredentialrequestoptions.rpid value a usv
string 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 usv
string 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 dom
string indicating the permission state of the push manager.
... returns a promise that resolves to a dom
string 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...
PushSubscription.endpoint - Web APIs
the endpoint read-only property of the pushsubscription interface returns a usv
string containing the endpoint associated with the push subscription.
... syntax var myend = pushsubscription.endpoint; value a usv
string.
PushSubscription - Web APIs
properties pushsubscription.endpoint read only a usv
string containing the endpoint associated with the push subscription.
... pushsubscription.subscriptionid read only a dom
string 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 dom
string 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 dom
string 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 dom
string containing the name of the event.
... options a dictionary of type rtcdtmftonechangeeventinit, which may contain one or more of the following fields: tone a dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string specifying the value of the ice session's username fragment field, ufrag.
... password a dom
string specifying the session's password
string.
RTCIceProtocol - Web APIs
the webrtc api's rtciceprotocol enumerated type provides a set of dom
string 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 dom
string or an array of dom
strings, 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 dom
string 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 dom
string 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 dom
strings 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 dom
string 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 dom
string, 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 dom
string indicating the codec's mime media type and subtype.
... sdpfmtpline optional a dom
string 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 dom
string of the form "type/subtype".
... sdpfmtpline optional a dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string containing the sdp which describes the session.
... syntax var value = sessiondescription.sdp; sessiondescription.sdp = value; value the value is a dom
string 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 dom
string, 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 dom
string 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
properties id a dom
string which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... type a dom
string 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(tag
string) parameters tag
string text that contains text and tags to be converted to a document fragment.
... example var tag
string = "<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(tag
string); document.body.appendchild(documentfragment); specification specification status comment dom parsing and serializationthe definition of 'range.createcontextualfragment()' in that specification.
Range - Web APIs
range.to
string() 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 dom
string 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.sub
string(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
(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 dom
string representing the request's referrer.
Response() - Web APIs
this can be null (which is the default value), or one of: blob buffersource formdata readablestream urlsearchparams usv
string 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 byte
string key/value pairs (see http headers for a reference).
SVGAElement.target - Web APIs
the svgaelement.target read-only property of svgaelement returns an svganimated
string 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 svganimated
string indicating the ending resource target that opens the document when the link is activated.
SVGAltGlyphElement.glyphRef - Web APIs
the svgaltglyphelement.glyphref property is a dom
string 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 dom
string corresponding to the local attribute of the given element.
... svgcolorprofileelement.name a dom
string 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 dom
stringmap 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 svganimated
string 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 svganimated
string corresponding to the in attribute of the given element.
... svgfeblendelement.in2 read only an svganimated
string corresponding to the in2 attribute of the given element.
SVGFEDisplacementMapElement - Web APIs
svgfedisplacementmapelement.in1 read only an svganimated
string corresponding to the in attribute of the given element.
... svgfedisplacementmapelement.in2 read only an svganimated
string corresponding to the in2 attribute of the given element.
SVGGlyphRefElement - Web APIs
svgglyphrefelement.glyphref a dom
string corresponding to the glyphref attribute of the given element.
... svgglyphrefelement.format a dom
string corresponding to the format attribute of the given element.
SVGImageElement - Web APIs
svgimageelement.crossorigin a dom
string corresponding to the crossorigin attribute of the given <image> element.
... svgimageelement.decoding returns a dom
string 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 dom
string 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 dom
string 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 dom
string corresponding to the type attribute of the given <script> element.
... svgscriptelement.crossorigin read only a dom
string corresponding to the crossorigin attribute of the given <script> element.
SVGStylable - Web APIs
interface overview also implement none methods cssvalue getpresentationattribute(in dom
string name) properties readonly svganimated
string classname readonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type description classname svganimated
string corresponds to attribute class on the given element.
... methods name & arguments return description getpresentationattribute(in dom
string 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 svganimated
string 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 svganimated
string 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 usv
string representing the uri of the resource that was blocked because it violates a policy.
... syntax let blockeduri = violationeventinstance.blockeduri; value a usv
string representing the uri of the blocked resource.
SecurityPolicyViolationEvent.documentURI - Web APIs
the documenturi read-only property of the securitypolicyviolationevent interface is a usv
string representing the uri of the document or worker in which the violation was found.
... syntax let documenturi = violationeventinstance.documenturi; value a usv
string 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 dom
string representing the directive whose enforcement uncovered the violation.
... syntax let effdir = violationeventinstance.effectivedirective; value a dom
string representing the directive whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.originalPolicy - Web APIs
the originalpolicy read-only property of the securitypolicyviolationevent interface is a dom
string containing the policy whose enforcement uncovered the violation.
... syntax let origpolicy = violationeventinstance.originalpolicy; value a dom
string representing the policy whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.referrer - Web APIs
the referrer read-only property of the securitypolicyviolationevent interface is a usv
string representing the referrer of the resources whose policy was violated.
... syntax let referrer = violationeventinstance.referrer; value a usv
string 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 dom
string representing a sample of the resource that caused the violation.
... syntax let sample = violationeventinstance.sample; value a dom
string 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 usv
string representing the uri of the document or worker in which the violation was found.
... syntax let source = violationeventinstance.sourcefile; value a usv
string 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 dom
string representing the directive whose enforcement uncovered the violation.
... syntax let violateddir = violationeventinstance.violateddirective; value a dom
string representing the directive whose enforcement uncovered the violation.
Selection.type - Web APIs
the type read-only property of the selection interface returns a dom
string describing the type of the current selection.
... syntax value = sel.type value a dom
string 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.to
string(), 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 yesto
string 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 dom
string 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.addfrom
string(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.addfrom
string 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.addfrom
string(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 dom
string 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.addfrom
string(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 dom
string 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.addfrom
string(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 dom
string.
Storage.getItem() - Web APIs
syntax var avalue = storage.getitem(keyname); parameters keyname a dom
string containing the name of the key you want to retrieve the value of.
... return value a dom
string containing the value of the key.
Storage.setItem() - Web APIs
syntax storage.setitem(keyname, keyvalue); parameters keyname a dom
string containing the name of the key you want to create/update.
... keyvalue a dom
string 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
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
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 dom
string 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 dom
string containing the name of the decoder, that is a
string describing the method the textdecoder will use.
... textdecoder.prototype.decode() returns a dom
string containing the text decoded with the method of the specific textdecoder object.
TextTrack.mode - Web APIs
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 dom
string 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 dom
string 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.to
string(16); // make it a hex digit g = g.to
string(16); // make it a hex digit b = b.to
string(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 dom
string.
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 dom
string identifying the specific type of transition event that occurred.
... transitionnamearg is a dom
string containing the name of the css property associated with the transition.
TransitionEvent.pseudoElement - Web APIs
the transitionevent.pseudoelement read-only property is a dom
string, 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
properties typeinfo.typename read only returns a dom
string indicating the type's name.
... typeinfo.typenamespace read only returns a dom
string indicating the type's namespace within the schema.
URL.createObjectURL() - Web APIs
the url.createobjecturl() static method creates a dom
string containing a url representing the object given in the parameter.
... return value a dom
string containing an object url that can be used to reference the contents of the specified source object.
URL.host - Web APIs
the host property of the url interface is a usv
string 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 usv
string.
URL.hostname - Web APIs
the hostname property of the url interface is a usv
string containing the domain name of the url.
... syntax const domain = url.hostname url.hostname = domain value a usv
string.
URL.href - Web APIs
the href property of the url interface is a usv
string containing the whole url.
... syntax const url
string = url.href url.href = newurl
string value a usv
string.
URL.origin - Web APIs
the origin read-only property of the url interface returns a usv
string containing the unicode serialization of the origin of the represented url.
... syntax const origin
string = url.origin value a usv
string.
URL.password - Web APIs
the password property of the url interface is a usv
string containing the password specified before the domain name.
... syntax const password
string = url.password url.password = newpassword value a usv
string.
URL.pathname - Web APIs
the pathname property of the url interface is a usv
string 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 usv
string.
URL.pathname - Web APIs
the pathname property of the url interface is a usv
string 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 usv
string.
URL.port - Web APIs
the port property of the url interface is a usv
string containing the port number of the url.
... syntax const portnumber = url.port url.port = newportnumber value a usv
string.
URL.protocol - Web APIs
the protocol property of the url interface is a usv
string representing the protocol scheme of the url, including the final ':'.
... syntax const protocol = url.protocol url.protocol = newprotocol value a usv
string.
URL.username - Web APIs
the username property of the url interface is a usv
string containing the username specified before the domain name.
... syntax const username
string = url.username url.username = newusername value a usv
string.
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 usv
string 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.sub
string(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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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
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
the id property contains a
string which uniquely identifies the track represented by the videotrack.
... syntax var trackid = videotrack.id; value a dom
string 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 dom
string 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<dom
string> ext.getsupportedprofiles(); return value an array of dom
string 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.
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 dom
string 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 dom
string 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 dom
string gl.version dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string 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 dom
string.
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 dom
string.
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 dom
string format, which uses two bytes per character.
... as with objects, integer keys are automatically converted to
strings.
Window.matchMedia() - Web APIs
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(mediaquery
string) parameters mediaquery
string a
string specifying the media query to parse into a mediaquerylist.
Window.name - Web APIs
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 to
string method.
Window.openDialog() - Web APIs
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 dom
string 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 dom
string the new url to which the window is navigating.
... oldurl dom
string 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 - 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 usv
string 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 dom
string 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 dom
string xpathnsresolver.lookupnamespaceuri(prefix); parameters prefix a dom
string representing the prefix to look for.
... return value a dom
string 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 dom
string 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 dom
string 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 dom
string which contains one of the values defined by the xrenvironmentblendmode enumerated type.
... syntax blendmode = xrsession.environmentblendmode; value a dom
string 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 dom
string 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 dom
string 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
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 dom
string 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 sub
string, locate the line ending of that sub
string 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
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
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
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
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
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
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
value a 7-character dom
string 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 dom
string 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
<input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a dom
string representing the value of the hidden data you want to pass back to the server.
... value the <input> element's value attribute holds a dom
string that contains the hidden data you want to include when the form is submitted to the server.
<input type="number"> - HTML: Hypertext Markup Language
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).
<time> - HTML: Hypertext Markup Language
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.
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
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'; <dom
string> any
string can be a trusted type policy name.
Date - HTTP
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()).toutc
string() } }) 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().toutc
string() // "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
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.to
string.call(callbackfn) !== '[object function]') { throw new typeerror(); } // 5.
...let pk be to
string(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.to
string() 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.to
string() 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.to
string() 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.to
string() returns a
string representing the specified object.
... overrides the object.prototype.to
string() 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.to
string() returns a
string representing the source code of the function.
... overrides the object.prototype.to
string 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)); // tolocale
string 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)); // tolocale
string 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.to
string()); // prints "fr-u-ca-gregory-hc-h24" let mylocmaximized = mylocale.maximize(); // prints "fr-latn-fr".
...console.log(mylocmaximized.to
string()); 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.to
string()); // 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.to
string()); 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.to
string().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 sub
string 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 sub
string 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.to
string.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.
format - SVG: Scalable Vector Graphics
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
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
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 dom
string 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 sub
string 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
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
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
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
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.parsefrom
string(astr, "text/xml"); figure 3 : performing the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); ...
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.to
string(), $(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.to
string()) { 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...
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.to
string(), // 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.nsisupports
string); } 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("x
stringbundle")); 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.
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.
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.
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...
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 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) .log
stringmessage(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) .log
stringmessage(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(alog
string) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.log
stringmessage("myxul: " + alog
string + "\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.
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 a
string defaultextension; readonly attribute a
string extensionfilter; readonly attribute a
string 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"; } ...
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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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).sub
string(0, caretpos); const back = (textarea.value).sub
string(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...
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.
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.
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.
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.
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> ...
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 nsi
stringbundleservice
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.
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.
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.
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_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 ...
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.
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.to
string = new function("return this.s"); } could be written more efficiently as function myobject(a) { this.s = a; this.to
string = 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, byte
string, 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 (.to
string) in unusual cases.
JIT Optimization Outcomes
accessnottypedarray accessnot
string statictypedarrayuint32 statictypedarraycantcomputemask outofbounds getelem
stringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled.
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<js
string*> handle
string; 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::handle
string 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<js
string*> mutablehandle
string; 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_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, js
string, 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 js
strings 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 to
string 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_versionto
string js_
stringtoversion bug 880917 ...
JS_SetVersionForCompartment
see also mxr id search for js_setversionforcompartment jsversion js_getversion js_versionto
string 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 js
strings 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.
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 get
stringbundleservice nsi
stringbundleservice
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]".
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 'to
string()' 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, aextra
stringdata) { 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 nsembedc
string and nscomptr.
NS_InitXPCOM3
many of the xpcom glue functions and classes are also available prior to xpcom initialization, including for example nsembedc
string 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.
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.log
stringmessage(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 ac
string 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 autf8
string 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 autf8
string process and combine the help text provided by each command-line handler.
nsIConsoleMessage
attributes attribute type description message w
string the message in a
string format.
nsICookie2
rawhost autf8
string 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 w
string charset); void setcurrentcomposercharset(in w
string charset); void setcurrentmailcharset(in w
string charset); methods setcurrentcharset() void setcurrentcharset( in w
string charset ); parameters charset setcurrentcomposercharset() void setcurrentcomposercharset( in w
string charset ); parameters charset setcurrentmailcharset() void setcurrentmailcharset( in w
string charset ); ...
nsIDOMMozNetworkStats
to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype dom
string connection type of the stats.
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 ac
string aname, in ac
string 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 ac
string aname, in ac
string 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 a
string 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 autf8
string schema); methods getcollectionforschema() nsigsettingscollection getcollectionforschema( in autf8
string schema ); parameters schema return value ...
nsIMacDockSupport
method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext a
string text to display in a badge on the application's dock icon.
nsIUserCertPicker
inherits from: nsisupports last changed in gecko 1.7 method overview nsix509cert pickbyusage(in nsiinterfacerequestor ctx, in w
string selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled); methods pickbyusage() nsix509cert pickbyusage( in nsiinterfacerequestor ctx, in w
string 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 dom
string instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in dom
string 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.
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::moz
stringmucking() { nsresult rv = ns_c
stringcopy(mdest
string, msrc
string); ns_ensure_success(rv, rv); // this is the same as doing: nsresult rv = ns_c
stringcopy(mdest
string, msrc
string); if (ns_failed(rv)) return rv; return ns_ok; } ...
NS ENSURE TRUE
syntax ns_ensure_true( expr, return-value ); usage nsresult mozmyclass::moz
stringmucking() { 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..
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.to
string()); 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.
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.to
string(); // 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: np
string npvariant npn_releasevariantvalue npn_get
stringidentifier npn_get
stringidentifiers npn_getintidentifier npn_identifieris
string 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 np
string npvariant npn_releasevariantvalue npn_get
stringidentifier npn_get
stringidentifiers npn_getintidentifier npn_identifieris
string 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...
CustomEvent() - Web APIs
syntax event = new customevent(typearg, customeventinit); parameters typearg a dom
string representing 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 dom
stringlist 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 ...
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.to
string()); 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.to
string()); document.queryselector('#transformedorigin').setattribute('transform', scaledmatrixwithorigin.to
string()); 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.to
string()); 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 parsefrom
string() method.
DOMTokenList.add() - Web APIs
syntax tokenlist.add(token1[, token2[, ...tokenn]]); parameters tokenn a dom
string representing the token (or tokens) to add to the tokenlist.
DOMTokenList.contains() - Web APIs
syntax tokenlist.contains(token); parameters token a dom
string representing the token you want to check for the existance of in the list.
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").
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.sub
string( 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 dom
string representing the name of the event (see dragevent event types).
EffectTiming.direction - Web APIs
syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a dom
string 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
syntax var timingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a dom
string 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
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 dom
string 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.to
string().touppercase()); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element: cut 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('cut', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.to
string().touppercase()); selection.deletefromdocument(); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
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.name - Web APIs
syntax idbobjectstore.name = mynewname; var myobjectstorename = idbobjectstore.name; value a dom
string containing the object store's name.
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.
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.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 ...
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
syntax var hitregion = instanceofmouseevent.region return value a dom
string representing the id of the hit region.
MouseScrollEvent - Web APIs
method overview void initmousescrollevent(in dom
string 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...
msPlayToPrimary - Web APIs
example // microsoft extensions interface htmlimageelement : htmlelement { attribute boolean msplaytodisabled; attribute boolean msplaytoprimary; attribute dom
string 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
syntax var sessionpromise = ndefwriter.write(message, options); parameters message the message to be written, either dom
string or buffersource or ndefmessageinit.
Navigator.msLaunchUri() - Web APIs
syntax navigator.mslaunchuri(uri, successcallback, nohandlercallback); parameters uri a dom
string specifying the url containing including the protocol of the document or resource to be displayed.
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.
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.
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.
PluginArray - Web APIs
var pluginslength = navigator.plugins.length; document.write( pluginslength.to
string() + " 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 (dom
string) 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.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 dom
string identifying the specific type of animation event that occurred.
SVGFEImageElement - Web APIs
svgfeimageelement.crossorigin read only an svganimated
string reflects the crossorigin attribute of the given element, limited to only known values.
SVGFETileElement - Web APIs
svgfetileelement.in1 read only an svganimated
string corresponding to the in 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().to
string().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
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 - Web APIs
void seteventhandler(dom
string type, eventhandler handler) eventhandler geteventhandler(dom
string 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.
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.
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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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.addfrom
string(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 dom
string 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.addfrom
string(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.addfrom
string(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.addfrom
string(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...
XPathNSResolver - Web APIs
the xpathnsresolver interface permits prefix
strings in an xpath expression to be properly bound to namespace uri
strings.
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 dom
string 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 dom
string 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 dom
string 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 dom
string 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
visibilitystate read only a dom
string 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 dom
string 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.
@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
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
| <id-selector> = <hash-token><class-selector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <
string-token> | <ident-token> ] <attr-modifier>?
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.to
string(16); var g = this.g.to
string(16); var b = this.b.to
string(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.to
string(16); var g = this.g.to
string(16); var b = this.b.to
string(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 ...
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.
CSS data types - CSS: Cascading Style Sheets
<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
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
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.to
string(16); var g = this.g.to
string(16); var b = this.b.to
string(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
<
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
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.
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
)<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
[ <
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.
Common (exsl) - EXSLT
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
a node has this maximum value if converting its
string value to a number equals the maximum value.
math:lowest() - EXSLT
a node has this minimum value if converting its
string value to a number equals the minimum value.
math:max() - EXSLT
returns a result tree fragment representing the highest valued node's numeric value as a
string.
math:min() - EXSLT
returns a result tree fragment representing the lowest valued node's numeric value as a
string.
Regular expressions (regexp) - EXSLT
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
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.
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.to
string(); } 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.to
string(); } 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 sub
string in the user agent (ua)
string) implies something about the presence or absence of other features.
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.
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.to
string 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 sub
string method won't work var foo = undefined; foo.sub
string(1); // typeerror: x is undefined, can't access property "sub
string" of it var foo = null; foo.sub
string(1); // typeerror: x is null, can't access property "sub
string" of it fixing the issue to fix null pointer to undefined or null values, you can use the typeof operator, for example.
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 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: "x" is (not) "y" - JavaScript
examples invalid cases // undefined and null cases on which the sub
string method won't work var foo = undefined; foo.sub
string(1); // typeerror: foo is undefined var foo = null; foo.sub
string(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...
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.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.isArray() - JavaScript
if (!array.isarray) { array.isarray = function(arg) { return object.prototype.to
string.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.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.
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().
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}, 'to
string') // 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.lastParen ($+) - JavaScript
the non-standard lastparen property is a static and read-only property of regular expressions that contains the last parenthesized sub
string 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.
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.
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.
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.
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.
dir - Web app manifests
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.
name - Web app manifests
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).
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...
SVG Core Attributes - SVG: Scalable Vector Graphics
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.
bbox - SVG: Scalable Vector Graphics
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.
display - SVG: Scalable Vector Graphics
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.
in - SVG: Scalable Vector Graphics
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
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.
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.to
string(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...
unicode - SVG: Scalable Vector Graphics
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.
SVG Attribute reference - SVG: Scalable Vector Graphics
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.
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.selectsub
string() 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...
key - XPath
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() sub
string() sub
string-after() sub
string-before() sum() system-property() xslt-specific translate() true() unparsed-entity-url() xslt-specific (not supported) ...
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
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.
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) sub
string() (supported) sub
string-after() (supported) sub
string-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) sub
string() (supported) sub
string-after() (supported) sub
string-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...