Search completed in 1.82 seconds.
Script security
this page provides an overview of the scri
pt security architecture in gecko.
... like any web browser, gecko can load javascri
pt from untrusted and potentially hostile web pages and run it on the user's computer.
... gecko has an additional problem, though: while its core is written in c++, the front-end code is written in javascri
pt.
...And 15 more matches
The JavaScript Runtime
when scri
pts are compiled in interpretive mode, an internal representation of the compiled form is created and stored rather than generating a java class.
... compilation to java bytecodes for improved performance, rhino may compile javascri
pt scri
pts to java bytecodes.
...each javascri
pt scri
pt or function is compiled to a separate class.
...And 15 more matches
nsIXPCScriptable
js/src/xpconnect/idl/nsixpcscri
ptable.idlnot scri
ptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void precreate(in nsisupports nativeobj, in jscontext
ptr cx, in jsobject
ptr globalobj, out jsobject
ptr parentobj); void create(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj); void postcreate(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj); prbool addproperty(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in jsval id, in jsval
ptr vp); prbool delproperty(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in jsval id, in jsval
ptr vp); prbool getproperty(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in jsval id...
..., in jsval
ptr vp); prbool setproperty(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in jsval id, in jsval
ptr vp); prbool enumerate(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj); prbool newenumerate(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in pruint32 enum_op, in jsval
ptr statep, out jsid idp); prbool newresolve(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in jsval id, in pruint32 flags, out jsobject
ptr objp); prbool convert(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj, in pruint32 type, in jsval
ptr vp); void finalize(in nsixpconnectwrappednative wrapper, in jscontext
ptr cx, in jsobject
ptr obj); prbool checkaccess(i...
...And 15 more matches
KeyframeEffectOptions - Web APIs
the keyframeeffecto
ptions dictionary, part of the web animations api, is used by element.animate(), keyframeeffectreadonly() and keyframeeffect() to describe timing properties for animation effects.
... these properties are all o
ptional, although without setting a duration the animation will not play.
... properties composite o
ptional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation.
...And 15 more matches
RTCSessionDescription - Web APIs
the rtcsessiondescri
ption interface describes one end of a connection—or potential connection—and how it's configured.
... each rtcsessiondescri
ption consists of a descri
ption type indicating which part of the offer/answer negotiation process it describes and of the sdp descri
ptor of the session.
... the process of negotiating a connection between two peers involves exchanging rtcsessiondescri
ption objects back and forth, with each descri
ption suggesting one combination of connection configuration o
ptions that the sender of the descri
ption supports.
...And 15 more matches
Setting up adaptive streaming media sources - Developer guides
let's say you want to set up an ada
ptive streaming media source on a server, to be consumed inside an html5 media element.
...this article explains how, looking at two of the most common formats: mpeg-dash and hls (http live streaming.) choosing formats in terms of ada
ptive streaming formats, there are many to choose from; we decided to choose the following two as between them we can support most modern browsers.
... mpeg-dash hls (http live streaming) in order to ada
ptively stream media we need to split the media up into chunks.
...And 15 more matches
Closures - JavaScript
in javascri
pt, closures are created every time a function is created, at function creation time.
...however, because the code still works as expected, this is obviously not the case in javascri
pt.
... the reason is that functions in javascri
pt form closures.
...And 15 more matches
Functions - JavaScript
« previousnext » functions are one of the fundamental building blocks in javascri
pt.
... a function in javascri
pt is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output.
... see also the exhaustive reference cha
pter about javascri
pt functions to get to know the details.
...And 15 more matches
Loading Content Scripts - Archive of obsolete content
this page is now obsolete, and its content has been incorporated into the main page on content scri
pts.
... the constructors for content-scri
pt-using objects such as panel and page-mod define a group of o
ptions for loading content scri
pts: contentscri
pt string, array contentscri
ptfile string, array contentscri
ptwhen string contentscri
pto
ptions object we have already seen the contentscri
pt o
ption, which enables you to pass in the text of the scri
pt itself as a string literal.
... this version of the api avoids the need to maintain a separate file for the content scri
pt.
...And 14 more matches
Inline options - Archive of obsolete content
o
ptions file the xul allowed for the inline o
ptions is limited to a few new tags.
... here is an example of an o
ptions.xul file: <?xml version="1.0"?> <!doctype mydialog system "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool" title="boolean" desc="stored as a boolean preference" /> </vbox> note that it's limited to <setting> tags.
...if you need scri
pt support, see the display notifications section.
...And 14 more matches
Install script template - Archive of obsolete content
the keys are written according to the specification: http://mozilla.org/projects/plugins/first-install-problem.html and follows the plid specification: http://mozilla.org/projects/plugins/plugin-identifier.html **/ // define some global variables var plugin_file = "npmyplugin.dll"; // this plugin consists of an x
pt file because it is scri
ptable // http://mozilla.org/projects/plugins/scri
pting-plugins.html var component_file = "npmypluginscri
ptable.x
pt"; var plugin_size = 2000; // (dll file) reserve a little extra so it is not required to update too often var component_size = 10; // (xpi file) reserve a little extra so it is not required to update too often var software_name="cult3d mozilla viewer"...
... var plid = "@myplugin.com/myplugin,version=5.3"; var version = "5.3.0.0"; var mimetype = "application/x-my-plugin"; var suffix = "my"; var suffix_descri
ption = "my plugin files"; var company_name = "mypluginco"; var plugin_descri
ption = "my exemplary plugin mine all mine"; // registry constant paths // these will be used when the win32 registry keys are written var hkey_local_machine = "hkey_local_machine"; var hkey_current_user = "hkey_current_user"; var reg_moz_path = "software\\mozillaplugins"; // my own error code in case secondary installation fails var nosecondaryinstall = 1; // error return codes need some memory var err; // error return codes when we try and install to the curr...
...ent browser var errblock1; // error return codes when we try and do a secondary installation var errblock2 = 0; // global variable containing our secondary install location var secondaryfolder; //special error values used by the cycore developers (www.cycore.com) who helped make this install scri
pt var exce
ptionoccurederror = -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 i...
...And 14 more matches
JSException - Archive of obsolete content
summary the public class jsexce
ption extends runtimeexce
ption java.lang.object | +----java.lang.throwable | +----java.lang.exce
ption | +----java.lang.runtimeexce
ption | +----netscape.javascri
pt.jsexce
ption descri
ption jsexce
ption is an exce
ption which is thrown when javascri
pt code returns an error.
... constructor summary the netscape.javascri
pt.jsexce
ption class has the following constructors: jsexce
ption deprecated constructors o
ptionally let you specify a detail message and other information.
... method summary the netscape.javascri
pt.jsexce
ption class has the following methods: getwrappedexce
ption instance method getwrappedexce
ption.
...And 14 more matches
Object-oriented JavaScript for beginners - Learn web development
previous overview: objects next with the basics out of the way, we'll now focus on object-oriented javascri
pt (oojs) — this article presents a basic view of object-oriented programming (oop) theory, then explores how javascri
pt emulates object classes via constructor functions, and how to create object instances.
... prerequisites: basic computer literacy, a basic understanding of html and css, familiarity with javascri
pt basics (see first steps and building blocks) and oojs basics (see introduction to objects).
... objective: to understand the basic theory behind object-oriented programming, how this relates to javascri
pt ("everything is an object"), and how to create constructors and object instances.
...And 14 more matches
JS_CompileScript
compiles a scri
pt for execution.
... syntax // added in spidermonkey 45 bool js_compilescri
pt(jscontext *cx, const char *ascii, size_t length, const js::compileo
ptions &o
ptions, js::mutablehandlescri
pt scri
pt); bool js_compileucscri
pt(jscontext *cx, const char16_t *chars, size_t length, const js::compileo
ptions &o
ptions, js::mutablehandlescri
pt scri
pt); // obsolete since jsapi 39 bool js_compilescri
pt(jscontext *cx, js::handleobject obj, const char *ascii, size_t length, const js::compileo
ptions &o
ptions, js::mutablehandlescri
pt scri
pt); bool js_compileucscri
pt(jscontext *cx, js::handleobject obj, const char16_t *chars, size_t length, ...
... const js::compileo
ptions &o
ptions, js::mutablehandlescri
pt scri
pt); name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
...And 14 more matches
JS_EvaluateScript
compile and execute a scri
pt.
... syntax jsbool js_evaluatescri
pt(jscontext *cx, jsobject *obj, const char *src, unsigned int length, const char *filename, unsigned int lineno, jsval *rval); jsbool js_evaluateucscri
pt(jscontext *cx, jsobject *obj, const jschar *src, unsigned int length, const char *filename, unsigned int lineno, jsval *rval); name type descri
ption cx jscontext * the context in which to run the scri
pt.
... obj jsobject * the scope in which to execute the scri
pt.
...And 14 more matches
Scripting - Archive of obsolete content
the web application bundle is allowed to hold a javascri
pt file named webapp.js (called the webapp scri
pt).
...currently, the webapp scri
pt also has access to full xpcom functionality, just like a firefox extension.
...it means that the scri
pt has a higher level of privilege than scri
pts in the web content and has access to the file system, clipboard and other parts of the native os.
... note: in the future, the webapp scri
pt may have lower privileges.
script.type - Archive of obsolete content
« xul reference home type type: language content type the language of the scri
pt.
... usually, you would set this to application/javascri
pt.
... note: if the javascri
pt file is in chrome://, setting this attribute to application/javascri
pt will always use the latest available javascri
pt version.
... if you omit this attribute, the default (and older) javascri
pt version is used (like you get when including a javascri
pt file from web content without specifying a version number).
International characters in XUL JavaScript - Archive of obsolete content
gecko 1.8, as used in firefox 1.5 and other applications, added support for non-ascii characters in javascri
pt files loaded from xul files.
... this means that such scri
pt files can use any character from virtually any language of the world.
... how the character encoding is determined in gecko 1.8 and later when the javascri
pt file is loaded from a chrome:// url, a byte order mark (fixme: )(bom) is used to determine the character encoding of the scri
pt.
... if the scri
pt file is loaded via http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascri
pt; charset=utf-8 if no charset parameter is specified, the same rules as above apply.
Providing Command-Line Options - Archive of obsolete content
see also: xulrunner:commandline overview the code below is an example of writing a javascri
pt xpcom component to handle command line parameters.
...dline.js file into the components directory and add the following lines to your chrome.manifest file: component {2991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascri
pt code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/services.jsm"); // changeme: to the chrome uri of your extension or application const chrome_uri = "chrome://myapp/content/"; /** * utility functions */ /** * opens a chrome window.
... * @param aargument an argument to pass to the window (may be null) */ function openwindow(achromeurispec, aargument) { services.ww.openwindow(null, achromeurispec, "_blank", "chrome,menubar,toolbar,status,resizable,dialog=no", aargument); } // command line handler function commandlinehandler() { }; commandlinehandler.prototype = { classdescri
ption: "myapphandler", // changeme: generate a unique id classid: components.id('{2991c315-b871-42cd-b33f-bfee4fcbf682}'), // changeme: change the type in the contractid to be unique to your application contractid: "@mozilla.org/commandlinehandler/general-startup;1?type=myapp", _xpcom_categories: [{ category: "command-line-handler", // changeme: // category names are sorted alp...
...eter passed to -viewapp on the command line."); } // changeme: change "myapp" to your command line flag (no argument) if (cmdline.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 descri
ptions 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 descri
ption\n" }; var nsgetfactory...
ant script to assemble an extension - Archive of obsolete content
this ant scri
pt helps to package an extension <?xml version="1.0"?> this build file was written by régis décamps <decamps@users.sf.net> <project name="blogmark" default="createxpi"> <property name="version" value="1.3-rc1"/> <property name="descri
ption" value="new context-menu item to add the current page in your blogmarks"/> xpi file is created after "chrome/blogmark.jar" is created, which is then stuffed into "blogmark.xpi" <target name="createxpi" depends="createjar" descri
ption="assemble the final build blogmark.xpi"> <zip destfile="blogmark-${version}.xpi"> <zipfileset dir="." includes="chrome/blogmark.jar" /> <zip...
...fileset dir="." includes="install.rdf" /> </zip> </target> everything inside the chrome directory is zipped into chrome/blogmark.jar <target name="createjar" depends="templates" descri
ption="assemble the jar"> <jar destfile="chrome/blogmark.jar"> <fileset dir="chrome/"> <include name="**/*"/> <exclude name="**/*~"/> <exclude name="**/*.tpl.*"/> <exclude name="blogmark.jar"/> </fileset> </jar> </target> <target name="templates" descri
ption="generate files from templates."> <copy file="chrome/content/blogmark/contents.rdf.tpl.
...xml" tofile="chrome/content/blogmark/contents.rdf" overwrite="true"> <filterchain> <replacetokens> <token key="version" value="${version}"/> <token key="descri
ption" value="${descri
ption}"/> </replacetokens> </filterchain> </copy> <copy file="chrome/content/blogmark/about.xul.tpl.xml" tofile="chrome/content/blogmark/about.xul" overwrite="true"> <filterchain> <replacetokens> <token key="version" value="...
... </filterchain> </copy> <copy file="install.rdf.tpl.xml" tofile="install.rdf" overwrite="true"> <filterchain> <replacetokens> <token key="version" value="${version}"/> <token key="descri
ption" value="${descri
ption}"/> </replacetokens> </filterchain> </copy> </target> </project> ...
ScriptEngineBuildVersion - Archive of obsolete content
the scri
ptenginebuildversion function bets the build version number of the scri
pting engine in use.
... syntax scri
ptenginebuildversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scri
pting language in use.
... example the following example illustrates the use of the scri
ptenginebuildversion function: if(window.scri
ptenginebuildversion) { console.log(window.scri
ptenginebuildversion()); } // output: <current build version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
... scri
ptengine function scri
ptenginemajorversion function scri
ptengineminorversion function ...
ScriptEngineMinorVersion - Archive of obsolete content
the scri
ptengineminorversion function gets the minor version number of the scri
pting engine in use.
... syntax scri
ptengineminorversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scri
pting language in use.
... example the following example illustrates the use of the scri
ptengineminorversion function.
... if (window.scri
ptengineminorversion) { console.log(window.scri
ptengineminorversion()); } //output: <current minor version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
New in JavaScript 1.6 - Archive of obsolete content
the following is a changelog for javascri
pt 1.6.
...the corresponding ecma standard is ecma-262 edition 3 and ecmascri
pt for xml (e4x) with some additional features.
... new features in javascri
pt 1.6 support for ecmascri
pt for xml (e4x) for creating and processing xml content within javascri
pt has been added.
... 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 javascri
pt 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.
Cryptanalysis - MDN Web Docs Glossary: Definitions of Web-related terms
cry
ptanalysis is the branch of cry
ptography that studies how to break codes and cry
ptosystems.
... cry
ptanalysis creates techniques to break ciphers, in particular by methods more efficient than a brute-force search.
... in addition to traditional methods like frequency analysis and index of coincidence, cry
ptanalysis includes more recent methods, like linear cry
ptanalysis or differential cry
ptanalysis, that can break more advanced ciphers.
... learn more general knowledge cry
ptanalysis on wikipedia ...
Cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
cry
ptography, or cry
ptology, is the science that studies how to encode and transmit messages securely.
... cry
ptography designs and studies algorithms used to encode and decode messages in an insecure environment, and their applications.
... more than just data confidentiality, cry
ptography also tackles identification, authentication, non-repudiation, and data integrity.
... therefore it also studies usage of cry
ptographic methods in context, cry
ptosystems.
Script-supporting element - MDN Web Docs Glossary: Definitions of Web-related terms
in an html document, scri
pt-supporting elements are those elements that don't directly contribute to the appearance or layout of the page; instead, they're either scri
pts or contain information that's only used by scri
pts.
... these elements may be important, but do not affect the displayed page unless the page's scri
pts explicitly cause them to do so.
... there are only two scri
pt-supporting elements: <scri
pt> and <template>.
... technical reference to learn more, see scri
pt-supporting elements in kinds of html content.
JavaScript Tips
for instance the offline observer declared above is a javascri
pt object that is registered with an xpcom object, so that the call back from xpcom executes the javascri
pt method.
...however, in javascri
pt this is quite simple even in the case of a weak reference which in c++ requires a helper class: var weakobserver = { queryinterface: function queryinterface(aiid) { if (aiid.equals(components.interfaces.nsiobserver) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_nointerface; }, observe: function observe(asubject, atopic, astate) { } } when declaring xpcom methods, try to use the same names for method parameters as are used in the interface definition.
...the properties are: align allowevents contextmenu datasources dir flex height id left maxheight maxwidth minheight minwidth observes orient pack persist ref statustext top tooltip toolti
ptext width xul also maps the ordinal attribute but this defaults to "1" if it is not present.
... references this was started as a reprint of neil's guide some more current info on this blog post how to remove duplicate objects from an array javascri
pt ...
JavaScript OS.Constants
javascri
pt module os.constants contains operating system-specific constants.
...useful, for instance, to access the platform code from javascri
pt in conjunction with js-ctypes.
... error values eacces permission denied eagain resource temporarily unavailable ebadf bad file descri
ptor eexist file exists efault bad address efbig file too large einval invalid argument eio input/output error eisdir is a directory eloop (not always available under windows) too many levels of symbolic links.
... o_evtonly descri
ptor requested for event notifications only.
Using workers in JavaScript code modules
it works exactly like a standard worker, exce
pt that it has access to js-ctypes via a global ctypes object available in the global scope of the worker obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5)this feature is obsolete.
... note: as of gecko 8.0, the nsiworkerfactory interface has been removed starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), you can use workers in javascri
pt code modules (jsms).
...to create a chromeworker for this purpose, you need to use the nsiworkerfactory interface: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); var worker = workerfactory.newchromeworker('scri
pt_url.js'); this will create a new chrome worker that will immediately begin to run the scri
pt at the specified url (in this case, "scri
pt_url.js").
... for example, "scri
pt_url.js" can be "chrome://extension_name/content/scri
pt.js".
PRSocketOptionData
type for structure used with pr_getsocketo
ption and pr_setsocketo
ption to specify o
ptions for file descri
ptors that represent sockets.
... syntax #include <prio.h> typedef struct prsocketo
ptiondata { prsocko
ption o
ption; union { pruintn ip_ttl; pruintn mcast_ttl; pruintn tos; prbool non_blocking; prbool reuse_addr; prbool keep_alive; prbool mcast_loopback; prbool no_delay; prsize max_segment; prsize recv_buffer_size; prsize send_buffer_size; prlinger linger; prmcastrequest add_member; prmcastrequest drop_member; prnetaddr mcast_if; } value; } prsocketo
ptiondata; fields the structure has the following fields: ip_ttl ip time-to-live.
... descri
ption prsocketo
ptiondata is a name-value pair for a socket o
ption.
... the o
ption field (of enumeration type prsocko
ption) specifies the name of the socket o
ption, and the value field (a union of all possible values) specifies the value of the o
ption.
Building a Thunderbird extension 6: Adding JavaScript
in this step we will create a small piece of javascri
pt code that inserts the current date into our statusbar widget.
...depending on the installed theme the result will look something like this: modify xul elements with javascri
pt save the following javascri
pt code into the content/ folder next to your myhelloworld.xul file and name it overlay.js.
...it then uses javascri
pt's date class to get the current date, which it converts into a string that has the format of yyyy.mm.dd.
... further documentation more functions for the dom objects are listed on: dom/window (api reference for the window object) dom/document (api reference for the document object) gecko dom reference (overview of all dom objects in gecko) you may also find the javascri
pt cheat sheet very useful.
AudioContextOptions.sampleRate - Web APIs
the audiocontexto
ptions dictionary (used when instantiating an audiocontext) may contain a property named samplerate, which indicates the sample rate to use for the new context.
... syntax audiocontexto
ptions.samplerate = 44100; var samplerate = audiocontexto
ptions.samplerate; value the desired sample rate for the audiocontext, specified in samples per second.
... if the samplerate property is not included in the o
ptions, or the o
ptions are not specified when creating the audio context, the new context's output device's preferred sample rate is used by default.
... specifications specification status comment web audio apithe definition of 'audiocontexto
ptions.samplerate' in that specification.
BluetoothRemoteGATTCharacteristic.getDescriptor() - Web APIs
the bluetoothremotegattcharacteristic.getdescri
ptor() method returns a promise that resolves to the first bluetoothgattdescri
ptor for a given descri
ptor uuid.
... syntax bluetoothremotegattcharacteristic.getdescri
ptor(bluetoothdescri
ptoruuid).then(function(bluetoothgattdescri
ptor) { ...
... }) returns a promise that resolves to the first bluetoothgattdescri
ptor.
... specifications specification status comment web bluetooththe definition of 'getdescri
ptor()' in that specification.
BluetoothRemoteGATTCharacteristic.getDescriptors() - Web APIs
the bluetoothremotegattcharacteristic.getdescri
ptors() method returns a promise that resolves to an array of all bluetoothgattdescri
ptor objects for a given descri
ptor uuid.
... syntax bluetoothremotegattcharacteristic.getdescri
ptors(bluetoothdescri
ptoruuid).then(function(bluetoothgattdescri
ptors[]) { ...
... }) returns a promise that resolves to an array of bluetoothgattdescri
ptor objects.
... specifications specification status comment web bluetooththe definition of 'getdescri
ptors()' in that specification.
CanvasCaptureMediaStreamTrack.canvas - Web APIs
the canvasca
pturemediastreamtrack canvas read-only property returns the htmlcanvaselement from which frames are being ca
ptured.
... syntax var elt = stream.canvas; value an htmlcanvaselement indicating the canvas which is the source of the frames being ca
ptured.
... example // find the canvas element to ca
pture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.ca
pturestream(25); // 25 fps // do things to the stream ...
... // obtain the canvas associated with the stream var canvas = stream.canvas; specifications specification status comment media ca
pture from dom elementsthe definition of 'canvasca
pturemediastreamtrack.canvas' in that specification.
Optimizing canvas - Web APIs
this article provides suggestions for o
ptimizing your use of the canvas element to ensure that your graphics perform well.
...a possible o
ptimization in this situation is to layer your items using multiple <canvas> elements.
...window.innerwidth / canvas.width; var scaley = window.innerheight / canvas.height; var scaletofit = math.min(scalex, scaley); var scaletocover = math.max(scalex, scaley); stage.style.transformorigin = '0 0'; //scale from top left stage.style.transform = 'scale(' + scaletofit + ')'; turn off transparency if your application uses canvas and doesn’t need a transparent backdrop, set the alpha o
ption to false when creating a drawing context with htmlcanvaselement.getcontext().
... this information can be used internally by the browser to o
ptimize rendering.
Document: gotpointercapture event - Web APIs
the gotpointerca
pture event is fired when an element ca
ptures a pointer using setpointerca
pture().
... bubbles no cancelable no interface pointerevent event handler property ongotpointerca
pture examples this example gets a <p> element and listens for the gotpointerca
pture event.
... it then calls setpointerca
pture() on the element on a pointerdown event, which will trigger gotpointerca
pture.
... const para = document.queryselector('p'); document.addeventlistener('gotpointerca
pture', () => { console.log('i\'ve been ca
ptured!') }); para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); the same example, using the ongotpointerca
pture event handler property: const para = document.queryselector('p'); document.ongotpointerca
pture = () => { console.log('i\'ve been ca
ptured!') }; para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); specifications specification status pointer events obsolete ...
Document: lostpointercapture event - Web APIs
the lostpointerca
pture event is fired when a ca
ptured pointer is released.
... bubbles no cancelable no interface pointerevent event handler property onlostpointerca
pture examples this example listens for the lostpointerca
pture event, and ca
ptures the pointer for an element on pointerdown.
... when the user subsequently releases the pointer, the lostpointerca
pture event will be fired.
... const para = document.queryselector('p'); document.addeventlistener('lostpointerca
pture', () => { console.log('i\'ve been released!') }); para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); the same example, but using the onlostpointerca
pture event handler property: const para = document.queryselector('p'); document.onlostpointerca
pture = () => { console.log('i\'ve been released!') }; para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); specifications specification status pointer events obsolete ...
Document.onafterscriptexecute - Web APIs
the document.onafterscri
ptexecute property references a function that fires when a static <scri
pt> element finishes executing its scri
pt.
... syntax document.onafterscri
ptexecute = funcref; funcref is a function reference, called when the event is fired.
... the event's target attribute is set to the <scri
pt> element that just finished executing.
... example function finished(e) { logmessage(`finished scri
pt with id: ${e.target.id}`); } document.addeventlistener('afterscri
ptexecute', finished, true); view live example specification html5 ...
Document.onbeforescriptexecute - Web APIs
fired when the code in a <scri
pt> element declared in an html document is about to start executing.
... syntax document.onbeforescri
ptexecute = funcref; funcref is a function reference, called when the event is fired.
... the event's target attribute is set to the scri
pt element that is about to be executed.
... example function starting(e) { logmessage("starting scri
pt with id: " + e.target.id); } document.addeventlistener("beforescri
ptexecute", starting, true); view live examples specification html5 ...
Document.releaseCapture() - Web APIs
the releaseca
pture() method releases mouse ca
pture if it's currently enabled on an element within this document.
... enabling mouse ca
pture on an element is done by calling element.setca
pture().
... syntax document.releaseca
pture(); once mouse ca
pture is released, mouse events will no longer all be directed to the element on which ca
pture is enabled.
... example see the example for element.setca
pture().
Document.scripts - Web APIs
the scri
pts property of the document interface returns a list of the <scri
pt> elements in the document.
... syntax var scri
ptlist = document.scri
pts; value an htmlcollection.
... example this example looks to see if the page has any <scri
pt> elements.
... let scri
pts = document.scri
pts; if (scri
pts.length) { alert('this page has scri
pts!'); } specifications specification status comment html living standardthe definition of 'document.scri
pts' in that specification.
HTMLElement: gotpointercapture event - Web APIs
the gotpointerca
pture event is fired when an element ca
ptures a pointer using setpointerca
pture().
... bubbles yes cancelable no interface pointerevent event handler property ongotpointerca
pture examples this example gets a <p> element and listens for the gotpointerca
pture event.
... it then calls setpointerca
pture() on the element on a pointerdown event, which will trigger gotpointerca
pture.
... const para = document.queryselector('p'); para.addeventlistener('gotpointerca
pture', () => { console.log('i\'ve been ca
ptured!') }); para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); the same example, using the ongotpointerca
pture event handler property: const para = document.queryselector('p'); para.ongotpointerca
pture = () => { console.log('i\'ve been ca
ptured!') }; para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); specifications specification status pointer events obsolete ...
HTMLElement: lostpointercapture event - Web APIs
the lostpointerca
pture event is fired when a ca
ptured pointer is released.
... bubbles yes cancelable no interface pointerevent event handler property onlostpointerca
pture examples this example listens for the lostpointerca
pture event for an element, and ca
ptures the pointer for the element on pointerdown.
... when the user subsequently releases the pointer, the lostpointerca
pture event will be fired.
... const para = document.queryselector('p'); para.addeventlistener('lostpointerca
pture', () => { console.log('i\'ve been released!') }); para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); the same example, but using the onlostpointerca
pture event handler property: const para = document.queryselector('p'); para.onlostpointerca
pture = () => { console.log('i\'ve been released!') }; para.addeventlistener('pointerdown', (event) => { para.setpointerca
pture(event.pointerid); }); specifications specification status pointer events obsolete ...
HTMLMediaElement.onencrypted - Web APIs
the onencry
pted property of the htmlmediaelement is an event handler, fired whenever an encry
pted event occurs, denoting the media is encry
pted.
...arget="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmediaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} syntax htmlmediaelement.onencry
pted = function(encry
pted) { ...
... } specifications specification status comment encry
pted media extensionsthe definition of 'onencry
pted' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonencry
ptedchrome full support yesedge full support 13firefox full support yesie ?
HTMLSelectElement.options - Web APIs
the htmlselectelement.o
ptions read-only property returns a htmlo
ptionscollection of the <o
ption> elements contained by the <select> element.
... syntax var o
ptions = select.o
ptions; return value a htmlo
ptionscollection containing the <o
ption> elements contained by the <select> element.
... example html <label for="test">label</label> <select id="test"> <o
ption value="1">o
ption 1</o
ption> <o
ption value="2">o
ption 2</o
ption> </select> javascri
pt window.addeventlistener("domcontentloaded", function() { const select = document.getelementbyid("test"); for(var i = 0; i < select.o
ptions.length; i++) { console.log(select.o
ptions[i].label); // "o
ption 1" and "o
ption 2" } }); specifications specification status comment html living standardthe definition of 'o
ptions' in that specification.
... living standard no change html5the definition of 'o
ptions' in that specification.
HTMLTableElement.deleteCaption() - Web APIs
the htmltableelement.deleteca
ption() method removes the <ca
ption> element from a given <table>.
... if there is no <ca
ption> element associated with the table, this method does nothing.
... syntax htmltableelement.deleteca
ption() example this example uses javascri
pt to delete a table's ca
ption.
... html <table> <ca
ption>this ca
ption will be deleted!</ca
ption> <tr><td>cell 1.1</td><td>cell 1.2</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td></tr> </table> javascri
pt let table = document.queryselector('table'); table.deleteca
ption(); result specifications specification status comment html living standardthe definition of 'htmltableelement: deleteca
ption' in that specification.
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
the mediastreamtrackaudiosourceo
ptions dictionary's mediastreamtrack property must contain a reference to the mediastreamtrack from which the mediastreamtrackaudiosourcenode being created using the mediastreamtrackaudiosourcenode() constructor.
... syntax mediastreamtrackaudiosourceo
ptions = { mediastreamtrack: audiosourcetrack; } mediastreamtrackaudiosourceo
ptions.mediastreamtrack = audiosourcetrack; value a mediastreamtrack from which the audio output of the new mediastreamtrackaudiosourcenode will be taken.
... let audioctx = new (window.audiocontext || window.webkitaudiocontext)(); if (navigator.mediadevices.getusermedia) { navigator.mediadevices.getusermedia ( { audio: true, video: false }).then(function(stream) { let o
ptions = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, o
ptions); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specifi...
...cation status comment web audio apithe definition of 'mediastreamtrackaudiosourceo
ptions.mediastream' in that specification.
Payment processing concepts - Web APIs
some payment handlers use merchant validation, which is the process of validating the identity of a merchant in some way, usually using some form of cry
ptographic response such as a public key.
...the conditions that make payment possible vary depending on the payment method and the user's payment request; for example, if the user chooses to pay using a credit card that isn't acce
pted by the payee, the payment can't be made.
... merchant validation some payment handlers use merchant validation, which is the process of validating the identity of a merchant in some way, usually using some form of cry
ptographic challenge.
... the exact validation technology depends on the payment handler, and merchant validation is entirely o
ptional.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
authenticatorselection, an o
ptional property of the publickeycredentialcreationo
ptions dictionary, is an object giving criteria to filter out the authenticators to be used for the creation operation.
... syntax authenticatorselection = publickeycredentialcreationo
ptions.authenticatorselection value an object with the following properties: authenticatorattachmento
ptional a string which is either "platform" or "cross-platform".
... requireresidentkeyo
ptional a boolean which indicated that the credential private key must be stored in the authenticator, the client or in a client device.
... userverificationo
ptional a string qualifying how the user verification should be part of the authentication process.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
excludecredentials, an o
ptional property of the publickeycredentialcreationo
ptions dictionary, is an array whose elements are descri
ptors for the public keys already existing for a given user.
... syntax excludecredentials = publickeycredentialcreationo
ptions.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 o
ptional an array of strings describing the possible transports between the client and the authenticator.
... if the authenticator already contains one of such a public key credential, the client will throw a domexce
ption or asks the user if they want to create a new credential.
PublicKeyCredentialRequestOptions.challenge - Web APIs
the challenge property of the publickeycredentialrequesto
ptions dictionary is a buffersource used as a cry
ptographic challenge.
... syntax challenge = publickeycredentialrequesto
ptions.challenge value a buffersource which is at least 16 bytes long.
... contains a cry
ptographic challenge emitted from the relying party's server which must be signed by the authenticator's private key and sent back (within the response) to the relying party's server for verification.
... examples var o
ptions = { challenge: new uint8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": o
ptions }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'challenge' in that specification.
PublicKeyCredentialRequestOptions.userVerification - Web APIs
userverification is an o
ptional property of the publickeycredentialrequesto
ptions.
... note: an analogous o
ption exists for the creation operation (navigators.credentials.create()), see the userverification property of publickeycredentialcreationo
ptions.authenticatorselection.
... syntax userverification = publickeycredentialrequesto
ptions.userverification value a string qualifying how the user verification should be part of the authentication process.
... examples var o
ptions = { userverification: "preferred", challenge: new uint8array([/* bytes sent from the server */]), }; navigator.credentials.get({ "publickey": o
ptions }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications speci...
PushSubscription.toJSON() - Web APIs
the tojson() method of the pushsubscri
ption interface is a standard serializer: it returns a json representation of the subscri
ption properties, providing a useful shortcut.
... syntax mysubscri
ption = subscri
ption.tojson() parameters none.
...it currently only contains the subscri
ption endpoint, as an endpoint member.
... example navigator.serviceworker.ready.then(function(reg) { reg.pushmanager.getsubscri
ption().then(function(subscri
ption) { var mysubscri
ption = subscri
ption.tojson(); // do something with subscri
ption details }) }); specifications specification status comment push apithe definition of 'pushsubscri
ption: tojson' in that specification.
PushSubscription.unsubscribe() - Web APIs
the unsubscribe() method of the pushsubscri
ption interface returns a promise that resolves to a boolean when the current subscri
ption is successfully unsubscribed.
... syntax pushsubscri
ption.unsubscribe().then(function(boolean) { ...
... returns a promise that resolves to a boolean when the current subscri
ption is successfully unsubscribed.
... example navigator.serviceworker.ready.then(function(reg) { reg.pushmanager.getsubscri
ption().then(function(subscri
ption) { subscri
ption.unsubscribe().then(function(successful) { // you've successfully unsubscribed }).catch(function(e) { // unsubscri
ption failed }) }) }); specifications specification status comment push apithe definition of 'unsubscribe()' in that specification.
RTCOfferOptions - Web APIs
the rtcoffero
ptions dictionary is used to provide o
ptional settings when creating an rtcpeerconnection offer with the createoffer() method.
... properties this dictionary also inherits properties from the rtcofferanswero
ptions dictionary, on which it's based.
... icerestart o
ptional a boolean which, when set to true, tells createoffer() to generate and use new values for the identifying properties of the sdp it creates, resulting in a request that triggers renegotiation of the ice connection.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcoffero
ptions' in that specification.
RTCRtpTransceiver.stopped - Web APIs
the read-only stopped property on the rtcrt
ptransceiver interface indicates whether or not the transceiver's associated sender and receiver have both been stopped.
... the transceiver is stopped if the stop() method has been called or if a change to either the local or the remote descri
ption has caused the transceiver to be stopped for some reason.
... syntax var isstopped = rtcrt
ptransceiver.stopped; value a boolean value which is true if the transceiver's sender will no longer send data, and its receiver will no longer receive data.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrt
ptransceiver.stopped' in that specification.
RTCSessionDescriptionCallback - Web APIs
the rtcsessiondescri
ptioncallback type is used to represent the callback function passed into the deprecated callback-based version of createoffer() or createanswer() when using them to create offers or answers.
... syntax rtcsessiondescri
ptioncallback(descri
ption); parameters descri
ption an rtcsessiondescri
ptioninit (or rtcsessiondescri
ption) object describing the session being offered or being acce
pted.
... this object contains the type and sdp properties which are part of rtcsessiondescri
ption.
... example var pc = new rtcpeerconnection(); var descri
ptioncallback = function(offer) { pc.setlocaldescri
ption(offer); } pc.createoffer(descri
ptioncallback); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescri
ptioncallback' in that specification.
ScrollToOptions.left - Web APIs
the left property of the scrolltoo
ptions dictionary specifies the number of pixels along the x axis to scroll the window or element.
... examples in our scrolltoo
ptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e.
... when the form is submitted, an event handler is run that puts the entered values into a scrolltoo
ptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrollo
ptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
... 'smooth' : 'auto' } window.scrollto(scrollo
ptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'left' in that specification.
ScrollToOptions.top - Web APIs
the top property of the scrolltoo
ptions dictionary specifies the number of pixels along the y axis to scroll the window or element.
... examples in our scrolltoo
ptions example (see it live) we include a form that allows the user to enter three values — two numbers representing the left and top properties (i.e.
... when the form is submitted, an event handler is run that puts the entered values into a scrolltoo
ptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrollo
ptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
... 'smooth' : 'auto' } window.scrollto(scrollo
ptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'top' in that specification.
WebGLRenderingContext.depthRange() - Web APIs
the webglrenderingcontext.de
pthrange() method of the webgl api specifies the de
pth range mapping from normalized device coordinates to window or viewport coordinates.
... syntax void gl.de
pthrange(znear, zfar); parameters znear a glclampf specifying the mapping of the near clipping plane to window or viewport coordinates.
... examples gl.de
pthrange(0.2, 0.6); to check the current de
pth range, query the de
pth_range constant which returns a float32array gl.getparameter(gl.de
pth_range); // float32array[0.2, 0.6] specifications specification status comment webgl 1.0the definition of 'de
pthrange' in that specification.
... opengl es 2.0the definition of 'glde
pthrangef' in that specification.
XPathException - Web APIs
in the dom xpath api the xpathexce
ption interface represents exce
ption conditions that can be encountered while performing xpath operations.
... properties xpathexce
ption.code read only returns a short that contains one of the error code constants.
... constants constant value descri
ption invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexce
ption' in that specification.
XRPermissionDescriptor.mode - Web APIs
the mode property of the xrpermissiondescri
ptor 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 xrpermissiondescri
ptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, o
ptionalfeatures: o
ptfeaturelist }; xrpermissiondescri
ptor.mode = xrsessionmode; xrmode = xrpermissiondescri
ptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
...no specific features are specified during this query; see requiredfeatures and o
ptionalfeatures for more information on specifying features during a webxr permission check.
... let xrpermissiondesc = { name: "xr", mode: "immersive-vr" }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prom
pt": prom
ptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescri
ptor.mode' in that specification.
Accept-Patch - HTTP
the acce
pt-patch response http header advertises which media-type the server is able to understand.
... acce
pt-patch in response to any method means that patch is allowed on the resource identified by the request-uri.
... two common cases lead to this: a server receiving a patch request with an unsupported media type could reply with 415 unsupported media type and an acce
pt-patch header referencing one or more supported media types.
... header type response header forbidden header name yes syntax acce
pt-patch: application/example, text/example acce
pt-patch: text/example;charset=utf-8 acce
pt-patch: application/merge-patch+json directives none examples acce
pt-patch: application/example, text/example acce
pt-patch: text/example;charset=utf-8 acce
pt-patch: application/merge-patch+json specifications specification title rfc 5789, section 3.1: acce
pt-patch http patch ...
Accept-Ranges - HTTP
the acce
pt-ranges response http header is a marker used by the server to advertise its support of partial requests.
... in presence of an acce
pt-ranges header, the browser may try to resume an interru
pted download, rather than to start it from the start again.
... header type response header forbidden header name no syntax acce
pt-ranges: <range-unit> acce
pt-ranges: none directives <range-unit> defines the range unit the server supports.
... examples acce
pt-ranges: bytes specifications specification title rfc 7233, section 2.3: acce
pt-ranges hypertext transfer protocol (http/1.1): range requests ...
Feature-Policy: display-capture - HTTP
the http feature-policy header display-ca
pture directive controls whether or not the document is permitted to use screen ca
pture api, i.e.,getdisplaymedia() to ca
pture the screen's contents.
... if display-ca
pture is disabled in a document, the document will not be able to initiate screen ca
pture via getdisplaymedia().
... syntax feature-policy: display-ca
pture <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin.
... screen ca
pturethe definition of 'display-ca
pture' in that specification.
Feature-Policy: encrypted-media - HTTP
the http feature-policy header encry
pted-media directive controls whether the current document is allowed to use the encry
pted media extensions api (eme).
... when this policy is enabled, the promise returned by navigator.requestmediakeysystemaccess() will reject with a domexce
ption.
... syntax feature-policy: encry
pted-media <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin.
... encry
pted media extensionsthe definition of 'feature policy integration' in that specification.
406 Not Acceptable - HTTP
the hypertext transfer protocol (http) 406 not acce
ptable client error response code indicates that the server cannot produce a response matching the list of acce
ptable values defined in the request's proactive content negotiation headers, and that the server is unwilling to supply a default representation.
... proactive content negotiation headers include: acce
pt acce
pt-charset acce
pt-encoding acce
pt-language in practice, this error is very rarely used.
... instead of responding using this error code, which would be cry
ptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user.
... status 406 not acce
ptable specifications specification title rfc 7231, section 6.5.6: 406 not acce
ptable hypertext transfer protocol (http/1.1): semantics and content ...
Character classes - JavaScript
has one of the following meanings: matches any single character exce
pt line terminators: \n, \r, \u2028 or \u2029.
...do not end matching in the middle of a word) console.table(randomdata.match(regexpfourdigits)); // ['8787', '3512', '8735'] looking for a word (from the latin alphabet) starting with a var aliceexcer
pt = "i’m sure i’m not ada,’ she said, ‘for her hair goes in such long ringlets, and mine doesn’t go in ringlets at all."; var regexpwordstartingwitha = /\b[aa]\w+/g; // \b indicates a boundary (i.e.
... do not start matching in the middle of a word) // [aa] indicates the letter a or a // \w+ indicates any character *from the latin alphabet*, multiple times console.table(aliceexcer
pt.match(regexpwordstartingwitha)); // ['ada', 'and', 'at', 'all'] looking for a word (from unicode characters) instead of the latin alphabet, we can use a range of unicode characters to identify a word (thus being able to deal with text in other languages like russian or arabic).
... specifications specification ecmascri
pt latest draft (ecma-262)the definition of 'regexp: character classes' in that specification.
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
the javascri
pt warning "08 (or 09) is not a legal ecma-262 octal constant" occurs when 08 or 09 number literals are used.
...javascri
pt execution won't be halted.
...because this is not the case with 08 and 09, javascri
pt warns about it.
...with ecmascri
pt 6 and later, the syntax uses a leading zero followed by a lowercase or uppercase latin letter "o" (0o or 0o).
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
the javascri
pt exce
ption "property is non-configurable and can't be deleted" occurs when it was attem
pted to delete a property, but that property is non-configurable.
... it was attem
pted to delete a property, but that property is non-configurable.
... examples attem
pting to delete non-configurable properties non-configurable properties are not super common, but they can be created using object.defineproperty() or object.freeze().
... 'use strict'; var obj = object.freeze({name: 'elsa', score: 157}); delete obj.score; // typeerror 'use strict'; var obj = {}; object.defineproperty(obj, 'foo', {value: 2, configurable: false}); delete obj.foo; // typeerror 'use strict'; var frozenarray = object.freeze([0, 1, 2]); frozenarray.pop(); // typeerror there are also a few non-configurable properties built into javascri
pt.
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
the javascri
pt strict mode-only exce
ption "applying the 'delete' operator to an unqualified name is deprecated" occurs when variables are attem
pted to be deleted using the delete operator.
... normal variables in javascri
pt can't be deleted using the delete operator.
... in strict mode, an attem
pt to delete a variable will throw an error and is not allowed.
... examples freeing the contents of a variable attem
pting to delete a plain variable, doesn't work in javascri
pt and it throws an error in strict mode: 'use strict'; var x; // ...
Warning: expression closures are deprecated - JavaScript
the javascri
pt warning "expression closures are deprecated" occurs when the non-standard expression closure syntax (shorthand function syntax) is used.
...javascri
pt execution won't be halted.
...this syntax will be removed entirely in bug 1083458 and scri
pts using it will throw a syntaxerror then.
... var x = function() 1; var obj = { count: function() 1 }; standard syntax to convert the non-standard expression closures syntax to standard ecmascri
pt syntax, you can add curly braces and return statements.
TypeError: invalid assignment to const "x" - JavaScript
the javascri
pt exce
ption "invalid assignment to const" occurs when it was attem
pted to alter a constant value.
... javascri
pt const declarations can't be re-assigned or redeclared.
...in javascri
pt, constants are declared using the const keyword.
... columns = 120; // typeerror: invalid assignment to const `columns' fixing the error there are multiple o
ptions to fix this error.
SyntaxError: missing ) after argument list - JavaScript
the javascri
pt exce
ption "missing ) after argument list" occurs when there is an error with how a function is called.
... examples because there is no "+" operator to concatenate the string, javascri
pt expects the argument for the log function to be just "pi: ".
... console.log('pi: ' math.pi); // syntaxerror: missing ) after argument list you can correct the log call by adding the "+" operator: console.log('pi: ' + math.pi); // "pi: 3.141592653589793" unterminated strings console.log('"java" + "scri
pt" = \"' + 'java' + 'scri
pt\"); // syntaxerror: missing ) after argument list here javascri
pt thinks that you meant to have ); inside the string and ignores it, and it ends up not knowing that you meant the ); to end the function console.log.
... to fix this, we could put a' after the "scri
pt" string: console.log('"java" + "scri
pt" = \"' + 'java' + 'scri
pt\"'); // '"java" + "scri
pt" = "javascri
pt"' ...
TypeError: "x" is not a non-null object - JavaScript
the javascri
pt exce
ption "is not a non-null object" occurs when an object is expected somewhere and wasn't provided.
... message typeerror: invalid descri
ptor for property {x} (edge) typeerror: "x" is not a non-null object (firefox) typeerror: property descri
ption must be an object: "x" (chrome) typeerror: invalid value used in weak set (chrome) error type typeerror what went wrong?
... examples property descri
ptor expected when methods like object.create() or object.defineproperty() and object.defineproperties() are used, the o
ptional descri
ptor parameter expects a property descri
ptor object.
... providing no object (like just a number), will throw an error: object.defineproperty({}, 'key', 1); // typeerror: 1 is not a non-null object object.defineproperty({}, 'key', null); // typeerror: null is not a non-null object a valid property descri
ptor object might look like this: object.defineproperty({}, 'key', { value: 'foo', writable: false }); weakmap and weakset objects require object keys weakmap and weakset objects store object keys.
TypeError: "x" is not a constructor - JavaScript
the javascri
pt exce
ption "is not a constructor" occurs when there was an attem
pt to use an object or a variable as a constructor, but that object or variable is not a constructor.
... there was an attem
pt to use an object or a variable as a constructor, but that object or variable is not a constructor.
...the following javascri
pt standard built-in objects are not a constructor: math, json, symbol, reflect, intl, atomics.
... this is not legal (the promise constructor is not being called correctly) and will throw a typeerror: this is not a constructor exce
ption: return new promise.resolve(true); instead, use the promise.resolve() or promise.reject() static methods: // this is legal, but unnecessarily long: return new promise((resolve, reject) => { resolve(true); }) // instead, return the static method: return promise.resolve(true); return promise.reject(false); ...
Rest parameters - JavaScript
} descri
ption a function's last parameter can be prefixed with ...
... which will cause all remaining (user supplied) arguments to be placed within a "standard" javascri
pt array.
... // using the same function definition from example above myfun("one", "two", "three") // a, one // b, two // manymoreargs, [three] below, the third argument isn't provided, but manymoreargs is still an array (albeit an em
pty one).
... function sortarguments() { let args = array.from(arguments) let sortedargs = args.sort() return sortedargs } console.log(sortarguments(5, 3, 7, 1)) // 1, 3, 5, 7 specifications specification ecmascri
pt (ecma-262)the definition of 'function definitions' in that specification.
Array.prototype[@@unscopables] - JavaScript
the @@unscopable symbol property contains property names that were not included in the ecmascri
pt standard prior to the es2015 version.
... descri
ption the default array properties that are excluded from with bindings are: copywithin() entries() fill() find() findindex() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects.
...however, in ecmascri
pt 2015 and later, the array.prototype.keys() method was introduced.
... var keys = []; with (array.prototype) { keys.push('something'); } object.keys(array.prototype[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "findindex", // "includes", "keys", "values"] specifications specification ecmascri
pt (ecma-262)the definition of 'array.prototype[@@unscopables]' in that specification.
Array.prototype.copyWithin() - JavaScript
start o
ptional zero-based index at which to start copying elements from.
... end o
ptional zero-based index at which to end copying elements from.
... descri
ption the copywithin works like c and c++'s memmove, and is a high-performance method to shift the data of an array.
...l({length: 5, 3: 1}, 0, 3) // {0: 1, 3: 1, length: 5} // es2015 typed arrays are subclasses of array var i32a = new int32array([1, 2, 3, 4, 5]) i32a.copywithin(0, 2) // int32array [3, 4, 5, 4, 5] // on platforms that are not yet es2015 compliant: [].copywithin.call(new int32array([1, 2, 3, 4, 5]), 0, 3, 4); // int32array [4, 2, 3, 4, 5] specifications specification ecmascri
pt (ecma-262)the definition of 'array.prototype.copywithin' in that specification.
Array.of() - JavaScript
the difference between array.of() and the array constructor is in the handling of integer arguments: array.of(7) creates an array with a single element, 7, whereas array(7) creates an em
pty array with a length property of 7 (note: this implies an array of 7 em
pty slots, not slots with actual undefined values).
... array.of(7); // [7] array.of(1, 2, 3); // [1, 2, 3] array(7); // array of 7 em
pty slots array(1, 2, 3); // [1, 2, 3] syntax array.of(element0[, element1[, ...[, elementn]]]) parameters elementn elements used to create the array.
... descri
ption this function is part of the ecmascri
pt 2015 standard.
...y.of) { array.of = function() { return array.prototype.slice.call(arguments); // or let vals = []; for(let prop in arguments){ vals.push(arguments[prop]); } return vals; } } examples using array.of array.of(1); // [1] array.of(1, 2, 3); // [1, 2, 3] array.of(undefined); // [undefined] specifications specification ecmascri
pt (ecma-262)the definition of 'array.of' in that specification.
Array.prototype.pop() - JavaScript
syntax arrname.pop() return value the removed element from the array; undefined if the array is em
pty.
... descri
ption the pop method removes the last element from an array and returns that value to the caller.
... if you call pop() on an em
pty array, it returns undefined.
... var myfish = {0:'angel', 1:'clown', 2:'mandarin', 3:'sturgeon', length: 4}; var popped = array.prototype.pop.call(myfish); //same syntax for using apply( ) console.log(myfish); // {0:'angel', 1:'clown', 2:'mandarin', length: 3} console.log(popped); // 'sturgeon' specifications specification ecmascri
pt (ecma-262)the definition of 'array.prototype.pop' in that specification.
Array.prototype.push() - JavaScript
descri
ption the push method appends values to an array.
...instead, we store the collection on the object itself and use call on array.prototype.push to trick the method into thinking we are dealing with an array—and it just works, thanks to the way javascri
pt allows us to establish the execution context in any way we want.
... [].push.call(this, elem) } } // let's add some em
pty objects just to illustrate.
... specifications specification ecmascri
pt (ecma-262)the definition of 'array.prototype.push' in that specification.
Array.prototype.sort() - JavaScript
syntax arr.sort([comparefunction]) parameters comparefunction o
ptional specifies a function that defines the sort order.
... descri
ption 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.
...note: the ecmascri
pt standard does not guarantee this behavior, thus, not all browsers (e.g.
... specifications specification ecmascri
pt (ecma-262)the definition of 'array.prototype.sort' in that specification.
Array.prototype.toString() - JavaScript
descri
ption the array object overrides the tostring method of object.
... javascri
pt calls the tostring method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation.
... ecmascri
pt 5 semantics starting in javascri
pt 1.8.5 (firefox 4), and consistent with ecmascri
pt 5th edition semantics, the tostring() method is generic and can be used with any object.
... examples using tostring const array1 = [1, 2, 'a', '1a']; console.log(array1.tostring()); // expected output: "1,2,a,1a" specifications specification ecmascri
pt (ecma-262)the definition of 'array.prototype.tostring' in that specification.
Boolean - JavaScript
descri
ption the value passed as the first parameter is converted to a boolean value, if necessary.
... if the value is omitted or is 0, -0, null, false, nan, undefined, or the em
pty string (""), the object has an initial value of false.
... all other values, including any object, an em
pty array ([]), or the string "false", create an object with an initial value of true.
... examples creating boolean objects with an initial value of false var bnoparam = new boolean(); var bzero = new boolean(0); var bnull = new boolean(null); var bem
ptystring = new boolean(''); var bfalse = new boolean(false); creating boolean objects with an initial value of true var btrue = new boolean(true); var btruestring = new boolean('true'); var bfalsestring = new boolean('false'); var bsulin = new boolean('su lin'); var barrayproto = new boolean([]); var bobjproto = new boolean({}); specifications specification ecmascri
pt (e...
DataView - JavaScript
descri
ption endianness multi-byte number formats are represented in memory differently depending on machine architecture — see endianness for an explanation.
... return new int16array(buffer)[0] === 256; })(); console.log(littleendian); // true or false 64-bit integer values because javascri
pt does not currently include standard support for 64-bit integer values, dataview does not offer native 64-bit operations.
...further, although native bigints are much faster than user-land library equivalents, bigints will always be much slower than 32-bit integers in javascri
pt due to the nature of their variable size.
... examples using dataview var buffer = new arraybuffer(16); var view = new dataview(buffer, 0); view.setint16(1, 42); view.getint16(1); // 42 specifications specification ecmascri
pt (ecma-262)the definition of 'dataview' in that specification.
Date.prototype[@@toPrimitive] - JavaScript
descri
ption the [@@toprimitive]() method of the date object returns a primitive value, that is either of type number or of type string.
... javascri
pt calls the [@@toprimitive]() method to convert an object to a primitive value.
... you rarely need to invoke the [@@toprimitive]() method yourself; javascri
pt automatically invokes it when encountering an object where a primitive value is expected.
...20 14:05:17 gmt+0100 (british summer time)" testdate[symbol.toprimitive]('string'); // returns "date fri may 29 2020 14:05:17 gmt+0100 (british summer time)" testdate[symbol.toprimitive]('number'); // returns "1590757517834" testdate[symbol.toprimitive]('default'); // returns "date fri may 29 2020 14:05:17 gmt+0100 (british summer time)" specifications specification ecmascri
pt (ecma-262)the definition of 'date.prototype.@@toprimitive' in that specification.
Date.prototype.setUTCMonth() - JavaScript
dayvalue o
ptional.
... descri
ption if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used.
... if a parameter you specify is outside of the expected range, setutcmonth() attem
pts to update the date information in the date object accordingly.
... examples using setutcmonth() var thebigday = new date(); thebigday.setutcmonth(11); specifications specification ecmascri
pt (ecma-262)the definition of 'date.prototype.setutcmonth' in that specification.
Date.prototype.setUTCSeconds() - JavaScript
msvalue o
ptional.
... descri
ption if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used.
... if a parameter you specify is outside of the expected range, setutcseconds() attem
pts to update the date information in the date object accordingly.
... examples using setutcseconds() var thebigday = new date(); thebigday.setutcseconds(20); specifications specification ecmascri
pt (ecma-262)the definition of 'date.prototype.setutcseconds' in that specification.
Number.prototype.toPrecision() - JavaScript
syntax numobj.toprecision([precision]) parameters precision o
ptional an integer specifying the number of significant digits.
...see the discussion of rounding in the descri
ption of the number.prototype.tofixed() method, which also applies to toprecision().
... exce
ptions rangeerror if precision is not between 1 and 100 (inclusive), a rangeerror is thrown.
...g(numobj.toprecision()) // logs '0.000123' console.log(numobj.toprecision(5)) // logs '0.00012300' console.log(numobj.toprecision(2)) // logs '0.00012' console.log(numobj.toprecision(1)) // logs '0.0001' // note that exponential notation might be returned in some circumstances console.log((1234.5).toprecision(2)) // logs '1.2e+3' specifications specification ecmascri
pt (ecma-262)the definition of 'number.prototype.toprecision' in that specification.
Object.prototype.__lookupGetter__() - JavaScript
descri
ption if a getter has been defined for an object's property, it's not possible to reference the getter function through that property, because that property refers to the return value of that function.
... it is now possible to do this in a standardized way using object.getownpropertydescri
ptor() and object.getprototypeof().
...'foo' : 'bar'; }) // standard-compliant way object.getownpropertydescri
ptor(obj, "foo").get; // (function() { return math.random() > 0.5 ?
... 'foo' : 'bar'; }) specifications specification ecmascri
pt (ecma-262)the definition of 'object.prototype.__lookupgetter__()' in that specification.
Object.entries() - JavaScript
descri
ption object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object.
...bj)); // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ] // getfoo is property which isn't enumerable const myobj = object.create({}, { getfoo: { value() { return this.foo; } } }); myobj.foo = 'bar'; console.log(object.entries(myobj)); // [ ['foo', 'bar'] ] // non-object argument will be coerced to an object console.log(object.entries('foo')); // [ ['0', 'f'], ['1', 'o'], ['2', 'o'] ] // returns an em
pty array for any primitive type, since primitives have no own properties console.log(object.entries(100)); // [ ] // iterate through key-value gracefully const obj = { a: 5, b: 7, c: 9 }; for (const [key, value] of object.entries(obj)) { console.log(`${key} ${value}`); // "a 5", "b 7", "c 9" } // or, using array extras object.entries(obj).foreach(([key, value]) => { console.log(`${key} ${valu...
...e}`); // "a 5", "b 7", "c 9" }); converting an object to a map the new map() constructor acce
pts an iterable of entries.
... const obj = { foo: 'bar', baz: 42 }; object.entries(obj).foreach(([key, value]) => console.log(`${key}: ${value}`)); // "foo: bar", "baz: 42" specifications specification ecmascri
pt (ecma-262)the definition of 'object.entries' in that specification.
Object.prototype.hasOwnProperty() - JavaScript
descri
ption all descendents of object inherit the hasownproperty method.
... o = new object(); o.propone = null; o.hasownproperty('propone'); // returns true o.pro
ptwo = undefined; o.hasownproperty('pro
ptwo'); // returns true examples using hasownproperty to test for a property's existence the following example determines whether the o object contains a property named prop: o = new object(); o.hasownproperty('prop'); // returns false o.prop = 'exists'; o.hasownproperty('prop'); // returns true direct vs.
...value: ' + buz[name]); } else { console.log(name); // tostring or something else } } using hasownproperty as a property name javascri
pt 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.hasownproperty('bar'); // always returns false // use another object's hasownproperty //...
... specifications specification ecmascri
pt (ecma-262)the definition of 'object.prototype.hasownproperty' in that specification.
Object.isExtensible() - JavaScript
descri
ption objects are extensible by default: they can have new properties added to them, and (in engines that support __proto__) their __proto__ property can be modified.
...var em
pty = {}; object.isextensible(em
pty); // === true // ...but that can be changed.
... object.preventextensions(em
pty); object.isextensible(em
pty); // === false // sealed objects are by definition non-extensible.
... object.isextensible(1); // typeerror: 1 is not an object (es5 code) object.isextensible(1); // false (es2015 code) specifications specification ecmascri
pt (ecma-262)the definition of 'object.isextensible' in that specification.
Object.isSealed() - JavaScript
descri
ption returns true if the object is sealed, otherwise false.
...var em
pty = {}; object.issealed(em
pty); // === false // if you make an em
pty object non-extensible, // it is vacuously sealed.
... object.preventextensions(em
pty); object.issealed(em
pty); // === true // the same is not true of a non-em
pty object, // unless its properties are all non-configurable.
... object.issealed(1); // typeerror: 1 is not an object (es5 code) object.issealed(1); // true (es2015 code) specifications specification ecmascri
pt (ecma-262)the definition of 'object.issealed' in that specification.
Object.keys() - JavaScript
descri
ption 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/javascri
pt/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(o...
... for a simple browser polyfill, see javascri
pt - object.keys browser compatibility.
... // in es5 object.keys('foo'); // typeerror: "foo" is not an object // in es2015+ object.keys('foo'); // ["0", "1", "2"] specifications specification ecmascri
pt (ecma-262)the definition of 'object.keys' in that specification.
Object.setPrototypeOf() - JavaScript
warning: changing the [[prototype]] of an object is, by the nature of how modern javascri
pt engines o
ptimize property accesses, currently a very slow operation in every browser and javascri
pt engine.
... descri
ption throws a typeerror exce
ption if the object whose [[prototype]] is to be modified is non-extensible according to object.isextensible().
... object.setprototypeof() is in the ecmascri
pt 2015 specification.
...n obj) { object.defineproperty(this, key, { value: obj[key], }); } }; fn.prototype = proto; return new fn(); } } } examples using object.setprototypeof var dict = object.setprototypeof({}, null); specifications specification ecmascri
pt (ecma-262)the definition of 'object.setprototypeof' in that specification.
Promise.any() - JavaScript
return value an already resolved promise if the iterable passed is em
pty.
...this returned promise is then resolved/rejected asynchronously (as soon as the stack is em
pty) when any of the promises in the given iterable resolve, or if all the promises have rejected.
... descri
ption this method is useful for returning the first promise that fulfils.
... if an em
pty iterable is passed, then this method returns (synchronously) an already resolved promise.
Proxy() constructor - JavaScript
descri
ption use the proxy() constructor to create a new proxy object.
... an em
pty handler will create a proxy that behaves, in almost all respects, exactly like the target.
... handler.getownpropertydescri
ptor() a trap for object.getownpropertydescri
ptor.
..."original value" }; const handler = { get: function(target, prop, receiver) { if (prop === "proxied") { return "replaced value"; } return reflect.get(...arguments); } }; const proxy = new proxy(target, handler); console.log(proxy.notproxied); // "original value" console.log(proxy.proxied); // "replaced value" specifications specification ecmascri
pt (ecma-262)the definition of 'proxy constructor' in that specification.
Reflect.get() - JavaScript
receiver o
ptional the value of this provided for the call to target if a getter is encountered.
... exce
ptions a typeerror, if target is not an object.
... descri
ption the reflect.get method allows you to get a property on an object.
...t x = {p: 1}; let obj = new proxy(x, { get(t, k, r) { return k + 'bar' } }) reflect.get(obj, 'foo') // "foobar" //proxy with get handler and receiver let x = {p: 1, foo: 2}; let y = {foo: 3}; let obj = new proxy(x, { get(t, prop, receiver) { return receiver[prop] + 'bar' } }) reflect.get(obj, 'foo', y) // "3bar" specifications specification ecmascri
pt (ecma-262)the definition of 'reflect.get' in that specification.
Reflect.set() - JavaScript
receiver o
ptional the value of this provided for the call to target if a setter is encountered.
... exce
ptions a typeerror, if target is not an object.
... descri
ption the reflect.set method allows you to set a property on an object.
...let obj = {} reflect.set(obj) // true reflect.getownpropertydescri
ptor(obj, 'undefined') // { value: undefined, writable: true, enumerable: true, configurable: true } specifications specification ecmascri
pt (ecma-262)the definition of 'reflect.set' in that specification.
Reflect.setPrototypeOf() - JavaScript
the static reflect.setprototypeof() method is the same method as object.setprototypeof(), exce
pt for its return type.
... exce
ptions a typeerror, if target is not an object or if prototype is neither an object nor null.
... descri
ption the reflect.setprototypeof method changes the prototype (i.e.
...let target = {} let proto = object.create(target) reflect.setprototypeof(target, proto) // false specifications specification ecmascri
pt (ecma-262)the definition of 'reflect.setprototypeof' in that specification.
RegExp.prototype[@@match]() - JavaScript
return value an array containing the entire match result and any parentheses-ca
ptured matched results, or null if there were no matches.
... descri
ption this method is called internally in string.prototype.match().
... examples direct call this method can be used in almost the same way as string.prototype.match(), exce
pt the different this and the different arguments order.
...console.log(result.group(1)); // 2016 console.log(result.group(2)); // 01 console.log(result.group(3)); // 02 specifications specification ecmascri
pt (ecma-262)the definition of 'regexp.prototype[@@match]' in that specification.
RegExp.prototype[@@split]() - JavaScript
limit o
ptional integer specifying a limit on the number of splits to be found.
... descri
ption this method is called internally in string.prototype.split() if its separator argument is an object that has a @@split method, such as a regexp.
... examples direct call this method can be used in almost the same way as string.prototype.split(), exce
pt the different this and the different order of arguments.
...console.log(result); // ["(2016)", "(01)", "(02)"] specifications specification ecmascri
pt (ecma-262)the definition of 'regexp.prototype[@@split]' in that specification.
TypedArray.prototype.copyWithin() - JavaScript
the end argument is o
ptional and defaults to the length of the array.
... end o
ptional o
ptional.
... descri
ption see array.prototype.copywithin for more details.
... examples using copywithin var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] uint8.copywithin(3,0,3); console.log(uint8); // uint8array [ 1, 2, 3, 1, 2, 3, 0, 0 ] specifications specification ecmascri
pt (ecma-262)the definition of 'typedarray.prototype.copywithin' in that specification.
TypedArray.prototype.some() - JavaScript
thisarg o
ptional.
... descri
ption the some method executes the callback function once for each element present in the typed array until it finds one where callback returns a true value.
... // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some if (!uint8array.prototype.some) { object.defineproperty(uint8array.prototype, 'some', { value: array.prototype.some }); } if you need to support truly obsolete javascri
pt engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable.
... new uint8array([2, 5, 8, 1, 4]).some(elem => elem > 10); // false new uint8array([12, 5, 8, 1, 4]).some(elem => elem > 10); // true specifications specification ecmascri
pt (ecma-262)the definition of 'typedarray.prototype.some' in that specification.
TypedArray.prototype.subarray() - JavaScript
syntax typedarray.subarray([begin [,end]]) parameters begin o
ptional element to begin at.
... end o
ptional element to end at.
... descri
ption the range specified by begin and end is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero.
... examples using the subarray method var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] var sub = uint8.subarray(0,4); console.log(sub); // uint8array [ 1, 2, 3, 0 ] specifications specification ecmascri
pt (ecma-262)the definition of 'typedarray.prototype.subarray' in that specification.
Uint16Array() constructor - JavaScript
buffer, byteoffset, length when called with a buffer, and o
ptionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... descri
ption the uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order.
... starting with ecmascri
pt 2015, uint16array constructors require to be constructed with a new operator.
...from another typedarray var x = new uint16array([21, 31]); var y = new uint16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint16 = new uint16array(iterable); // uint16array[1, 2, 3] specifications specification ecmascri
pt (ecma-262)the definition of 'typedarray constructors' in that specification.
WebAssembly.Table.prototype.set() - JavaScript
this must be an exported webassembly function, a javascri
pt wrapper for an underlying wasm function.
... exce
ptions if index is greater than or equal to table.prototype.length, a rangeerror is thrown.
... this example shows that we're creating and accessing the table from javascri
pt, but the same table is visible and callable inside the wasm instance too.
... specifications specification webassembly javascri
pt interfacethe definition of 'set()' in that specification.
WebAssembly.Table - JavaScript
the webassembly.table() object is a javascri
pt wrapper object — an array-like structure representing a webassembly table, which stores function references.
... a table created by javascri
pt or in webassembly code will be accessible and mutable from both javascri
pt and webassembly.
... this example shows that we're creating and accessing the table from javascri
pt, but the same table is visible and callable inside the wasm instance too.
... specifications specification webassembly javascri
pt interfacethe definition of 'table' in that specification.
WebAssembly.instantiateStreaming() - JavaScript
this is the most efficient, o
ptimized way to load wasm code.
... importobject o
ptional an object containing the values to be imported into the newly-created instance, such as functions or webassembly.memory objects.
... exce
ptions if either of the parameters are not of the correct type or structure, a typeerror is thrown.
...because the instantiatestreaming() function acce
pts a promise for a response object, you can directly pass it a windoworworkerglobalscope.fetch() call, and it will pass the response into the function when it fulfills.
decodeURIComponent() - JavaScript
exce
ptions throws an urierror ("malformed uri sequence") exce
ption when used wrongly.
... descri
ption replaces each escape sequence in the encoded uri component with the character that it represents.
... examples decoding a cyrillic url component decodeuricomponent('javascri
pt_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascri
pt_шеллы" catching errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence decoding query parameters from a url decodeuricomponent cannot be used directly to parse query parameters from a url.
... function decodequeryparam(p) { return decodeuricomponent(p.replace(/\+/g, ' ')); } decodequeryparam('search+query%20%28correct%29'); // 'search query (correct)' specifications specification ecmascri
pt (ecma-262)the definition of 'decodeuricomponent' in that specification.
encodeURI() - JavaScript
descri
ption the encodeuri() function does not encode characters that have special meaning (reserved characters) for a uri.
...(see rfc2396) encodeuri() escapes all characters exce
pt: not escaped: a-z a-z 0-9 ; , / ?
... encoding a lone high surrogate throws an urierror will be thrown if one attem
pts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuri('\ud800\udfff')); // lone high surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\ud800')); // lone low surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\udfff')); encoding for ipv6 if one wishes to follow the more recent rfc3986 for ...
...urls, which makes square brackets reserved (for ipv6) and thus not encoded when forming something which could be part of a url (such as a host), the following code snippet may help: function fixedencodeuri(str) { return encodeuri(str).replace(/%5b/g, '[').replace(/%5d/g, ']'); } specifications specification ecmascri
pt (ecma-262)the definition of 'encodeuri' in that specification.
escape() - JavaScript
… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascri
pt code.
... descri
ption the escape function is a property of the global object.
... special characters are encoded with the exce
ption of: @*_+-./ the hexadecimal form for characters, whose code unit value is 0xff or less, is a two-digit escape sequence: %xx.
... examples using escape escape('abc123'); // "abc123" escape('äöü'); // "%e4%f6%fc" escape('ć'); // "%u0107" // special characters escape('@*_+-./'); // "@*_+-./" specifications specification ecmascri
pt (ecma-262)the definition of 'escape' in that specification.
Equality (==) - JavaScript
unlike the strict equality operator, it attem
pts to convert and compare operands that are of different types.
... syntax x == y descri
ption the equality operators (== and !=) use the abstract equality comparison algorithm to compare two operands.
... the most notable difference between this operator and the strict equality (===) operator is that the strict equality operator does not attem
pt type conversion.
...rue console.log(string2 == string3); // true console.log(string3 == string4); // false console.log(string4 == string4); // true comparing dates and strings const d = new date('december 17, 1995 03:24:00'); const s = d.tostring(); // for example: "sun dec 17 1995 03:24:00 gmt-0800 (pacific standard time)" console.log(d == s); //true specifications specification ecmascri
pt (ecma-262)the definition of 'equality operators' in that specification.
Inequality (!=) - JavaScript
unlike the strict inequality operator, it attem
pts to convert and compare operands that are of different types.
... syntax x != y descri
ption the inequality operator checks whether its operands are not equal.
... like the equality operator, the inequality operator will attem
pt to convert and compare operands of different types: 3 != "3"; // false to prevent this, and require that different types are considered to be different, use the strict inequality operator instead: 3 !== "3"; // true examples comparison with no type conversion 1 != 2; // true "hello" != "hola"; // true 1 != 1; // false "hello" != "hello"; // false comparison with type conversion "1" != 1; // false 1 != "1"; // false 0 != false; // false 0 != null; ...
... // false, look at logical not operator null != undefined; // false const number1 = new number(3); const number2 = new number(3); number1 != 3; // false number1 != number2; // true comparison of objects const object1 = {"key": "value"} const object2 = {"key": "value"}; object1 != object2 // true object2 != object2 // false specifications specification ecmascri
pt (ecma-262)the definition of 'equality operators' in that specification.
in operator - JavaScript
let mycar = {make: 'honda', model: 'accord', year: 1998} mycar.make = undefined 'make' in mycar // returns true let trees = new array('redwood', 'bay', 'cedar', 'oak', 'maple') trees[3] = undefined 3 in trees // returns true the in operator will return false for em
pty array slots.
... let em
pties = new array(3) em
pties[2] // returns undefined 2 in em
pties // returns false to avoid this, make sure a new array is always filled with non-em
pty values or not write to indexes past the end of array.
... let em
pties = new array(3).fill(undefined) 2 in em
pties // returns true inherited properties the in operator returns true for properties in the prototype chain.
... (if you want to check for only non-inherited properties, use object.prototype.hasownproperty() instead.) 'tostring' in {} // returns true specifications specification ecmascri
pt (ecma-262)the definition of 'relational operators' in that specification.
void operator - JavaScript
syntax void expression descri
ption this operator allows evaluating expressions that produce a value into places where an expression that evaluates to undefined is desired.
... javascri
pt uris when a browser follows a javascri
pt: uri, it evaluates the code in the uri and then replaces the contents of the page with the returned value, unless the returned value is undefined.
...for example: <a href="javascri
pt:void(0);"> click here to do nothing </a> <a href="javascri
pt:void(document.body.style.backgroundcolor='green');"> click here for green background </a> note: javascri
pt: pseudo protocol is discouraged over other alternatives, such as unobtrusive event handlers.
... specifications specification ecmascri
pt (ecma-262)the definition of 'the void operator' in that specification.
Expressions and operators - JavaScript
this cha
pter documents all the javascri
pt language operators, expressions and keywords.
... primary expressions basic keywords and general expressions in javascri
pt.
... binary bitwise operators bitwise operators treat their operands as a set of 32 bits (zeros and ones) and return standard javascri
pt numerical values.
... specifications specification ecmascri
pt (ecma-262)the definition of 'ecmascri
pt language: expressions' in that specification.
nsILoginManagerStorage
toolkit/components/passwordmgr/public/nsiloginmanagerstorage.idlscri
ptable this interface is implemented by modules that wish to provide storage mechanisms for the login manager.
...method overview void addlogin(in nsilogininfo alogin); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([o
ptional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); void getallencry
ptedlogins([o
ptional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); void getalllogins([o
ptional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in astring ahost); void init(); void i...
...aoutputfile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); attributes attribute type descri
ption uibusy boolean true when a master password prom
pt is being shown.
...And 18 more matches
nsINavHistoryService
toolkit/components/places/nsinavhistoryservice.idlscri
ptable this interface provides complex query functions, more fine-grained getters and setters.
... 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); obsolete since gecko 22.0 nsinavhistoryquery getnewquery(); nsinavhistoryqueryo
ptions getnewqueryo
ptions(); nsinavhistoryresult executequery(in nsinavhistoryquery aquery, in nsinavhistoryqueryo
ptions o
ptions); nsinavhistoryresult executequeries([array,size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryo
ptions o
ptions); void querystringtoqueries(in autf8string aquerystring, [array, size_is(aresultc...
...ount)] out nsinavhistoryquery aqueries, out unsigned long aresultcount, out nsinavhistoryqueryo
ptions o
ptions); autf8string queriestoquerystring([array, size_is(aquerycount)] in nsinavhistoryquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryo
ptions o
ptions); void addobserver(in nsinavhistoryobserver observer, in boolean ownsweak); void removeobserver(in nsinavhistoryobserver observer); void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports aclosure); void importhistory(in nsifile file); astring getcharsetforuri(in nsiuri auri); astring setcharsetforuri(in nsiuri auri, in astring acharset); attributes attribute type descri
ption hashistoryentries boolean tr...
...And 18 more matches
nsIPrincipal
caps/nsiprincipal.idlscri
ptable provides the interface to a principal, which represents a security context.
... void checkmayload(in nsiuri uri, in boolean report); void disablecapability(in string capability, inout void
ptr annotation); native code only!
... void enablecapability(in string capability, inout void
ptr annotation); native code only!
...And 18 more matches
Index
see an overview of thunderbird components for a general descri
ption of the thunderbird user interface and related programmatic interfaces.
...see an overview of thunderbird components for a general descri
ption of the thunderbird user interface and related programmatic interfaces.
...for example, invoking thunderbird's help | what's new menu o
ption opens a tab that displays web content.
...And 18 more matches
Plug-in Development Overview - Plugins
you'll find an overview of the plug-in api methods in this cha
pter, as well as separate cha
pters for all of the major functional areas of the plug-in api.
... also see making plug-ins scri
ptable for more information about making plug-ins accessible from the browser.
...also, the windows version information for the plug-in dll will be used to determines the mime types, file extensions, file open template, plug-in name, and descri
ption.
...And 18 more matches
Web Console remoting - Firefox Developer Tools
the client has the o
ption to start each listener when needed.
... "consoleapi", "networkactivity", "fileactivity" ] } the reply is: { "startedlisteners": [ "pageerror", "consoleapi", "networkactivity", "fileactivity" ], "nativeconsoleapi": true, "from": "conn0.console9" } the reply tells which listeners were started and it includes a flag nativeconsoleapi which tells if the window.console object was overridden by the scri
pts in the page or not.
... actor preferences to allow the web console to configure logging o
ptions while it is running, we have added the setpreferences packet: { "to": "conn0.console9", "type": "setpreferences", "preferences": { "networkmonitor.saverequestandresponsebodies": false } } reply: { "updated": [ "networkmonitor.saverequestandresponsebodies" ], "from": "conn0.console10" } for convenience you can use webconsoleclient.setpreferences(prefs, onresponse).
...And 18 more matches
FileSystemEntrySync - Web APIs
warning: this api was never acce
pted and never became standardized.
... basic conce
pts the filesystementrysync interface includes methods that you would expect for manipulating files and directories, but it also include a really handy method for getting a url of the entry: tourl().
... method overview metadata getmetadata () raises (fileexce
ption); filesystementrysync moveto (in directoryentrysync parent, o
ptional domstring newname) raises (fileexce
ption); filesystementrysync copyto(in directoryentrysync parent, o
ptional domstring newname) raises (fileexce
ption); domstring tourl(); void remove() raises (fileexce
ption); directoryentrysync getparent(); attributes attribute ...
...And 18 more matches
RTCPeerConnection.createOffer() - Web APIs
the sdp offer includes information about any mediastreamtracks already attached to the webrtc session, codec, and o
ptions supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection.
... the return value is a promise which, when the offer has been created, is resolved with a rtcsessiondescri
ption object containing the newly-created offer.
... syntax apromise = mypeerconnection.createoffer([o
ptions]); mypeerconnection.createoffer(successcallback, failurecallback, [o
ptions]) parameters o
ptions o
ptional an rtcoffero
ptions dictionary providing o
ptions requested for the offer.
...And 18 more matches
Live streaming web audio and video - Developer guides
live streamed media lacks a finite start and end time as rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often ada
ptive (see below).
... ada
ptive streaming one of the main priorities for live streaming is to keep the player synchronized with the stream: ada
ptive streaming is a technique for doing this in the case of low bandwidth.
...live streaming formats generally allow ada
ptive streaming by breaking streams into a series of small segments and making those segments available at different qualities and bit rates.
...And 18 more matches
CSP: connect-src - HTTP
the http content-security-policy (csp) connect-src directive restricts the urls which can be loaded using scri
pt interfaces.
... syntax one or more sources can be allowed for the connect-src policy: content-security-policy: connect-src <source>; content-security-policy: connect-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an o
ptional url scheme and/or port number.
... the site's address may include an o
ptional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source.
...And 18 more matches
CSP: style-src - HTTP
syntax one or more sources can be allowed for the style-src policy: content-security-policy: style-src <source>; content-security-policy: style-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an o
ptional url scheme and/or port number.
... the site's address may include an o
ptional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source.
... examples: http://*.example.com: matches all attem
pts to load from any subdomain of example.com using the http: url scheme.
...And 18 more matches
Server-side web frameworks - Learn web development
we then explain some of the criteria you can use for choosing a web framework, and then list some of your o
ptions.
...django can also pass information encoded in the structure of the url by defining "ca
pture patterns" in the url mapper (see the last code fragment in the section above).
...this allows developers to o
ptimize for the characteristics of different databases based on their usage.
...And 17 more matches
Introduction to cross browser testing - Learn web development
ting next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascri
pt languages.
... objective: to gain an understanding of the high-level conce
pts involved in cross browser testing.
... cross browser testing is the practice of making sure that the web sites and web apps you create work across an acce
ptable number of web browsers.
...And 17 more matches
Message manager overview
at the top level, there are two different sorts of message managers: frame message managers: these enable chrome process code to load a scri
pt into a browser frame (essentially, a single browser tab) in the content process.
... these scri
pts are called frame scri
pts, and as the name suggests, they are scoped to a specific browser frame.
...from firefox 38 onwards, they also enable code running in the parent process to load process scri
pts into the child process.
...And 17 more matches
FIPS Mode - an explanation
(note: mozilla does not distribute a "fips mode"-ready nss with firefox.) this page attem
pts to provide an informal explanation of what it is, who would use it, and why.
... some other governments have also ado
pted many of the fips regulations, so their applicability is somewhat wider than just the us government's personnel.
... one of the fips regulations, fips 140, governs the use of encry
ption and cry
ptographic services.
...And 17 more matches
JS::Compile
this article covers features introduced in spidermonkey 17 compile a scri
pt for execution.
... syntax // added in spidermonkey 45 bool js::compile(jscontext *cx, const js::readonlycompileo
ptions &o
ptions, js::sourcebufferholder &srcbuf, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, const js::readonlycompileo
ptions &o
ptions, const char *bytes, size_t length, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, const js::readonlycompileo
ptions &o
ptions, const char16_t *chars, size_t length, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, const js::readonlycompileo
ptions &o
ptions, file *file, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, const js::readonlycompileo
ptions &o
ptions, const char *filename, ...
... js::mutablehandlescri
pt scri
pt); // obsolete since jsapi 39 bool js::compile(jscontext *cx, js::handleobject obj, const js::readonlycompileo
ptions &o
ptions, js::sourcebufferholder &srcbuf, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, js::handleobject obj, const js::readonlycompileo
ptions &o
ptions, const char *bytes, size_t length, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, js::handleobject obj, const js::readonlycompileo
ptions &o
ptions, const char16_t *chars, size_t length, js::mutablehandlescri
pt scri
pt); bool js::compile(jscontext *cx, js::handleobject obj, const js::readonlycompileo
ptions &o
ptions, file *file, js::mutablehandlescri
pt scri
pt)...
...And 17 more matches
XPCOM array guide
introduction array types mozilla has many array classes because each array is o
ptimized for a particular usage pattern.
... the standard array classes are: nsiarray - a scri
ptable container for scri
ptable xpcom objects.
... nsimutablearray - a scri
ptable container for scri
ptable xpcom objects, which allows addition and removal of member objects.
...And 17 more matches
XPCShell Reference
the command line the command-line syntax for xpcshell is: xpcshell [-s] [-w] [-w] [-v version] [-f scri
ptfile] [scri
ptfile] [scri
ptarg...] -c this o
ption turns on the "compile-only" mode.
... (setting this o
ption disables the "interactive" mode) -f this o
ption specifies a scri
pt file to execute.
... xpcshell terminates upon scri
pt completion.
...And 17 more matches
Language bindings
the following bridging layers are currently available: components objectthe components object is the object through which xpconnect functionality is reflected into javascri
pt.
... the components object is actually a native instance of the nsixpccomponents interface which is reflected into javascri
pt as a top level object using xpconnect.components.classescomponents.classes is a read-only object whose properties are classes indexed by contractid.components.classesbyidcomponents.classesbyid is a read-only object whose properties are classes indexed by cid.components.constructorcreates a javascri
pt function which can be used to create or construct new instances of xpcom components.components.exce
ptioncomponents.exce
ption is a javascri
pt constructor to create nsixpcexce
ption objects.
... these exce
ption objects may be thrown when implementing xpcom interfaces in javascri
pt, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.components.idcomponents.id is a constructor that creates native objects that conform to the nsijsid interface.components.interfacescomponents.interfaces is a read-only object whose properties are interfaces indexed by their names.components.interfacesbyidcomponents.interfacesbyid is a read-only array of classes indexed by iid.components.issuccesscodedetermines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively.components.lastresultcomponents.managercomponents.manager is a convenience refl...
...And 17 more matches
nsICache
netwerk/cache/public/nsicache.idlscri
ptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports constants constant value descri
ption access_none 0 access granted - no descri
ptor is provided.
...access granted - you can read from this descri
ptor.
...And 17 more matches
nsIDOMMozNetworkStatsManager
dom/network/interfaces/nsidomnetworkstatsmanager.idlscri
ptable interface that provides access to network usage statistics.
...of the service as follows, for example: if ("moznetworkstats" in navigator) { /* networkstats is available */ } else { alert("i'm sorry, but networkstats services are not supported."); } method overview nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [o
ptional] in jsval o
ptions /* networkstatsgeto
ptions */); nsidomdomrequest addalarm(in nsisupports network, in long threshold, [o
ptional] in jsval o
ptions /* networkstatsalarmo
ptions */); nsidomdomrequest getallalarms([o
ptional] in nsisupports network); nsidomdomrequest removealarms([o
ptional] in long alarmid); ...
... nsidomdomrequest clearstats(in nsisupports network); nsidomdomrequest clearallstats(); nsidomdomrequest getavailablenetworks(); nsidomdomrequest getavailableservicetypes(); attributes attribute type descri
ption samplerate long minimum time in milliseconds between samples stored in the database.
...And 17 more matches
nsIURI
netwerk/base/public/nsiuri.idlscri
ptable this is an interface for an uniform resource identifier with internationalization support, offering attributes that allow setting and querying the basic components of a uri, and methods for performing basic operations on uris.
...baseuri); } components of a uri prepath path scheme userpass host port ref ftp :// username@password @ hostname : portnumber /pathname?query=value #ref method overview nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexce
ptref(in nsiuri other); autf8string resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type descri
ption asciihost acstring the uri host with an ascii compatible encoding.
... exce
ptions thrown ns_error_failure if host is not applicable to the uri scheme (e.g.
...And 17 more matches
UI Tour - Firefox Developer Tools
this article is a quick tour of the main sections of the javascri
pt debugger's user interface.
... vertically into three panels source list pane source pane the contents of the third pane depend on the current state of the debugger and may include the following sections: toolbar watch expressions breakpoints call stack scopes xhr breakpoints event listener breakpoints dom mutation breakpoints source list pane the source list pane lists all the javascri
pt source files loaded into the page, and enables you to select one to debug.
... there are several context menu o
ptions available for individual files and folders or groups; typically viewed by right-clicking on the item.
...And 17 more matches
Debugger-API - Firefox Developer Tools
the debugger interface mozilla’s javascri
pt engine, spidermonkey, provides a debugging interface named debugger which lets javascri
pt code observe and manipulate the execution of other javascri
pt code.
... both firefox’s built-in developer tools and the firebug add-on use debugger to implement their javascri
pt debuggers.
... debugger has three essential qualities: it is a source level interface: it operates in terms of the javascri
pt language, not machine language.
...And 17 more matches
CSSCounterStyleRule - Web APIs
csscounterstylerule.system is a domstring object that contains the serialization of the system descri
ptor defined for the associated rule.
... if the descri
ptor was not specified in the associated rule, the attribute returns an em
pty string.
... csscounterstylerule.symbols is a domstring object that contains the serialization of the symbols descri
ptor defined for the associated rule.
...And 17 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.autoplay a boolean that reflects the autoplay html attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interru
ption.
... note: automatically playing audio when the user doesn't expect or desire it is a poor user experience and should be avoided in most cases, though there are exce
ptions.
...mediakeys is a set of keys that an associated htmlmediaelement can use for decry
ption of media data during playback.
...And 17 more matches
Taking still photos with WebRTC - Web APIs
the html markup our html interface has two main operational sections: the stream and ca
pture panel and the presentation panel.
... the first panel on the left contains two components: a <video> element, which will receive the stream from webrtc, and a <button> the user clicks to ca
pture a video frame.
... <div class="camera"> <video id="video">video stream not available.</video> <button id="startbutton">take photo</button> </div> this is straightforward, and we'll see how it ties together when we get into the javascri
pt code.
...And 17 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
web video text tracks format (webvtt) is a format for displaying timed text tracks (such as subtitles or ca
ptions) using the <track> element.
... webvtt body the structure of a webvtt consists of the following components, some of them o
ptional, in this order: an o
ptional byte order mark (bom).
... an o
ptional text header to the right of webvtt.
...And 17 more matches
Web Authentication API - Web APIs
the web authentication api is an extension of the credential management api that enables strong authentication with public key cry
ptography, enabling passwordless authentication and/or secure second-factor authentication without sms texts.
... web authentication conce
pts and usage the web authentication api (also referred to as webauthn) uses asymmetric (public-key) cry
ptography instead of passwords or sms texts for registering, authenticating, and second-factor authentication with websites.
...similar to the other forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: navigator.credentials.create() - when used with the publickey o
ption, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account.
...And 17 more matches
Window - Web APIs
a global variable, window, representing the window in which the scri
pt is running, is exposed to javascri
pt code.
... the window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the conce
pt of a user interface window.
...many of these are documented in the javascri
pt reference and the dom reference.
...And 17 more matches
Web APIs
web apis are typically used with javascri
pt, although this doesn't always have to be the case.
... aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencry
pted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage ca
pture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media ca
pture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lo...
...ck apiproximity events push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage access apistreams ttouch eventsuurl apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb cry
pto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available.
...And 17 more matches
Accessibility documentation index - Accessibility
2 aria aria, accessibility, html accessible rich internet applications (aria) is a set of attributes that define ways to make web content and web applications (especially those developed with javascri
pt) more accessible to people with disabilities.
... 7 aria live regions aria, accessibility, arialive using javascri
pt, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction.
...the alert role is most useful for information that requires the user's immediate attention, for example: 16 using the alertdialog role aria, accessibility, codingscri
pting, html, needscontent, role(2), web development, agent, alertdialog, alerts, modal, user, useragent the alertdialog role is used to notify the user of urgent information that demands the user's immediate attention.
...And 17 more matches
HTML5 Parser - Developer guides
the html5 specification provides a more detailed descri
ption than previous html standards of how to turn a stream of bytes into a dom tree.
...in html5, document.write() can only be called from a scri
pt that is created by a <scri
pt> tag that does not have the async or defer attributes set.
... some contexts from which you should not call document.write() include: scri
pts created using document.createelement() event handlers settimeout() setinterval() <scri
pt async src="..."> <scri
pt defer src="..."> if you use the same mechanism for loading scri
pt libraries for all browsers including ie, then your code probably will not be affected by this change.
...And 17 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
another o
ption is to use separate date and time inputs, each of which is more widely supported than datetime-local.
... value a domstring representing a date and time (in the local time zone), or em
pty.
... you can also get and set the date value in javascri
pt using the htmlinputelement.value property, for example: var datecontrol = document.queryselector('input[type="datetime-local"]'); datecontrol.value = '2017-06-01t08:30'; there are several methods provided by javascri
pt's date that can be used to convert numeric date information into a properly-formatted string, or you can do it manually.
...And 17 more matches
<input type="tel"> - HTML: Hypertext Markup Language
despite the fact that inputs of type tel are functionally identical to standard text inputs, they do serve useful purposes; the most quickly apparent of these is that mobile browsers — especially on mobile phones — may o
pt to present a custom keypad o
ptimized for entering phone numbers.
... value a domstring representing a telephone number, or em
pty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, and size idl attributes list, selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an em
pty string ("").
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, telephone number inputs support the following attributes: attribute descri
ption list the id of the <datalist> element that contains the o
ptional pre-defined autocomplete o
ptions maxlength the maximum length, in utf-16 characters, to acce
pt as a valid input minlength the minimum length that is considered valid for the field's contents pattern a regular expression the entered value must match to pass constraint validation placeholder an example value to display inside the field when it has no value readonly a boolean attribute which, if present, indicates that the field's contents should no...
...And 17 more matches
CSP: base-uri - HTTP
licy: content-security-policy: base-uri <source>; content-security-policy: base-uri <source> <source>; sources while this directive uses the same arguments as other csp directives, some of them don’t make sense for `<base>`, such as the keywords 'unsafe-inline' and 'strict-dynamic' <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an o
ptional url scheme and/or port number.
... the site's address may include an o
ptional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source.
... examples: http://*.example.com: matches all attem
pts to load from any subdomain of example.com using the http: url scheme.
...And 17 more matches
CSP: img-src - HTTP
syntax one or more sources can be allowed for the img-src policy: content-security-policy: img-src <source>; content-security-policy: img-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an o
ptional url scheme and/or port number.
... the site's address may include an o
ptional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source.
... examples: http://*.example.com: matches all attem
pts to load from any subdomain of example.com using the http: url scheme.
...And 17 more matches
Compiling from Rust to WebAssembly - WebAssembly
to build a part of an application — using rust in an existing javascri
pt frontend.
...this package will contain only webassembly and javascri
pt code, and so the users of the package won't need rust installed.
... using wasm-bindgen to communicate between rust and javascri
pt the first part looks like this: use wasm_bindgen::prelude::*; libraries are called "crates" in rust.
...And 17 more matches
window/utils - Archive of obsolete content
usage private windows with this module your add-on will see private browser windows even if it has not explicitly o
pted into private browsing, so you need to take care not to store any user data derived from private browser windows.
... the exce
ption is the windows() function which returns an array of currently opened windows.
... private windows will not be included in this list if your add-on has not o
pted into private browsing.
...And 16 more matches
Setting up an extension development environment - Archive of obsolete content
if you are already running a firefox instance without -no-remote, and you attem
pt to start another instance with -p profilename (but without the -no-remote parameter), that second invocation would ignore its -p profilename parameter, instead opening a new window for the already running instance; sharing all its profile, sessions etc.
... development command flags as of gecko 2 (firefox 4), javascri
pt files are cached ("fastload").
... accessing thunderbird development preferences to change preference settings in thunderbird, open the "preferences" (unix) or "o
ptions" (windows) interface.
...And 16 more matches
Bindings - Archive of obsolete content
for example, a descri
ption could be added to a photo.
...<query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/descri
ption" object="?descri
ption"/> </query> it works similarly to the previous triple.
... the ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?descri
ption variable.
...And 16 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
attributes accesskey, alwaysopenpopup, autocompletesearch, autocompletesearchparam, autofill, autofillaftermatch, autofill, completedefaultindex, crop, disableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtoolti
ptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysope...
...you might use a scri
pt to change this attribute.
...you might use a scri
pt to change this attribute.
...And 16 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
the xbl interface javascri
pt and the dom provide access to get and set the properties of elements.
... properties can also be used to hold a value but may have code execute when an attem
pt is made to retrieve or modify the value.
...you can use the name from a scri
pt to get and set the value.
...And 16 more matches
Extentsions FAQ - Archive of obsolete content
return to mozilla-dev-extensions faq friday, se
ptember 22 - 29, 2006 (↑ top) how to write an xpcom component in c++ that can communicate to a com component?
... o
ption #3 install status buttons 1.0 <https://addons.mozilla.org/firefox/1272/> "lets you put toolbar buttons at either end of the status-bar.
... just drag them there from the toolbar customisation window, like you would when adding buttons to the toolbars." o
ption #4 install toolbar control <http://webdesigns.ms11.net/chromeditp.html> asking for help with getting an extension to process windows messages.
...And 16 more matches
What’s in the head? Metadata in HTML - Learn web development
this is the code we used: <p>japanese example: ご飯が熱い。</p> adding an author and descri
ption many <meta> elements include name and content attributes: name specifies the type of meta element it is; what type of information it contains.
... two such meta elements that are useful to include on your page define the author of the page, and provide a concise descri
ption of the page.
... let's look at an example: <meta name="author" content="chris mills"> <meta name="descri
ption" content="the mdn web docs learning area aims to provide complete beginners to the web with all they need to know to get started with developing web sites and applications."> specifying an author is beneficial in many ways: it is useful to be able to understand who wrote the page, if you have any questions about the content and you would like to contact them.
...And 16 more matches
Document - Web APIs
document.scri
ptsread only returns all the <scri
pt> elements on the document.
... event handlers document.onafterscri
ptexecute represents the event handling code for the afterscri
ptexecute event.
... document.onbeforescri
ptexecute represents the event handling code for the beforescri
ptexecute event.
...And 16 more matches
IDBObjectStoreSync - Web APIs
method overview any add (in any value, in o
ptional any key) raises (idbdatabaseexce
ption); idbindexsync createindex (in domstring name, in domstring storename, in domstring keypath, in o
ptional boolean unique); any get (in any key) raises (idbdatabaseexce
ption); idbcursorsync opencursor (in o
ptional idbkeyrange range, in o
ptional unsigned short direction) raises (idbdatabaseexce
ption); idbindexsync openin...
...dex (in domstring name) raises (idbdatabaseexce
ption); any put (in any value, in o
ptional any key) raises (idbdatabaseexce
ption); void remove (in any key) raises (idbdatabaseexce
ption); void removeindex (in domstring indexname) raises (idbdatabaseexce
ption); attributes attribute type descri
ption indexnames readonly domstringlist a list of the names of the indexes on this object store.
... constants mode constants constant value descri
ption read_only 1 modification operations are not allowed on this object store.
...And 16 more matches
Pointer events - Web APIs
pointer ca
pture pointer ca
pture allows the events for a pointer to be retargeted to a particular element other than the normal hit test result of the pointer's location.
... the following sub-sections contain short descri
ptions of each interface and property.
... below is a short descri
ption of each event type and its associated global event handler.
...And 16 more matches
Using Service Workers - Web APIs
there have been various attem
pts to create technologies to solve this problem, and some of the issues have been solved.
... the previous attem
pt — appcache — seemed to be a good idea because it allowed you to specify assets to cache really easily.
... however, it made many assum
ptions about what you were trying to do and then broke horribly when your app didn’t follow those assum
ptions exactly.
...And 16 more matches
WebGL best practices - Web APIs
every webgl error is reported in the web console as a javascri
pt warning with a descri
ptive message.
... after too many errors (32 in firefox), webgl stops generating descri
ptive messages, which really hinders debugging.
...when using webgl extensions, if possible, try to make them o
ptional by gracefully ada
pting to the case there they are not supported.
...And 16 more matches
Content Security Policy (CSP) - HTTP
content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross site scri
pting (xss) and data injection attacks.
... csp is designed to be fully backward compatible (exce
pt csp version 2 where there are some explicitly-mentioned inconsistencies in backward compatibility; more details here section 1.1).
...(sometimes you may see mentions of the x-content-security-policy header, but that's an older version and you don't need to specify it anymore.) alternatively, the <meta> element can be used to configure a policy, for example: <meta http-equiv="content-security-policy" content="default-src 'self'; img-src https://*; child-src 'none';"> threats mitigating cross site scri
pting a primary goal of csp is to mitigate and report xss attacks.
...And 16 more matches
CSP: child-src - HTTP
syntax one or more sources can be allowed for the child-src policy: content-security-policy: child-src <source>; content-security-policy: child-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an o
ptional url scheme and/or port number.
... the site's address may include an o
ptional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source.
... examples: http://*.example.com: matches all attem
pts to load from any subdomain of example.com using the http: url scheme.
...And 16 more matches
Rosetta - Archive of obsolete content
by default, the only possible standardized scri
pting language for html is ecmascri
pt.
... hence, if you are going to use another scri
pting language you might expect that most of the browsers will not recognize it.
...nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascri
pt allow us, in theory, to build full virtual machines in pure ecmascri
pt.
...And 15 more matches
The Joy of XUL - Archive of obsolete content
this guide is designed to introduce application developers and their managers to xul so they can not only understand why mozilla's platform is based on it, but how they might ado
pt it for their own use.
...applications written in xul are based on additional w3c standard technologies featuring html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascri
pt 1.5, including ecma-262 edition 3 (ecmascri
pt); xml 1.0.
... xul provides a clear separation among the client application definition and programmatic logic ("content" consisting of xul, xbl, and javascri
pt), presentation ("skin" consisting of css and images), and language-specific text labels ("locale" consisting of dtds and string bundles in .properties files).
...And 15 more matches
Document Object Model - Archive of obsolete content
in mozilla, the dom may be accessed and manipulated using javascri
pt.
... the various dom objects have functions which may be accessed in scri
pt, however, it is important to note that the dom is an api that is accessible by javascri
pt.
... javascri
pt itself is just a scri
pting language that can access these objects because mozilla provides these objects for use.
...And 15 more matches
tabbrowser - Archive of obsolete content
it is similar to the browser element, exce
pt that multiple documents can be displayed, each in a separate tab.
... attributes autocompleteenabled, autocompletepopup, autoscroll, contentcontextmenu, contenttooltip, handlectrlpageupdown, onbookmarkgroup, onnewtab, tabmodalprom
ptshowing properties browsers, cangoback, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowseratindex, getbrowse...
...rindexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalprom
ptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, gotoindex, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, removetab, removetabsprogresslistener,replacegroup, selecttabatindex, seticon, showonlythesetabs, stop, unpintab attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
...And 15 more matches
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
here's a sample .mozconfig for building xulrunner and mccoy: # o
ptions for client.mk.
... mk_add_o
ptions moz_build_projects="xulrunner mccoy" mk_add_o
ptions moz_objdir=@topsrcdir@/../mccoybase # global o
ptions ac_add_o
ptions --enable-debug ac_add_o
ptions --disable-o
ptimize # xulrunner o
ptions ac_add_app_o
ptions xulrunner --enable-application=xulrunner # mccoy o
ptions ac_add_app_o
ptions mccoy --enable-application=mccoy ac_add_app_o
ptions mccoy --with-libxul-sdk=../xulrunner/dist the first section tells mozilla what to build and where to put the resulting object files.
...the second section contains general o
ptions for your build.
...And 15 more matches
Archived Mozilla and build documentation - Archive of obsolete content
ant scri
pt to assemble an extension this ant scri
pt helps to package an extension archived spidermonkey docs this section contains old spidermonkey documentation.
...there is, however, no practical obstacle to the interface being implemented by any javascri
pt object associated with a group of dom nodes, even non-anonymous xul nodes.
...probe data can be collected with scri
pts written in d (no, not that one).
...And 15 more matches
Processing XML with E4X - Archive of obsolete content
first introduced in javascri
pt 1.6, e4x introduces a native xml object to the javascri
pt language, and adds syntax for embedding literal xml documents in javascri
pt code.
...this cha
pter provides a practical overview of the language; it is not a complete reference.
... compatibility issues prior to widespread browser support for the <scri
pt> element, it was common for javascri
pt embedded in a page to be surrounded by html comment tags to prevent <scri
pt> unaware browsers from displaying javascri
pt code to the user.
...And 15 more matches
Advanced form styling - Learn web development
these include: elements involved in creating dropdown widgets, including <select>, <o
ption>, <o
ptgroup> and <datalist>.
... also bear in mind that we've added some javascri
pt to the page that lists the files selected by the file picker, below the control itself.
... we've applied some global normalizing css to all the controls and their labels, to get them to size in the same way, ado
pt their parent font, etc., as mentioned in the previous article: button, label, input, select, progress, meter { display: block; font-family: inherit; font-size: 100%; padding: 0; margin: 0; box-sizing: border-box; width: 100%; padding: 5px; height: 30px; } we also added some uniform shadow and rounded corners to the controls on which it made sense: input[type="text"], input[type="datetime-local"], input[type="color"], select { box-shadow: inset 1px 1px 3px #cc...
...And 15 more matches
A XUL Bestiary - Archive of obsolete content
this xulnote presents some of the key conce
pts and terms in the xul development environment.
...i selected items for this group because they seemed to be either shrouded in mystery, misused as conce
pts or terms, or underestimated according to their role in xul and cross-platform development.
... the chrome url this conce
pt of a chrome as an integrated, dynamic thing in some way divorced from the "appcore" is realized in the use of the chrome url to point to chunks of xul and their related files.
...And 14 more matches
Archived open Web documentation - Archive of obsolete content
e4x ecmascri
pt for xml (e4x) is a programming language extension that adds native xml support to javascri
pt.
... it does this by providing access to the xml document in a form that feels natural for ecmascri
pt programmers.
... e4x tutorial this tutorial walks you through the basic syntax of e4x (ecmascri
pt for xml).
...And 14 more matches
Define terms with HTML - Learn web development
html provides several ways to convey descri
ption semantics, whether inline or as structured glossaries.
... objective: learn how to introduce new keywords and how to build descri
ption lists.
...dictionaries and glossaries formally associate keywords with one or more descri
ptions, as in this case: blue (adjective) of a color like the sky in a sunny day.
...And 14 more matches
Fetching data from the server - Learn web development
this seemingly small detail has had a huge impact on the performance and behavior of sites, so in this article, we'll explain the conce
pt and look at technologies that make it possible, such as xmlhttprequest and the fetch api.
... prerequisites: javascri
pt basics (see first steps, building blocks, javascri
pt objects), the basics of client-side apis objective: to learn how to fetch data from the server and use it to update the contents of a web page.
... note: in the early days, this general technique was known as asynchronous javascri
pt and xml (ajax), because it tended to use xmlhttprequest to request xml data.
...And 14 more matches
Website security - Learn web development
the more formal definition of website security is the act/practice of protecting websites from unauthorized access, use, modification, destruction, or disru
ption.
... cross-site scri
pting (xss) xss is a term used to describe a class of attacks that allow an attacker to inject client-side scri
pts through the website into the browsers of other users.
... the xss vulnerabilities are divided into reflected and persistent, based on how the site returns the injected scri
pts to a browser.
...And 14 more matches
Componentizing our Svelte app - Learn web development
previous overview: client-side javascri
pt frameworks next in the last article we started developing our todo list app.
... prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascri
pt languages, and have knowledge of the terminal/command line.
...a component is a reusable, self-contained block of code that encapsulates html, css and javascri
pt that belong together, written into a .svelte file.
...And 14 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
previous overview: client-side javascri
pt frameworks next we now have sample data in place, and a loop that takes each bit of data and renders it inside a todoitem in our app.
... prerequisites: familiarity with the core html, css, and javascri
pt languages, knowledge of the terminal/command line.
... vue components are written as a combination of javascri
pt objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure.
...And 14 more matches
Makefile - variables
variable name descri
ption add_to_def_file cpp_sources cpp_unit_tests a list of source files to compile as unit tests.
... extra_components nsdefaultclh.manifest, javascri
pt xpcomm files extra_dso_libs extra_dso_ldo
pts extra_js_modules extra_pp_components xpcomm files to pre-process before installation.
... xpidl_module module name to use when generating .x
pt files, default to module.
...And 14 more matches
Sqlite.jsm
the sqlite.jsm javascri
pt code module is a promise-based wrapper around the storage/sqlite interface.
...sqlite.jsm exposes a transaction api built on top of task.jsm that allows transactions to be written as procedural javascri
pt functions (as opposed to a series of callback driven operations).
... javascri
pt-y api.
...And 14 more matches
Rhino serialization
beginning with rhino 1.5 release 3 it is possible to serialize javascri
pt objects, including functions and scri
pts.
...they're intended mainly as examples of the use of serialization: $ java org.mozilla.javascri
pt.tools.shell.main js> function f() { return 3; } js> serialize(f, "f.ser") js> quit() $ java org.mozilla.javascri
pt.tools.shell.main js> f = deserialize("f.ser") function f() { return 3;} js> f() 3 js> here we see a simple case of a function being serialized to a file and then read into a new instance of rhino and called.
... rhino serialization apis two new classes, scri
ptableoutputstream and scri
ptableinputstream, were introduced to handle serialization of rhino classes.
...And 14 more matches
JS_DefineProperty
syntax bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handlevalue value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handleobject value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handlestring value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, int32_t value, unsigned attrs...
..., jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, uint32_t value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, double value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlevalue value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_...
...t namelen, js::handleobject value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlestring value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, int32_t value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, uint32_t value, unsigned attrs, jsnative getter = nu...
...And 14 more matches
nsIAlertsService
toolkit/components/alerts/nsialertsservice.idlscri
ptable this interface can be used to notify the user of something that does not require an immediate reaction.
... implemented by: @mozilla.org/alerts-service;1 as a service: var alertsservice = components.classes["@mozilla.org/alerts-service;1"] .getservice(components.interfaces.nsialertsservice); method overview void showalertnotification(in astring imageurl, in astring title, in astring text, [o
ptional] in boolean textclickable, [o
ptional] in astring cookie, [o
ptional] in nsiobserver alertlistener, [o
ptional] in astring name, [o
ptional] in astring dir, [o
ptional] in astring lang, [o
ptional] in astring data, [o
ptional] in nsiprincipal principal,[o
ptional] in boolean inprivatebrowsing); void closealert([o
ptional] in astring name, [o
ptional] in nsiprincipal principal); methods...
... note: if you are calling this function from javascri
pt, you should wrap it in a try/catch because it can fail on mac os x prior to firefox 22.
...And 14 more matches
nsIEffectiveTLDService
netwerk/dns/nsieffectivetldservice.idlscri
ptable this is an interface that examines a hostname and determines the longest portion that should be treated as though it were a top-level domain (tld).
... method overview acstring getbasedomain(in nsiuri auri, [o
ptional] in pruint32 aadditionalparts); acstring getbasedomainfromhost(in autf8string ahost, [o
ptional] in pruint32 aadditionalparts); acstring getpublicsuffix(in nsiuri auri); acstring getpublicsuffixfromhost(in autf8string ahost); methods getbasedomain() returns the base domain of a uri; that is, the public suffix with a given number of additional domain name pa...
... acstring getbasedomain( in nsiuri auri, [o
ptional] in pruint32 aadditionalparts ); parameters auri the uri to be analyzed.
...And 14 more matches
nsIOutputStream
xpcom/io/nsioutputstream.idlscri
ptable an interface describing a writable stream of data.
... 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 void
ptr aclosure, in unsigned long acount); native code only!
... exce
ptions thrown ns_base_stream_would_block indicates that closing the output stream would block the calling thread for an indeterminate amount of time.
...And 14 more matches
XPCOM
it has multiple language bindings, allowing xpcom components to be used and implemented in javascri
pt, java, and python in addition to c++.
...this article will show you how to use the available interfaces in several mozilla products.aggregating the in-memory datasourcealready_addrefedalready_addrefed in association with nscom
ptr allows you to assign in a pointer without addrefing it.binary compatibilityif mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail.
...this can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example).creating a python xpcom componentcreating applications with mozilla already provides a tutorial for making a simple javascri
pt or c++ component (implementing the nsisimple interface).
...And 14 more matches
Using multi-column layouts - CSS: Cascading Style Sheets
unfortunately this is impossible to do with css and html without forcing column breaks at fixed positions, or severely restricting the markup allowed in the text, or using heroic scri
pting.
... </p> <p> duis aute irure dolor in reprehenderit in volu
ptate velit esse cillum dolore eu fugiat nulla pariatur.
... </p> <p> exce
pteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
...And 10 more matches
Variable fonts guide - CSS: Cascading Style Sheets
if you wanted to add more weights, like a lighter one for ca
ptions or a heavier one for extra emphasis, that would mean several more files.
... introducing the 'variation axis' the heart of the new variable fonts format is the conce
pt of an axis of variation describing the allowable range of that particular aspect of the typeface design.
...the five currently registered axes are weight, width, slant, italic, and o
ptical size.
...And 10 more matches
Cross-browser audio basics - Developer guides
if omitted, most browsers will attem
pt to guess this from the file extension.
... metadata: download the audio metadata; this is usually the best o
ption, as it allows you to access and display information such as audio length, and allow the browser to work out which audio file it should use.
...this is generally not a good o
ption unless you can guarantee your users will have a fast network connection.
...And 10 more matches
Introduction to Web development - Developer guides
html elements reference guide — a comprehensive guide to html elements with details on how browsers support them css getting started with css — an absolute beginners guide to css covers basic conce
pts and fundamentals css reference guide — a complete guide to css with details on the level of gecko/firefox support for each.
... common css questions — common questions and answers for beginners intermediate css conce
pts — grouping, pseudo-classes and more.
... javascri
pt beginning getting started with javascri
pt — what is javascri
pt and how can it help you?
...And 10 more matches
Global attributes - HTML: Hypertext Markup Language
in addition to the basic html global attributes, the following global attributes also exist: xml:lang and xml:base — these are inherited from the xhtml specifications and deprecated, but ke
pt for compatibility purposes.
... the event handler attributes: onabort, onautocomplete, onautocompleteerror, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onem
ptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onsort, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, o...
...classes allows css and javascri
pt to select and access specific elements via the class selectors or functions like the method document.getelementsbyclassname().
...And 10 more matches
MIME types (IANA media types) - HTTP
an o
ptional parameter can be added to provide additional details: type/subtype;parameter=value for example, for any mime type whose main type is text, the o
ptional charset parameter can be used to specify the character set used for the characters in the data.
... mime types are case-insensitive but are traditionally written in lowercase, with the exce
ption of parameter values, whose case may or may not have specific meaning.
... with the exce
ption of multipart/form-data, used in the post method of html forms, and multipart/byteranges, used with 206 partial content to send part of a document, http doesn't handle multipart documents in a special way: the message is transmitted to the browser (which will likely show a "save as" window if it doesn't know how to display the document).
...And 10 more matches
HTTP Messages - HTTP
in http/2, the once human-readable message is now divided up into http frames, providing o
ptimization and performance improvements.
... an o
ptional set of http headers specifying the request, or describing the body included in the message.
... an o
ptional body containing data associated with the request (like content of an html form), or the document associated with a response.
...And 10 more matches
CSS Houdini
advantages of houdini houdini enables faster parse times than using javascri
pt .style for style changes.
... browsers parse the cssom — including layout, paint, and composite processes — before applying any style updates found in scri
pts.
... in addition, layout, paint, and composite processes are repeated for javascri
pt style updates.
...And 10 more matches
Media container formats (file types) - Web media technologies
3gp the 3gp or 3gpp media container is used to encapsulate audio and/or video that is specifically intended for transmission over cellular networks for consum
ption on mobile devices.
... 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 o
ptionally 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 o
ptionally provide details about the profile, level, and/or other codec configuration specifics.
...And 10 more matches
Add to Home screen - Progressive web apps (PWAs)
a2hs is supported in all mobile browsers, exce
pt ios webview.
... the manifest for our sample app looks like this: { "background_color": "purple", "descri
ption": "shows random fox pictures.
...our pwa installable on desktop, we first added a button to our document to allow users to do the installation — this isn't made available automatically on desktop apps, and the installation needs to be triggered by a user gesture: <button class="add-button">add to home screen</button> we then gave it some simple styling: .add-button { position: absolute; top: 1px; left: 1px; } javascri
pt for handling the install at the bottom of our index.js file, we added some javascri
pt to handle the installation.
...And 10 more matches
Progressive web app structure - Progressive web apps (PWAs)
the most popular approach is the "app shell" conce
pt, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in upcoming articles and use in our example application.
... app shell the app shell conce
pt is concerned with loading a minimal user interface as soon as possible and then caching it so it is available offline for subsequent visits before then loading all the contents of the app.
... different conce
pt: streams an entirely different approach to server- or client-side rendering can be achieved with the streams api.
...And 10 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
the most popular approach is the app shell conce
pt, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in upcoming articles and use in our example application.
... the app shell conce
pt the app shell conce
pt is concerned with loading a minimal user interface and content as soon as possible, caching it so it's available offline for subsequent visits before then loading the remainder of the app's contents.
...to have the javascri
pt actually work, however, it has to be downloaded in its entirety.
...And 10 more matches
Compiling an Existing C Module to WebAssembly - WebAssembly
emscri
pten provides most of these features, although there are some limitations.
... $ git clone https://github.com/webmproject/libwebp to start off simple, expose webpgetencoderversion() from encode.h to javascri
pt by writing a c file called webp.c: #include "emscri
pten.h" #include "src/webp/encode.h" emscri
pten_keepalive int version() { return webpgetencoderversion(); } this is a good simple program to test whether you can get the source code of libwebp to compile, as it doesn't require any parameters or complex data structures to invoke this function.
...emscri
pten provides emconfigure and emmake to wrap these commands and inject the appropriate parameters.
...And 10 more matches
content/loader - Archive of obsolete content
provides one of the building blocks for those modules that use content scri
pts to interact with web content, such as panel and page-mod.
... loader adds code to initialize and validate a set of properties for managing content scri
pts: contenturl contentscri
pt contentscri
ptfile contentscri
ptwhen contentscri
pto
ptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action.
... the loader is used by modules that use content scri
pts but don't themselves load content, such as page-mod.
...And 9 more matches
core/promise - Archive of obsolete content
ckbox(a, b) { var c = assemble(a); return combine(b, c); } we're forced into continuation passing style, involving lots of machinery: function sphagetti(a, b, callback) { assemble(a, function continuewith(error, c) { if (error) callback(error); else combine(b, c, callback); }); } this style also makes doing things in sequence hard: widget.on('click', function onclick() { prom
ptuserfortwitterhandle(function continuewith(error, handle) { if (error) return ui.displayerror(error); twitter.gettweetsfor(handle, funtion continuewith(error, tweets) { if (error) return ui.displayerror(error); ui.showtweets(tweets); }); }); }); doing things in parallel is even harder: var tweets, answers, checkins; twitter.gettweetsfor(user, function continuewith(resul...
... in the add-on sdk we follow commonjs promises/a specification and model a promise as an object with a then method, which can be used to get the eventual return (fulfillment) value or thrown exce
ption (rejection): foo().then(function success(value) { // ...
...since a function can either return a value or throw an exce
ption, only one handler will ever be called.
...And 9 more matches
NSPR build instructions
building nspr consists of three steps: run the configure scri
pt.
... you may override the compilers (the cc environment variable) or specify o
ptions.
... build the libraries build the test programs for example, # check out the source tree from mercurial hg clone https://hg.mozilla.org/projects/nspr # create a build directory mkdir target.debug cd target.debug # run the configure scri
pt ../nspr/configure [o
ptional configure o
ptions] # build the libraries gmake # build the test programs cd pr/tests gmake on mac os x, use make, which is gnu make.
...And 9 more matches
nss tech note1
the main non-streaming apis for these two decoders have an identical prototype : secstatus sec_asn1decodeitem(prarenapool *pool, void *dest, const sec_asn1template *t, secitem *item); secstatus sec_quickderdecodeitem(prarenapool* arena, void* dest, const sec_asn1template* templateentry, secitem* src); here is a descri
ption of the arguments : secitem* src† is a structure containing a pointer to the binary data to be decoded, as well as its size.
...the syntax of these templates is identical for both decoders, exce
pt where noted.
...it is only required for dynamically allocating memory for the structure if the template is being included from an asn.1 sequence or sequence of, or if dynamic allocation was requested from the parent template using the sec_asn1_pointer modifier here is a descri
ption of the various tags and modifiers that apply to the <tt style="color: rgb(0,0,0);">kind field.
...And 9 more matches
nss tech note7
rsa signing and encry
ption with nss nss technical note: 7 this technical note explains how to use nss to perform rsa signing and encry
ption.
... the industry standard for rsa signing and encry
ption is pkcs #1.
... rsa key pairs may be generated inside a cry
pto module (also known as a token).
...And 9 more matches
sslcrt.html
upgraded documentation may be found in the current nss reference certificate functions cha
pter 5 certificate functions this cha
pter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator.
...see descri
ption below for more information.
... descri
ption the cert_verifycertnow function must call one or more pk11 functions to obtain the services of a pkcs #11 module.
...And 9 more matches
JS_GetGCParameter
syntax uint32_t js_getgcparameter(jsruntime *rt, jsgcparamkey key); void js_setgcparameter(jsruntime *rt, jsgcparamkey key, uint32_t value); uint32_t js_getgcparameterforthread(jscontext *cx, jsgcparamkey key); // added in spidermonkeysidebar 17 void js_setgcparameterforthread(jscontext *cx, jsgcparamkey key, uint32_t value); // added in spidermonkeysidebar 17 name type descri
ption rt jsruntime * the runtime to configure.
..._total_chunks, jsgc_slice_time_budget, jsgc_mark_stack_limit, jsgc_high_frequency_time_limit, jsgc_high_frequency_low_limit, jsgc_high_frequency_high_limit, jsgc_high_frequency_heap_growth_max, jsgc_high_frequency_heap_growth_min, jsgc_low_frequency_heap_growth, jsgc_dynamic_heap_growth, jsgc_dynamic_mark_slice, jsgc_allocation_threshold, jsgc_min_em
pty_chunk_count, jsgc_max_em
pty_chunk_count, jsgc_compaction_enabled, jsgc_allocation_threshold_factor, jsgc_allocation_threshold_factor_avoid_interru
pt, jsgc_nursery_free_threshold_for_idle_collection, jsgc_pretenure_threshold, jsgc_pretenure_group_threshold, jsgc_nursery_free_threshold_for_idle_collection_percent, jsgc_min_nursery_bytes, jsgc_min_last_ditch_...
...gc_period, } jsgcparamkey; value (c++/js shell) descri
ption jsgc_max_bytes / "maxbytes" maximum nominal heap before last ditch gc.
...And 9 more matches
SpiderMonkey 38
the mozilla javascri
pt team is pleased to announce the release of spidermonkey 38.
... spidermonkey 38 is the javascri
pt engine that shipped in firefox 38.
...or file bugs at bugzilla.mozilla.org under product: core, component: javascri
pt engine.
...And 9 more matches
Mozilla internal string guide
all string classes support the following three ownership models dynamically: reference counted, copy-on-write, buffers (the default) ado
pted buffers (a buffer that the string class owns, but is not reference counted, because it came from somewhere else) dependent buffers, that is, an underlying buffer that the string class does not own, but that the caller that constructed the string guarantees will outlive the string instance in addition, there is a special string class, ns[c]autostring, that additionally contains an internal 64...
... .isem
pty() - the fastest way of determining if the string has any value.
...you must not access the string exce
pt via the handle until you call finish() on the handle in the success case or you let the handle go out of scope without calling finish() in the failure case, in which case the destructor of the handle puts the string in a mostly harmless but consistent state (containing a single replacement character if a capacity greater than 0 was requested, or in the char case if the three-byte utf-8 representa...
...And 9 more matches
XPCOM Stream Guide
think of a water tank with a spout: the tank may be full, or it may be half-full, or it may be em
pty.
... using streams in c++ using streams in javascri
pt input streams input streams are not scri
ptable - you cannot directly call .read() on them, for example.
... to solve this, there is a special nsiscri
ptableinputstream interface and "scri
ptable stream" wrapper.
...And 9 more matches
Components.utils
please keep this list in sync with the components object page methods method descri
ption cloneinto() create a structured clone of an object in a different javascri
pt context.
... evalinsandbox() runs javascri
pt code in a sandbox, usually used to run code with restricted privileges.
... evaluate javascri
pt code in a less-privileged javascri
pt context.
...And 9 more matches
mozIAsyncFavicons
toolkit/components/places/moziasyncfavicons.idlscri
ptable interface for accessing the favicon service asynchronously.
...as an alternative, you can just use placesutils.favicons from javascri
pt.
... method overview void getfaviconurlforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void getfavicondataforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void setandfetchfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [o
ptional] in nsifavicondatacallback acallback); void replacefavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, [o
ptional] in prtime aexpiration); void replacefavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, [o
ptional] in prtime aexpiration); methods getfaviconurlforpage() retrieve the u...
...And 9 more matches
nsIAccessibleEvent
accessible/public/nsiaccessibleevent.idlscri
ptable an interface for accessibility events listened to by in-process accessibility clients, which can be used to find out how to get accessibility and dom interfaces for the event and its target.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type descri
ption accessible nsiaccessible the nsiaccessible associated with the event.
... constants constant gecko version descri
ption 1.7 - 1.8.1 1.9 - 1.9.2 2.0 event_show 0x8002 0x0001 an object has been created.
...And 9 more matches
nsICacheSession
netwerk/cache/public/nsicachesession.idlscri
ptable handles open synchronous and asynchronous cache entry operations along with evicting cache entries and checking for cache devices instantiation according to the session storage policies.
... inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void asyncopencacheentry(in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [o
ptional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescri
ptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type descri
ption doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true.
...instead, the listener will be notified when the descri
ptor is available.
...And 9 more matches
nsIConsoleService
xpcom/base/nsiconsoleservice.idlscri
ptable the console service is the back-end for the error console, bundled with every mozilla application, and for firefox's web console and browser console.
...monkey 2.16) implemented by: @mozilla.org/consoleservice;1 as a service: var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); method overview void getmessagearray([array, size_is(count)] out nsiconsolemessage messages, out uint32_t count);obsolete since gecko 19 void getmessagearray([o
ptional] out uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void registerlistener(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsolelistener listener); methods getmessagearray() to obtain a...
...if no messages are logged, this function will return a count of 0, but allocating a placeholder word for messages, showing as a 0-length array when called from the scri
pt.
...And 9 more matches
nsIDOMEvent
dom/interfaces/events/nsidomevent.idlscri
ptable this interface is the primary data type for all events in the document object model.
... method overview boolean deserialize(in constipcmessage
ptr amsg, out void
ptr aiter); violates the xpcom interface guidelines void duplicateprivatedata(); native code only!
... nsevent
ptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventca
pture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessage
ptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelines void settarget(in nsidomeventtarget atarget); native code only!
...And 9 more matches
nsIDownloadManager
toolkit/components/downloads/public/nsidownloadmanager.idlscri
ptable this interface lets applications and extensions communicate with the download manager, adding and removing files to be downloaded, fetching information about downloads, and being notified when downloads are completed.
...rame(in long long abegintime, in long long aendtime); void removelistener(in nsidownloadprogresslistener alistener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savestate(); obsolete since gecko 1.8 void startbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type descri
ption activedownloadcount long the number of files currently being downloaded.
... constants constant value descri
ption download_notstarted -1 the download has not been started yet.
...And 9 more matches
nsIEditorIMESupport
editor/idl/nsieditorimesupport.idlscri
ptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void begincomposition(in nstexteventreply
ptr areply); native code only!
... void getquerycaretrect(in nsquerycaretrecteventreply
ptr areply); native code only!
...And 9 more matches
nsINavBookmarksService
toolkit/components/places/nsinavbookmarksservice.idlscri
ptable the bookmarksservice interface provides methods for managing bookmarked history items.
...obsolete since gecko 1.9 void getbookmarkidsforuri(in nsiuri auri, [o
ptional] out unsigned long count, [array, retval, size_is(count)] out long long bookmarks); note: renamed from getbookmarkfolders in gecko 1.9 void getbookmarkidsforuritarray(in nsiuri auri, in print64array aresult); native code only!
... long long aitemid, in prtime alastmodified); void setitemtitle(in long long aitemid, in autf8string atitle); void setkeywordforbookmark(in long long aitemid, in astring akeyword); obsolete since gecko 40.0 void setkeywordforuri(in nsiuri uri, in astring keyword); obsolete since gecko 1.9 obsolete since gecko 40.0 attributes attribute type descri
ption bookmarksmenufolder long long the item id of the bookmarks menu folder.
...And 9 more matches
nsINavHistoryQuery
toolkit/components/places/public/nsinavhistoryservice.idlscri
ptable encapsulates all the query parameters you're likely to need when building up history ui.
...this is important because, if the user has their profile on a networked drive, query latency can be non-negligible method overview nsinavhistoryquery clone(); void getfolders([o
ptional ]out unsigned long count, [retval,array,size_is(count)] out long long folders); void gettransitions([o
ptional] out unsigned long count, [retval,array,size_is(count)] out unsigned long transitions); void setfolders([const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount); void settransitions([const,array, size_is(count)] in unsigned long transitions, in...
... unsigned long count); attributes attribute type descri
ption absolutebegintime prtime read only: retrieves the begin time value that the currently loaded reference points + offset resolve to.
...And 9 more matches
nsIPluginHost
dom/plugins/base/nsipluginhost.idlscri
ptable please add a summary to this article.
... obsolete since gecko 2.0 void deletepluginnativewindow(in nspluginnativewindow
ptr apluginnativewindow); native code only!
... void getplugintags([o
ptional] out unsigned long aplugincount, [retval, array, size_is(aplugincount)] out nsiplugintag aresults); void handlebadplugin(in prlibrary
ptr alibrary, in nsiplugininstance instance); native code only!
...And 9 more matches
nsIRadioInterfaceLayer
dom/system/gonk/nsiradiointerfacelayer.idlscri
ptable used to implement the interface between the telephony api and the radio hardware in a telephone.
...callback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pd
ptype); void starttone(in domstring dtmfchar); void sto
ptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type descri
ption currentstate jsval read only.
... speakerenabled bool constants call state constants constant value descri
ption call_state_unknown 0 call_state_dialing 1 call_state_alerting 2 call_state_busy 3 call_state_connecting 4 call_state_connected 5 call_state_holding 6 call_state_held 7 call_state_resuming 8 call_state_disconnecting 9 call_state_disconnected 10 call_state_incoming 11 datacall_state_unknown 0 datacall_state_connecting 1 datacall_state_connected 2 datacall_state_disconnecting 3 datacall_state_disconnected 4 call_state_ringing 2 obsolete since gecko 14.0 methods answercall() void answercall( in unsigned long callindex ); parameters callindex missing des...
...And 9 more matches
nsISessionStore
browser/components/sessionstore/nsisessionstore.idlscri
ptable provides a means for extensions and other code to store data in association with browser sessions, tabs, and windows.
...; void setwindowstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type descri
ption canrestorelastsession boolean is it possible to restore the previous session.
... exce
ptions thrown this method throws a ns_error_illegal_value exce
ption if the key doesn't exist.
...And 9 more matches
nsITelemetry
toolkit/components/telemetry/nsitelemetry.idlscri
ptable a service to gather performance data that can be tracked over time to allow generating histograms.
...telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void ca
pturestack(in acstring name); jsval snapshotca
pturedstacks([o
ptional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acall...
...back); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [o
ptional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyedscalarset(in acstring aname, in astring akey, in jsval avalue); void keyedscalarsetmaximum(in acstring aname, in astring akey, in jsval avalue); jsval snapshotkeyedscalars(in uint32_t adataset, [o
ptional] in boolean aclear); void clearscalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in a...
...And 9 more matches
nsIWindowWatcher
embedding/components/windowwatcher/public/nsiwindowwatcher.idlscri
ptable this interface is the keeper of gecko/dom windows.
...windows must notify this component when they are created or destroyed, so only a weak reference is ke
pt.
... method overview nsiwebbrowserchrome getchromeforwindow(in nsidomwindow awindow); nsiauthprom
pt getnewauthprom
pter(in nsidomwindow aparent); nsiprom
pt getnewprom
pter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments); ...
...And 9 more matches
Using Objective-C from js-ctypes
// [nsstring getbytes:maxlength:usedlength:encoding:o
ptions:range:remainingrange:] sel foo = sel_registername("getbytes:maxlength:usedlength:encoding:o
ptions: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).
... let id = ctypes.structtype("objc_object").
ptr; let sel = ctypes.structtype("objc_selector").
ptr; let bool = ctypes.signed_char; functions all functions in our example are exported by /usr/lib/libobjc.dylib.
... let objc_getclass = lib.declare("objc_getclass", ctypes.default_abi, id, ctypes.char.
ptr); let sel_registername = lib.declare("sel_registername", ctypes.default_abi, sel, ctypes.char.
ptr); calling variadic function objc_msgsend is a variadic function, so we should always pass it a cdata instance, other than this first and second argument, to declare each argument type.
...And 9 more matches
AudioWorkletProcessor() - Web APIs
var processor = new audioworkletprocessor(o
ptions); parameters o
ptions an object that is passed as o
ptions parameter to audioworkletnode constructor and passed through the structured clone algorithm.
... the object is based on audioworkletnodeo
ptions dictionary.
... available properties are as follows: numberofinputs o
ptional the value to initialize the numberofinputs property to.
...And 9 more matches
Bluetooth.requestDevice() - Web APIs
the bluetooth.requestdevice() method of the bluetooth interface returns a promise to a bluetoothdevice object with the specified o
ptions.
... syntax bluetooth.requestdevice([o
ptions]) .then(function(bluetoothdevice) { ...
... parameters o
ptions o
ptional an object that sets o
ptions for the device request.
...And 9 more matches
Using Fetch - Web APIs
the fetch api provides a javascri
pt interface for accessing and manipulating parts of the http pipeline, such as requests and responses.
...fetch also provides a single logical place to define other http-related conce
pts such as cors and extensions to http.
... fetch won’t send cookies, unless you set the credentials init o
ption.
...And 9 more matches
HTMLImageElement.srcset - Web APIs
each image candidate string contains an image url and an o
ptional width or pixel density descri
ptor that indicates the conditions under which that candidate should be used instead of the image specified by the src property.
...this is followed by a comma (,) character and then a condition descri
ptor that indicates the circumstances in which the indicated image should be used.
... space characters, other than the whitespace separating the url and the corresponding condition descri
ptor, are ignored; this includes both leading and trailing space, as well as space before or after each comma.
...And 9 more matches
HTMLInputElement - Web APIs
the htmlinputelement interface provides special properties and methods for manipulating the o
ptions, layout, and presentation of <input> elements.
... note: if the user enters a value different from the value expected, this may return an em
pty string.
...this is the em
pty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
...And 9 more matches
HTMLSelectElement.add() - Web APIs
the htmlselectelement.add() method adds an element to the collection of o
ption elements for this select element.
... syntax collection.add(item[, before]); parameters item is an htmlo
ptionelement or htmlo
ptgroupelement before is o
ptional and an element of the collection, or an index of type long, representing the item item should be inserted before.
... exce
ptions a domerror of the type hierarchyrequesterror if the item passed to the method is an ancestor of the htmlselectelement.
...And 9 more matches
Custom XUL Elements with XBL - Archive of obsolete content
this somewhat cry
ptic explanation describes a very simple conce
pt: with xbl you can create your own custom elements.
... <content> <xul:hbox> <xul:image class="xulshoolhello-person-image" xbl:inherits="src=image" /> <xul:vbox flex="1"> <xul:label xbl:inherits="value=name" /> <xul:descri
ption xbl:inherits="value=greeting" /> </xul:vbox> <xul:vbox> <xul:button label="&xulshoolhello.remove.label;" accesskey="&xulshoolhello.remove.accesskey;" oncommand="document.getbindingparent(this).remove(event);" /> </xul:vbox> </xul:hbox> </content> our element is very simple, displaying an image, a couple of text lines and a button.
... <xul:label anonid="xulshoolhello-name-label" xbl:inherits="value=name" /> and then, in order to get a reference to the node from the js code in your binding, we use the getanonymouselementbyattribute dom method: let namelabel = document.getanonymouselementbyattribute( this, "anonid", "xulshoolhello-name-label"); implementation the implementation section defines most of the scri
pting side of your element.
...And 7 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
extension-directory/install.rdf extension-directory/libraries/dependent1.dll extension-directory/libraries/dependent2.dll extension-directory/libraries/component.dll extension-directory/components/interface1.x
pt extension-directory/components/interface2.x
pt extension-directory/components/bsmedberg_stub.dll extensions/stub/makefile.in # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> de
pth = ../..
... srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(de
pth)/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_ldo
pts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldo
pts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" extensions/stub/bdsstubloader.cpp // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscom
ptr.h" static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdepe...
... // assume that we're in <extensiondir>/components, and we want to find // <extensiondir>/libraries nscom
ptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscom
ptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (...
...And 7 more matches
Autodial for Windows NT - Archive of obsolete content
a brief history of autodial on windows in the consumer versions of windows, (windows 95, windows 98, windows me) autodial for all applications is controlled from the control panel, in the internet o
ptions applet, under the tab connections.
...technically, this control panel applet (internet o
ptions) is part of internet explorer.
...for these oss, the autodial o
ptions found in the internet o
ptions control panel applet only apply to microsoft applications, including internet explorer and outlook.
...And 7 more matches
generateCRMFRequest() - Archive of obsolete content
use <keygen> or the future web cry
pto api instead.
... crmfobject = cry
pto.generatecrmfrequest("requesteddn", "regtoken", "authenticator", "escrowauthoritycert", "crmf generation done code", keysize1, "keyparams1", "keygenalg1", ..., keysizen, "keyparamsn", "keygenalgn"); this method will generate a sequence of crmf requests that has n requests.
...after the "escrowauthoritycert" parameter, the method takes some javascri
pt code that is invoked when the crmf request is ready.
...And 7 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
element enabled usage comments descri
ption <descri
ption value="<!-- text -->" /> <descri
ption><!--label text--></descri
ption> use for non-label text.
... although tutorials claim label and descri
ption have the same underlying implementation, descri
ption elements appear to not associate correctly with controls whereas labels do.
...ton label="<!--button text-->" /> <button id="butwrap1"> <label control="butwrap1"> <!--wrapped label--> </label> </button> <button id='butwrap2'> <label control="butwrap2" value="<!--this-->" /> <label control="butwrap2" value="is" /> <label control="butwrap2" value="a" /> <label control="butwrap2" value="button" /> </button> <button image="images/img.xbm" toolti
ptext="<!--button text-->"/> note that in the third example, only the first label is read browser jaws 7.10 issues to use a browser element with html, the type="content" attribute should be specified.
...And 7 more matches
The Implementation of the Application Object Model - Archive of obsolete content
this nsxmlelement implements a whole slew of interfaces, since ra
ptor has multiple apis for referring to these objects.
...rdf stands for resource descri
ption framework, a rather intimidating name that doesn't do much to help the layman understand exactly what it does.
...it makes more sense to describe a content tree structure according to the acce
pted standards (that is accessible and manipulable via standard dom apis) using a real markup language, either an extension of html or an xml language like xul.
...And 7 more matches
tooltip - Archive of obsolete content
for text-only tooltips, this element doesn't need to be used; instead you may just add a toolti
ptext attribute to an element.
... properties accessibletype, label, popupboxobject, position, state methods hidepopup, moveto, openpopup, openpopupatscreen, showpopup, sizeto examples <tooltip id="moretip" orient="vertical" style="background-color: #33dd00;"> <label value="click here to see more information"/> <label value="really!" style="color: red;"/> </tooltip> <vbox> <button label="simple" toolti
ptext="a simple popup"/> <button label="more" tooltip="moretip"/> </vbox> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
... onpopuphidden type: scri
pt code this event is sent to a popup after it has been hidden.
...And 7 more matches
Building XULRunner with Python - Archive of obsolete content
or, if you are interested in working with xulrunner with python on linux, see mark lise's post with the python extensions enabled xulrunner provides python scri
pt access to the dom and xpcom in addition to the usual java scri
pt.
...if you plan to checkout often into em
pty folders you could modify it to set the cvsroot environment variable.
... mk_add_o
ptions moz_objdir=@topsrcdir@/../obj-xulrunner mk_add_o
ptions moz_co_project=xulrunner ac_add_o
ptions --enable-application=xulrunner ac_add_o
ptions --enable-extensions=python,default ac_add_o
ptions --disable-javaxpcom ac_add_o
ptions --disable-activex ac_add_o
ptions --disable-activex-scri
pting ac_add_o
ptions --disable-tests ac_add_o
ptions --enable-o
ptimize to check out all the required source code ...
...And 7 more matches
Getting started with XULRunner - Archive of obsolete content
one way to achieve this is to run the following scri
pt everytime you want to install a new version: firefox_version=`grep -po "\d{2}\.\d+" /usr/lib/firefox/platform.ini` arch=`uname -p` xurl=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$firefox_version/runtimes/xulrunner-$firefox_version.en-us.linux-$arch.tar.bz2 cd /o
pt sudo sh -c "wget -o- $xurl | tar -xj" sudo ln -s /o
pt/xulrunner/xulrunner /usr/bin/xulrunner sudo ln -s /o
pt/xulrun...
...ner/xpcshell /usr/bin/xpcshell you could also save this scri
pt to a file for convenience.
... note: if you are using firefox build from ubuntuzilla repository, replace /usr/lib/firefox/platform.ini with /o
pt/firefox/platform.ini.
...And 7 more matches
The First Install Problem - Archive of obsolete content
if this happens, gecko-based browsers often won't be able to discover the plugin, and will prom
pt the user to download the plugin again if the affiliated mime type is encountered on the web.
... unless gecko does a pre-em
ptive scan upon startup for desirable plugins that are not in the browser's plugins directory first, the best way to solve this problem is to encourage plugin vendors to leave dlls (and x
pt files, if applicable) in a location that gecko can discover at runtime.
...note that myapplication consists of one dll (which is an npapi plugin handling a given mimetype -- say application/x-myapp) and one x
pt file, for scri
ptable interfaces.
...And 7 more matches
Vulnerabilities - Archive of obsolete content
examples of settings are an operating system offering access to control lists that set the privileges that users have for files, and an application offering a setting to enable or disable the encry
ption of sensitive data stored by the application.
...these vulnerabilities are caused by the software designer making trust assum
ptions that permit the software to provide beneficial features, while also introducing the possibility of someone violating the trust assum
ptions to compromise security.
...one of the trust assum
ptions in the design of the html content rendering feature was that users would not receive malicious hyperlinks and click on them.
...And 7 more matches
Building a Theme - Archive of obsolete content
inside your new theme folder, create two new em
pty text files, one called chrome.manifest and the other called install.rdf.
... create the install manifest open the file called install.rdf that you created at the top of your extension's folder hierarchy and put this inside: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <descri
ption about="urn:mozilla:install-manifest"> <em:id>sample@example.net</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this theme can install into, with minimum and maximum supported versions.
... --> <em:targetapplication> <descri
ption> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>29.0</em:minversion> <em:maxversion>39.*</em:maxversion> </descri
ption> </em:targetapplication> <!-- front end metadata --> <em:name>my theme</em:name> <em:internalname>sample</em:internalname> <em:descri
ption>a test extension</em:descri
ption> <em:creator>your name here</em:creator> <em:homepageurl>http://www.example.com/</em:homepageurl> </descri
ption> </rdf> sample@example.net - the id of the extension.
...And 7 more matches
RDF in Mozilla FAQ - Archive of obsolete content
rdf in fifty words or less is a quick, high-level descri
ption of what rdf does in mozilla.
...using this api and javascri
pt's settimeout(), one could set up a polling loop that would continually check the loaded property.
...the following code illustrates its usage: // this is the object that will observe the rdf/xml load's progress var observer = { onbeginload: function(asink) {}, oninterru
pt: function(asink) {}, onresume: function(asink) {}, onendload: function(asink) { asink.removexmlsinkobserver(this); alert("done!"); }, onerror: function(asink, astatus, aerrormsg) { alert("error!
...And 7 more matches
Unconventional controls - Game development
the earliest demo of ca
ptain rogers: battle at andromeda was adjusted to work on a huge tv.
... interestingly enough, the first ca
ptain rogers game (asteroid belt of sirius) was o
ptimized for low-end, small-screen, cheap smartphones running firefox os, so you can see the difference three years can make — you can read the whole story in our building games for firefox os tv hacks post.
...ca
ptain rogers had the keyboard controls implemented already: this.cursors = this.input.keyboard.createcursorkeys(); //...
...And 7 more matches
nsIDOMGeoGeolocation
dom/interfaces/geolocation/nsidomgeogeolocation.idlscri
ptable please add a summary to this article.
...starting in gecko 1.9.2, you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exce
ption when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [o
ptional] in nsidomgeopositionerrorcallback...
... errorcallback, [o
ptional] in nsidomgeopositiono
ptions o
ptions); unsigned short watchposition(in nsidomgeopositioncallback successcallback, [o
ptional] in nsidomgeopositionerrorcallback errorcallback, [o
ptional] in nsidomgeopositiono
ptions o
ptions); attributes attribute type descri
ption lastposition nsidomgeoposition the most recently retrieved location as seen by the provider.
...And 7 more matches
nsIEventListenerService
content/events/public/nsieventlistenerservice.idlscri
ptable a service that can be used to get a list of listeners observing events; this is primarily useful for debuggers.
...method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [o
ptional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [o
ptional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray); boolean haslistenersfor(in nsidomeventtarget aeventtarget, in domstring atype); void ...
...addsystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean useca
pture); void removesystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean useca
pture); attributes attribute type descri
ption systemeventgroup nsidomeventgroup returns system event group.
...And 7 more matches
nsIHTMLEditor
editor/idl/nsihtmleditor.idlscri
ptable please add a summary to this article.
...); void setcssinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void setdocumenttitle(in astring atitle); void setinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void setparagraphformat(in astring aparagraphformat); void updatebaseurl(); attributes attribute type descri
ption iscssenabled boolean a boolean which is true is the htmleditor has been instantiated with css knowledge and if the css pref is currently checked.
... constants constant value descri
ption eleft 0 ecenter 1 eright 2 ejustify 3 methods adddefaultproperty() registers a default style property with the editor.
...And 7 more matches
nsIJumpListBuilder
widget/public/nsijumplistbuilder.idlscri
ptable please add a summary to this article.
...method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items o
ptional, in astring catname o
ptional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type descri
ption available short indicates whether jump list taskbar features are supported by the current host.
...exce
ptions thrown ns_error_not_available on all calls if taskbar functionality is not supported by the operating system.
...And 7 more matches
nsILivemarkService
toolkit/components/places/public/nsilivemarkservice.idlscri
ptable this interface is used to create and reload livemarks.
... 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 em
pty string.
... exce
ptions thrown ns_error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container.
...And 7 more matches
nsIProcess
xpcom/threads/nsiprocess.idlscri
ptable this interface represents an executable process.
...ateinstance(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, [o
ptional] in nsiobserver observer, [o
ptional] in boolean holdweak); void runw(in boolean blocking, [array, size_is(count)] in wstring args, in unsigned long count); void runwasync([array, size_is(count)] in wstring args, in unsigned long count, [o
ptional] in nsiobserver observer, [o
ptional] in boolean holdweak); attributes attribute type descri
ption ...
... runasync() asynchronously runs the process with which the object was initialized, o
ptionally calling an observer when the process finishes running.
...And 7 more matches
nsIPropertyBag2
xpcom/ds/nsipropertybag2.idlscri
ptable this interface extends nsipropertybag with some methods for getting properties in specific formats.
...note: accessing a property of a different type may attem
pt conversion to this type.
...note: accessing a property of a different type may attem
pt conversion to this type.
...And 7 more matches
nsIServerSocket
the nsiserversocket interface implements a server socket that can acce
pt incoming connections.
... netwerk/base/public/nsiserversocket.idlscri
ptable please add a summary to this article.
...to create an instance, use: var serversocket = components.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddr
ptr aaddr, in long abacklog);native code only!
...And 7 more matches
nsITransferable
widget/nsitransferable.idlscri
ptable a container for typed data that can be transferred from one place or owner to another, possibly involving format conversion.
... 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 descri
ption converter nsiformatconverter an nsiformatconverter instance which implements the code needed to convert data into and out of the transferable given the supported flavors.
... constants kflavorhasdataprovider (that title needs to be better) constant value descri
ption kflavorhasdataprovider 0 a descri
ption is needed here.
...And 7 more matches
nsIVariant
xpcom/ds/nsivariant.idlscri
ptable xpconnect has magic to transparently convert between nsivariant and js types.
... we mark the interface [scri
ptable] so that js can use methods that refer to this interface.
... but we mark all the methods and attributes [noscri
pt] since any nsivariant object will be automatically converted to a js type anyway.
...And 7 more matches
nsIWindowsRegKey
xpcom/ds/nsiwindowsregkey.idlscri
ptable this interface is designed to provide scri
ptable access to the windows registry system.
...oid startwatching(in boolean recurse); void stopwatching(); void writebinaryvalue(in astring name, in acstring data); void writeint64value(in astring name, in unsigned long long data); void writeintvalue(in astring name, in unsigned long data); void writestringvalue(in astring name, in astring data); attributes attribute type descri
ption childcount unsigned long this attribute returns the number of child keys.
... constant value descri
ption root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods.
...And 7 more matches
XPCOM Interface Reference by grouping
01, 2010) list of mozilla interfaces as listed on the xpcom interface reference page where that page lists items by alphabetical sorting, this page attem
pts to group them by function.
...iautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositiono
ptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsi...
... nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehypertext nsiaccessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender scri
pt nsiscri
ptableunescapehtml nsiscri
ptableunicodeconverter nsiscri
pterror nsiscri
pterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexce
ption nsidomxpathexpression nsidomxpathresult xslt nsixsltexce
ption nsixsltprocessor download nsidown...
...And 7 more matches
nsIAbCard/Thunderbird3
day webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscri
pt] astring getpropertyasastring(in string name); [noscri
pt] autf8string getpropertyasautf8string(in string name); [noscri
pt] pruint32 getpropertyasuint32(in string name); [noscri
pt] boolean getpropertyasbool(in string name); void setproperty(in autf8string name, in nsivariant value); [noscri
pt] void setpropertyasastring(in string name, in astring value);...
... [noscri
pt] void setpropertyasautf8string(in string name, in autf8string value); [noscri
pt] void setpropertyasuint32(in string name, in pruint32 value); [noscri
pt] void setpropertyasbool(in string name, in boolean value); void deleteproperty(in autf8string name); autf8string translateto(in autf8string atype); void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type descri
ption properties nsisimpleenumerator readonly: a list of all the properties that this card has as an enumerator, whose members are all nsiproperty objects.
... exce
ptions thrown ns_error_not_available<tt> if the named property does not exist.
...And 7 more matches
All keyboard shortcuts - Firefox Developer Tools
command windows macos linux open toolbox (with the most recent tool activated) ctrl + shift + i cmd + o
pt + i ctrl + shift + i bring toolbox to foreground (if the toolbox is in a separate window and not in foreground) ctrl + shift + i or f12 cmd + o
pt + i or f12 ctrl + shift + i or f12 close toolbox (if the toolbox is in a separate window and in foreground) ctrl + shift + i or f12 cmd + o
pt + i or f12 ctrl + shift + i or f12 open web console 1 ctrl +...
... shift + k cmd + o
pt + k ctrl + shift + k toggle "pick an element from the page" (opens the toolbox and/or focus the inspector tab) ctrl + shift + c cmd + o
pt + c ctrl + shift + c open style editor shift + f7 shift + f7 * shift + f7 open profiler shift + f5 shift + f5 * shift + f5 open network monitor 2 ctrl + shift + e cmd + o
pt + e ctrl + shift + e toggle responsive design mode ctrl + shift + m cmd + o
pt + m ctrl + shift + m open browser console ctrl + shift + j cmd + shift + j ctrl + shift + j open browser toolbox ctrl + alt + shift + i cmd + o
pt + shift + i ctrl + alt + shift + i open scratchpad shift + f4 shift + f4 * shift + f4 ...
...open webide shift + f8 shift + f8 * shift + f8 storage inspector shift + f9 shift + f9 * shift + f9 open debugger 3 ctrl + shift + z cmd + o
pt + z ctrl + shift + z 1.
...And 7 more matches
AddressErrors - Web APIs
try to avoid asking the user to make corrections to things they can't change, and there may be situations in which you need to allow validation errors to be acce
pted anyway (for example, if you validate addresses against a postal service database and a new home has been built and its address is not yet in the database).
...please check for any errors."; const invalidcountryerror = "at this time, we only ship to the united states, canada, great britain, japan, china, and germany."; let shippingaddress = ev.target.shippingaddress; let shippingaddresserrors = {}; let updatedetails = {}; if (!validcountries.includes(shippingaddress.country)) { ev.target.shippingo
ptions = []; shippingaddresserrors.country = invalidcountryerror; updatedetails = { error: genericaddresserror, shippingaddresserrors, ...defaultpaymentdetails }; } ev.updatewith(updatedetails); } see handling address changes for a descri
ption of how this code works.
... complete example here we'll see a complete, working version of the example above (exce
pt of course that it's not connected to an actual payment handler, so no payments are actually processed).
...And 7 more matches
nsIDispatchSupport
js/src/xpconnect/idl/nsidispatchsupport.idlnot scri
ptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void comvariant2jsval(in comvariant
ptr comvar, out jsval val); unsigned long gethostingflags(in string acontext); boolean isclassmarkedsafeforscri
pting(in nscidref cid, out boolean classexists); boolean isclasssafetohost(in jscontext
ptr cx, in nscidref cid, in boolean capscheck, out boolean classexists); boolean isobjectsafeforscri
pting(in void
ptr theobject, in nsiidref id); void jsval2comvariant(in jsval var, out comvariant comvar); methods comvariant2jsval() converts a com variant to a jsval.
... void comvariant2jsval( in comvariant
ptr comvar, out jsval val ); parameters comvar the com variant to be converted.
...And 5 more matches
nsIDragService
widget/nsidragservice.idlscri
ptable implements the drag service for handling drag and drop operations.
...the only exce
ption is getcurrentsession(), since there's currently no way to check for a drag in progress using standard dom methods or properties.
... nsidragsession getcurrentsession( ) ; void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscri
ptableregion aregion, in unsigned long aactiontype ); void invokedragsessionwithimage(in nsidomnode adomnode, in nsisupportsarray atransferablearray, in nsiscri
ptableregion aregion, in unsigned long aactiontype, in nsidomnode aimage, in long aimagex, in long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void invokedragsessionwithselection(in nsisele...
...And 5 more matches
nsILocalFileMac
xpcom/io/nsilocalfilemac.idlscri
ptable please add a summary to this article.
... void initwithfsref([const] in fsref
ptr afsref); native code only!
... void initwithfsspec([const] in fsspec
ptr afilespec); native code only!
...And 5 more matches
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow
ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow
ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void ...
...array, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray); void saveattachmenttofile(in nsifile afile, in acstring aurl, in acstring amessageuri, in acstring acontenttype, in nsiurllistener alistener); void detachattachment(in string contenttpe, in string url, in string displayname, in string messageuri, in boolean savefirst, [o
ptional] 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, [o
ptional] in boolean withoutwarning); nsilocalfile saveattachmenttofolder(i...
... attributes attribute type descri
ption transactionmanager nsitransactionmanager readonly: the transaction manager for this nsimessenger instance.
...And 5 more matches
nsIMsgMessageService
inherits from: nsisupports method overview void copymessage(in string asrcuri, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); [noscri
pt] void copymessages(in nsmsgkeyarray
ptr 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...
...session, in nsimsgwindow amsgwindow, in nsimsgfolder amsgfolder, in string asearchuri); nsiuri streammessage(in string amessageuri, in nsisupports aconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in boolean aconvertdata, in string aadditionalheader); nsiuri streamheaders(in string amessageuri, in nsistreamlistener aconsumer, in nsiurllistener aurllistener [o
ptional] in boolean alocalonly); boolean ismsginmemcache(in nsiuri aurl, in nsimsgfolder afolder, out nsicacheentrydescri
ptor acacheentry); nsimsgdbhdr messageuritomsghdr(in string uri); methods copymessage() pass in the uri for the message you want to have copied.
...see copymessage [noscri
pt] void copymessages(in nsmsgkeyarray
ptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); parame...
...And 5 more matches
nsIPermissionManager
netwerk/base/nsipermissionmanager.idlscri
ptable please add a summary to this article.
... 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, [o
ptional] in pruint32 expiretype, [o
ptional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string type, in pruint32 permission, [o
ptional] in pruint32 expiretype, [o
ptional] in print64 expiretime); void remove(in autf8string host, in string type); void removefromprincipal(in nsiprincipal principal, in string 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 descri
ption enumerator nsisimpleenumerator enumerates all stored permissions.
...And 5 more matches
nsIProtocolHandler
netwerk/base/nsiprotocolhandler.idlscri
ptable this interface is used to implement protocol handlers.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type descri
ption defaultport long the default port is the port the protocol uses by default.
... constants constant value descri
ption uri_std 0 a standard full uri with authority component and understanding relative uris; this includes http and ftp, for example.
...And 5 more matches
nsIRequest
netwerk/base/nsirequest.idlscri
ptable this interface is used by the request initiator to control the request.
... method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type descri
ption loadflags nsloadflags the load flags of this request.
... constant value descri
ption load_normal 0 no special load flags.
...And 5 more matches
nsISearchEngine
netwerk/base/public/nsibrowsersearchservice.idlscri
ptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void addparam(in astring name, in astring value, in astring responsetype); nsisearchsubmission getsubmission(in astring data, [o
ptional] in astring responsetype, [o
ptional] in astring purpose); boolean supportsresponsetype(in astring responsetype); attributes attribute type descri
ption alias astring an o
ptional shortcut alias for the engine.
... descri
ption astring a text descri
ption describing the engine.
...And 5 more matches
nsIThread
xpcom/threads/nsithread.idlscri
ptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method overview void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type descri
ption prthread prthread the nspr thread object corresponding to the nsithread.
... exce
ptions thrown ns_error_unexpected shutdown() was erroneously called from within the thread itself, the thread was not created with the thread manager's nsithreadmanager.newthread() method, or the thread is already in the process of being shut down.
...And 5 more matches
nsITransactionListener
editor/txmgr/idl/nsitransactionlistener.idlscri
ptable this interface is implemented by an object that tracks transactions.
...herits from: nsisupports last changed in gecko 1.7 method overview void didbeginbatch(in nsitransactionmanager amanager, in nsresult aresult); void diddo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult adoresult); void didendbatch(in nsitransactionmanager amanager, in nsresult aresult); void didmerge(in nsitransactionmanager amanager, in nsitransaction ato
ptransaction, in nsitransaction atransactiontomerge, in boolean adidmerge, in nsresult amergeresult); void didredo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aredoresult); void didundo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aundoresult); boolean willbeginbatch(in nsitransactionmanager amanager); boolean willdo(in nsi...
...transactionmanager amanager, in nsitransaction atransaction); boolean willendbatch(in nsitransactionmanager amanager); boolean willmerge(in nsitransactionmanager amanager, in nsitransaction ato
ptransaction, in nsitransaction atransactiontomerge); boolean willredo(in nsitransactionmanager amanager, in nsitransaction atransaction); boolean willundo(in nsitransactionmanager amanager, in nsitransaction atransaction); methods didbeginbatch() called after a nsitransactionmanager begins a batch.
...And 5 more matches
nsIURL
netwerk/base/public/nsiurl.idlscri
ptable this interface provides convenience methods that further break down the path portion of nsiuri.
...r myurl = myuri.queryinterface(components.interfaces.nsiurl); } catch(e) { // the uri is not an url } or using instanceof: if (myuri instanceof components.interfaces.nsiurl) { // your code here } method overview autf8string getcommonbasespec(in nsiuri auritocompare); autf8string getrelativespec(in nsiuri auritocompare); attributes attribute type descri
ption directory autf8string directory portion of a url.
... if the url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the em
pty string.
...And 5 more matches
nsIUpdate
toolkit/mozapps/update/nsiupdateservice.idlscri
ptable an interface that describes an object representing an available update to the current application - this update may have several available patches from which one must be selected to download and install, for example we might select a binary difference patch first and attem
pt to apply that, then if the application process fails fall back to downloading a complete file-replace patch.
... 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 descri
ption appversion astring the application version of this update.
... billboardurl astring the url to a page that is typically localized to display in the update prom
pt.
...And 5 more matches
nsIWebProgress
uriloader/base/nsiwebprogress.idlscri
ptable please add a summary to this article.
... last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type descri
ption domwindow nsidomwindow the dom window associated with this nsiwebprogress instance.
...exce
ptions thrown ns_error_failure indicates that there is no associated dom window.
...And 5 more matches
nsIXULBrowserWindow
xpfe/appshell/public/nsixulbrowserwindow.idlscri
ptable provides methods that may be called from the internals of the browser area to tell the containing xul window to update its user interface.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the xulbrowserwindow attribute exists on the nsixulwindow interface although both firefox and seamonkey also store their nsixulbrowserwindow reference in the global xulbrowserwindow object accessible from javascri
pt code.
... note: the xulbrowserwindow object offered to javascri
pt code provides a great many more methods and attributes than those listed here, which are only the ones available to c++ code.
...And 5 more matches
Building up a basic demo with Babylon.js - Game development
in this article we'll take you through the real basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascri
pt code.
...if you have already worked through our building up a basic demo series with three.js, playcanvas or a-frame (or you are familiar with other 3d libraries) you'll notice that babylon.js works on similar conce
pts: camera, light and objects.
... html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: babylon.js demo</title> <style> html,body,canvas { margin: 0; padding: 0; width: 100%; height: 100%; font-size: 0; } </style> </head> <body> <scri
pt src="babylon.js"></scri
pt> <canvas id="render-canvas"></canvas> <scri
pt> var canvas = document.getelementbyid("render-canvas"); /* all our javascri
pt code goes here */ </scri
pt> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element (which babylon.js will use to render the content on) to fill the ent...
...And 4 more matches
Building up a basic demo with the PlayCanvas engine - Game development
if you have already worked through our building up a basic demo with three.js article (or you are familiar with other 3d libraries) you'll notice that playcanvas works on similar conce
pts: camera, light and objects.
... <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: playcanvas demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <scri
pt src="playcanvas-latest.js"></scri
pt> <canvas id="application-canvas"></canvas> <scri
pt> var canvas = document.getelementbyid("application-canvas"); /* all our javascri
pt code goes here */ </scri
pt> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element that playcanvas will use to 100% so that it will...
...the first <scri
pt> element includes the playcanvas library in the page; we will write our example code in the second one.
...And 4 more matches
Desktop gamepad controls - Game development
the gamepad api gives you the ability to connect a gamepad to your computer and detect pressed buttons directly from the javascri
pt code thanks to the browsers implementing such feature.
... pure javascri
pt approach let's think about implementing pure javascri
pt gamepad controls in our little controls demo first to see how it would work.
... you could also create a helper function that would assign proper names to the listed buttons, so for example istead of checking out if gamepadbuttonpressedhandler(3) is pressed, you could do a more descri
ptive check: gamepadbuttonpressedhandler('dpad-right').
...And 4 more matches
Desktop mouse and keyboard controls - Game development
note: the ca
ptain rogers: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascri
pt.
... pure javascri
pt approach let's think about implementing pure javascri
pt keyboard/mouse controls in the game first to see how it would work.
... you can see this example in action online at end3r.github.io/javascri
pt-game-controls and the full source code can be found at github.com/end3r/javascri
pt-game-controls.
...And 4 more matches
Accessibility - Learn web development
learning some html, css, and javascri
pt is useful if you want to become a web developer.
...to help you achieve this, this module will cover general best practices (which are demonstrated throughout the html, css, and javascri
pt topics), cross browser testing, and some tips on enforcing accessibility from the start.
... sites should also not cause harm: web features like motion can cause migraines or epile
ptic seizures.
...And 4 more matches
Debugging CSS - Learn web development
the browser will also normalize all of the html, and the dom will also show any changes made by javascri
pt.
... the layout view shows you a diagram of the box model on the selected element, along with a descri
ption of the properties and values that change how the element is laid out.
... this includes a descri
ption of properties that you may not have explicitly used on the element, but which do have initial values set.
...And 4 more matches
Pseudo-classes and pseudo-elements - Learn web development
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 em
pty string, which can then be styled just like any element on the page.
... in this next example, we have added an em
pty string using the ::before pseudo-element.
... pseudo-classes selector descri
ption :active matches when the user activates (for example clicks on) an element.
...And 4 more matches
Legacy layout methods - Learn web development
prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand the fundamental conce
pts behind the grid layout systems used prior to css grid layout being available in browsers.
... layout and grid systems before css grid layout it may seem surprising to anyone coming from a design background that css didn’t have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-o
ptimal methods to create grid-like designs.
...working through the process of creating a grid with floats shows you how this works and also introduces some more advanced conce
pts to build on the things you learned in the lesson on floats and clearing.
...And 4 more matches
Styling lists - Learn web development
throughout this article, we'll look at unordered, ordered, and descri
ption lists — all have styling features that are similar, and some that are particular to their type of list.
...for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <ol> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> <h2>ingredient descri
ption list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <dl> <dt>hummus</dt> <dd>a thick dip/sauce generally made from chick peas blended with tahini, lemon juice, salt, garlic, and other ingredients.</dd> <dt>pita</dt> <dd>a soft, slightly leavened flatbread.</dd> <dt>hal...
...hythm), and the same horizontal spacing as each other (you can see the finished styled example on github, and find the source code too.) the css used for the text styling and spacing is as follows: /* general styles */ html { font-family: helvetica, arial, sans-serif; font-size: 10px; } h2 { font-size: 2rem; } ul,ol,dl,p { font-size: 1.5rem; } li, p { line-height: 1.5; } /* descri
ption list styles */ dd, dt { line-height: 1.5; } dt { font-weight: bold; } the first rule sets a sitewide font and a baseline font size of 10px.
...And 4 more matches
How much does it cost to do something on the Web? - Learn web development
if you're only writing simple html, css, and javascri
pt, go with a simple editor.
... if you want to install an (s)ftp client, there are several reliable and free o
ptions: for example, filezilla for all platforms, winscp for windows, cyberduck for mac or windows, and more.
... because ftp is inherently insecure, you should make sure to use sftp — the secure, encry
pted version of ftp that most hosting sites you'll deal with these days will offer by default — or another secure solution like rsync over ssh.
...And 4 more matches
The HTML5 input types - Learn web development
we'll note any exce
ptions.
... the below screenshots show a non-em
pty search field in firefox 71, safari 13, and chrome 79 on macos, and edge 18 and chrome 79 on windows 10.
...if the range is too large for incremental increases to make sense (such as usa zip codes, which range from 00001 to 99999), the tel type might be a better o
ption; it provides the numeric keypad while forgoing the number's spinner ui feature.
...And 4 more matches
Example 4 - Learn web development
change states html content <form class="no-widget"> <select name="myfruit"> <o
ption>cherry</o
ption> <o
ption>lemon</o
ption> <o
ption>banana</o
ption> <o
ption>strawberry</o
ption> <o
ption>apple</o
ption> </select> <div class="select"> <span class="value">cherry</span> <ul class="o
ptlist hidden"> <li class="o
ption">cherry</li> <li class="o
ption">lemon</li> <li class="o
ption">banana</li> <li class="o
ption">strawberry</li> <li class="o
ption">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles ...
...*/ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .o
ptlist { position: absolute; top : 100%; left : 0; } .select .o
ptlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background :...
...tical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .o
ptlist { z-index : 2; list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .o
ption { ...
...And 4 more matches
Example 5 - Learn web development
change states html content <form class="no-widget"> <select name="myfruit"> <o
ption>cherry</o
ption> <o
ption>lemon</o
ption> <o
ption>banana</o
ption> <o
ption>strawberry</o
ption> <o
ption>apple</o
ption> </select> <div class="select" role="listbox"> <span class="value">cherry</span> <ul class="o
ptlist hidden" role="presentation"> <li class="o
ption" role="o
ption" aria-selected="true">cherry</li> <li class="o
ption" role="o
ption">lemon</li> <li class="o
ption" role="o
ption">banana</li> <li class="o
ption" role="o
ption">strawberry</li> <li class="o
ption" role="o
ption">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { ...
...position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .o
ptlist { position: absolute; top : 100%; left : 0; } .select .o
ptlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radi...
...tical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .o
ptlist { z-index : 2; list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .o
ption { ...
...And 4 more matches
Dealing with files - Learn web development
the most common things we'll have on any website project we create are an index html file and folders to contain images, style files, and scri
pt files.
... scri
pts folder: this folder will contain all the javascri
pt code used to add interactive functionality to your site (e.g.
...create a folder called scri
pts, inside your test-site folder.
...And 4 more matches
HTML basics - Learn web development
the closing tag: this is the same as the opening tag, exce
pt that it includes a forward slash before the element name.
... em
pty elements some elements have no content and are called em
pty elements.
...this includes things like keywords and a page descri
ption that you want to appear in search results, css to style our content, character set declarations and more.
...And 4 more matches
JS_NewUCString
syntax jsstring * js_newucstring(jscontext *cx, char16_t *chars, size_t length); jsstring * js_newstring(jscontext *cx, char *buf, size_t length); // obsolete since jsapi 1.8.5 name type descri
ption cx jscontext * the context in which to create the new string.
...the javascri
pt engine ado
pts the buffer.
... descri
ption js_newstring creates and returns a new string, using the memory starting at buf and ending at buf + length as the character storage.
...And 4 more matches
JS_PreventExtensions
attem
pts to forbid the addition of any new properties to an object.
... syntax // added in spidermonkey 45 bool js_preventextensions(jscontext *cx, js::handleobject obj, js::objectopresult &result); // obsolete since jsapi 39 bool js_preventextensions(jscontext *cx, js::handleobject obj, bool *succeeded); name type descri
ption cx jscontext * the context.
...obsolete since jsapi 39 descri
ption all javascri
pt objects recognize the conce
pt of extensibility: whether new properties may be added to the object.
...And 4 more matches
Handling Mozilla Security Bugs
this work is separate from the work of developers adding new security features (cry
ptographically-based or otherwise) to mozilla, although obviously many of the same people will be involved in both sets of activities.
...we have attem
pted to create a compromise scheme for how the mozilla project will handle reports of security vulnerabilities.
... general policies mozilla.org has ado
pted the following general policies for handling bug reports related to security vulnerabilities: security bug reports can be treated as special and handled differently than "normal" bugs.
...And 4 more matches
Gecko events
event_descri
ption_change an object's descri
ption property has changed.
... is supported: yes event_ca
pture_start a window has received mouse ca
pture.
... is supported: no event_ca
pture_end a window has lost mouse ca
pture.
...And 4 more matches
Places Developer Guide
however, firefox developers can take advantage of several helper apis that are browser-specific: fuel - a collection of wrapper apis for easing access to a number of firefox utilities and services nsiplacestransactionsservice - a firefox service for modifying bookmarks in a transactional manner, providing facilities for undo/redo places utilities for javascri
pt - accessors and helper functions for firefox and extensions creating bookmarks, folders and other items creating a bookmark // create an nsiuri for the url to be bookmarked.
...var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); var query = history.getnewquery(); query.setfolders([myfolderid], 1); var result = history.executequery(query, history.getnewqueryo
ptions()); // the root property of a query result is an object representing the folder you specified above.
...ce;1"] .getservice(ci.nsinavhistoryservice); var query = history.getnewquery(); // specify folders to be searched var folders = [bookmarks.toolbarfolder, bookmarks.bookmarksmenufolder, bookmarks.unfiledbookmarksfolder]; query.setfolders(folders, folders.length); // specify terms to search for, matches against title, url and tags query.searchterms = "firefox"; var o
ptions = history.getnewqueryo
ptions(); o
ptions.querytype = o
ptions.query_type_bookmarks; var result = history.executequery(query, o
ptions); // the root property of a query result is an object representing the folder you specified above.
...And 4 more matches
places.sqlite Database Troubleshooting
how to (try to) recover from a corru
pt places.sqlite sometimes after a firefox/aurora/nightly upgrade, history disappears, but bookmarks are at their place.
... in the profile folder a places.sqlite-corru
pt file has been created.
... in some cases, this procedure may allow you to recover the corru
pt file along with all of its contents (history).
...And 4 more matches
Finishing the Component
before attem
pting to use unfrozen interfaces, you should contact the developers who are responsible for the code you're trying to use (i.e., module owners) and ask them how best to do what you are trying to do.
...tion callback function so that it looks like this: static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscom
ptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; nscom
ptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); if (ns_failed(rv)) return rv; char* previous =...
...but regardless of how o
ptimized the implementation is with respect to is memory usage, a heap allocation will be made for every xpcom object created.
...And 4 more matches
Components.utils.reportError
components.utils.reporterror reports a javascri
pt error object to the error console, and returns.
... it is meant for use by extension developers who have exce
ption handler blocks which want to "eat" an exce
ption, but still want to report it to the console.
... it must be called with one parameter, usually an object which was caught by an exce
ption handler.
...And 4 more matches
IAccessibleAction
other-licenses/ia2/accessibleaction.idlnot scri
ptable this interface gives access to actions that can be executed for accessible objects.
...each action can be performed or queried for a name, descri
ption or associated key bindings.
...method overview [propget] hresult descri
ption([in] long actionindex, [out] bstr descri
ption ); hresult doaction([in] long actionindex ); [propget] hresult keybinding([in] long actionindex, [in] long nmaxbindings, [out, size_is(,nmaxbindings), length_is(, nbindings)] bstr keybindings, [out] long nbindings ); [propget] hresult localizedname([in] long actionindex, [out] bstr localizedname ); hresult nactions([out,retval] long naction...
...And 4 more matches
amIInstallTrigger
toolkit/mozapps/extensions/amiinstalltrigger.idlscri
ptable called when an install completes or fails.
... 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, [o
ptional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [o
ptional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility.
... constant value descri
ption skin 1 locale 2 content 4 package 7 methods enabled() tests if installation is enabled.
...And 4 more matches
mozIThirdPartyUtil
netwerk/base/public/mozithirdpartyutil.idlscri
ptable utility functions for determining whether a given uri, channel, or window hierarchy is third party with respect to a known uri.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean isthirdpartychannel(in nsichannel achannel, [o
ptional] in nsiuri auri); boolean isthirdpartyuri(in nsiuri afirsturi, in nsiuri aseconduri); boolean isthirdpartywindow(in nsidomwindow awindow, [o
ptional] in nsiuri auri); methods isthirdpartychannel() determine whether the given channel and its content window hierarchy is third party.
...boolean isthirdpartychannel( in nsichannel achannel, in nsiuri auri o
ptional ); parameters achannel the channel associated with the load.
...And 4 more matches
nsIChannel
netwerk/base/nsichannel.idlscri
ptable this interface allows clients to construct 'get' requests for specific protocols, and manage them in a uniform way.
... method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type descri
ption contentcharset acstring the character set of the channel's content if available and if applicable.
... interfaces commonly requested include: nsiprogresseventsink, nsiprom
pt, and nsiauthprom
pt / nsiauthprom
pt2.
...And 4 more matches
nsIContentFrameMessageManager
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisyncmessagesender this interface provides the environment for scri
pts that are loaded into content frames using the nsiframescri
ptloader interface.
... it enables these scri
pts to receive messages from the chrome process and send messages back to the chrome process.
... frame scri
pts can send either synchronous or asynchronous messages to the chrome process: for details on these messaging apis see the documentation for the nsicontentframemessagemanager's parent classes nsisyncmessagesender and nsimessagesender.
...And 4 more matches
nsIDownloadManagerUI
toolkit/components/downloads/public/nsidownloadmanagerui.idlscri
ptable this interface is used to implement the user interface for the download manager.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([o
ptional] in nsiinterfacerequestor awindowcontext, [o
ptional] in unsigned long aid, [o
ptional] in short areason); attributes attribute type descri
ption visible boolean true if the download manager ui is visible; otherwise false.
... constants constant value descri
ption reason_user_interacted 0 when opening the download manager user interface, this value indicates that it's being done at the user's request.
...And 4 more matches
nsIEditor
« xpcom api reference editor/nsieditor.idlscri
ptable provides methods and attributes used when editing page content.
... 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscri
pt] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal void deleteselection(in short action, in short stripwrappers); document in...
...: // flags are declared in base/public/nsidocumentencoder.idl // outputselectiononly = 1, outputformatted = 2, // outputraw = 4, outputbodyonly = 8, // outputpreformatted = 16, outputwrap = 32, // outputformatflowed = 64, outputabsolutelinks = 258, // outputencodew3centities = 256, outputcrlinebreak = 512, // outputlflinebreak = 1024, outputnoscri
ptcontent = 2048, // outputnoframescontent = 4096, outputnoformattinginpre = 8192, // outputencodebasicentities=16384, outputencodelatin1entities=32768, // outputencodehtmlentities=65536, outputpersistnbsp=131072 editorapi.outputtostring('text/html', 2); editorapi.outputtostring('text/plain', 4); // output the body tag, body children and the html end tag (</html>).
...And 4 more matches
XRSession.updateRenderState() - Web APIs
baselayer o
ptional an xrwebgllayer object from which the webxr compositor will obtain imagery.
... de
pthfar o
ptional a floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur.
... all rendering will take place between the distances specified by de
pthnear and de
pthfar.
...And 4 more matches
Basic form hints - Accessibility
-3" type="checkbox" value="pinot-grigio"/> <label for="wine-3">pinot grigio</label> </li> <li> <input id="wine-4" type="checkbox" value="gewurztraminer"/> <label for="wine-4">gewürztraminer</label> </li> </ul> </form> labeling with aria the html <label> element is appropriate for form-related elements, but many form controls are implemented as a dynamic javascri
pt widget, using <div>s or <span>s.
... <h3 id="rg1_label">lunch o
ptions</h3> <ul class="radiogroup" id="rg1" role="radiogroup" aria-labelledby="rg1_label"> <li id="r1" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tabindex="0" role="r...
...adio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> describing with aria form controls sometimes have a descri
ption associated with them, in addition to the label.
...And 4 more matches
Web accessibility for seizures and physical reactions - Accessibility
this article introduces conce
pts behind making web content accessibile for those with vestibular disorders, and how to measure and prevent content leading to seizures and / or other physical reactions.
...web technologies that use video, animated gifs, animated pngs, animated svgs, canvas, and css or javascri
pt animations are all capable of content that can induce seizures or other incapacitating physical reactions.
...the epilepsy foundation's article, photosensitivity and seizures, provides a list of triggers that may cause seizures in photosensitive people; here's an excer
pt from that list: television screens or computer monitors due to the flicker or rolling images.
...And 4 more matches
symbols - CSS: Cascading Style Sheets
the symbols css descri
ptor is used to specify the symbols that the specified counter system will use to construct counter representations.
... syntax the symbols descri
ptor is specified as one or more <symbol>s.
...it is not yet implemented.) <custom-ident> descri
ption a symbol can be a string, image, or identifier.
...And 4 more matches
@counter-style - CSS: Cascading Style Sheets
syntax descri
ptors each @counter-style is identified by a name and has a set of descri
ptors.
... suffix specifies, similar to the prefix descri
ptor, a symbol that is appended to the marker representation.
...for example if you want the counters to start at 01 and go through 02, 03, 04 etc, then the pad descri
ptor is to be used.
...And 4 more matches
font-display - CSS: Cascading Style Sheets
the font-display descri
ptor determines how a font face is displayed based on whether and when it is downloaded and ready to use.
... syntax /* keyword values */ font-display: auto; font-display: block; font-display: swap; font-display: fallback; font-display: o
ptional; values auto the font display strategy is defined by the user agent.
... o
ptional gives the font face an extremely small block period and no swap period.
...And 4 more matches
Using CSS transforms - CSS: Cascading Style Sheets
by modifying the coordinate space, css transforms change the shape and position of the affected content without disru
pting the normal document flow.
... html <section> <figure> <ca
ption><code>perspective-origin: top left;</code></ca
ption> <div class="container"> <div class="cube potl"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </figure> <figure> <ca
ption><code>perspective-or...
...igin: top;</code></ca
ption> <div class="container"> <div class="cube potm"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> <figure> <ca
ption><code>perspective-origin: top right;</code></ca
ption> <div class="container"> <div class="cube potr"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </figure> <figure> <ca
ption><code>perspective-origin: left;</code></ca
ption> <div cla...
...And 4 more matches
Mozilla CSS extensions - CSS: Cascading Style Sheets
a -moz-animation [prefixed version still acce
pted] -moz-animation-delay [prefixed version still acce
pted] -moz-animation-direction [prefixed version still acce
pted] -moz-animation-duration [prefixed version still acce
pted] -moz-animation-fill-mode [prefixed version still acce
pted] -moz-animation-iteration-count [prefixed version still acce
pted] -moz-animation-name [prefixed version still acce
pted] -moz-animation-play-state ...
... [prefixed version still acce
pted] -moz-animation-timing-function [prefixed version still acce
pted] -moz-appearance b -moz-backface-visibility [prefixed version still acce
pted] -moz-background-clipobsolete since gecko 2 -moz-background-originobsolete since gecko 2 -moz-background-inline-policyobsolete since gecko 32 [superseded by the standard version box-decoration-break] -moz-background-sizeobsolete since gecko 2 -moz-border-end [superseded by the standard version border-inline-end] -moz-border-end-color [superseded by the standard version border-inline-end-color] -moz-border-end-style [superseded by the standard version border-inline-end-style] -moz-border-end-width [superseded by the standard version border-inline-end-width] -moz-border-image -moz-borde...
...r-start [superseded by the standard version border-inline-start] -moz-border-start-color [superseded by the standard version border-inline-start-color] -moz-border-start-style [superseded by the standard version border-inline-start-style] -moz-border-start-width [superseded by the standard version border-inline-start-width] -moz-box-sizing [prefixed version still acce
pted] c clip-path [applying to more than svg] -moz-column-count [prefixed version still acce
pted] -moz-column-fill [prefixed version still acce
pted] -moz-column-gap [prefixed version still acce
pted] -moz-column-width [prefixed version still acce
pted] -moz-column-rule [prefixed version still acce
pted] -moz-column-rule-width [prefixed version still acce
pted] -moz-column-rule-style [prefi...
...And 4 more matches
CSS reference - CSS: Cascading Style Sheets
you can also browse key css conce
pts and a list of selectors organized by type.
... keyword index note: the property names in this index do not include the javascri
pt names where they differ from the css standard names.
...order-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()ca
ption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::...
...And 4 more matches
filter - CSS: Cascading Style Sheets
exce
pt where noted, the functions that take a value expressed with a percent sign (as in 34%) also acce
pt the value expressed as decimal (as in 0.34).
...the parameter is specified as a css length, but does not acce
pt percentage values.
... filter: contrast(200%) <svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="contrast"> <fecomponenttransfer> <fefuncr type="linear" slope="[amount]" interce
pt="-(0.5 * [amount]) + 0.5"/> <fefuncg type="linear" slope="[amount]" interce
pt="-(0.5 * [amount]) + 0.5"/> <fefuncb type="linear" slope="[amount]" interce
pt="-(0.5 * [amount]) + 0.5"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" ...
...And 4 more matches
Content categories - Developer guides
elements belonging to this category are <base>, <command>, <link>, <meta>, <noscri
pt>, <scri
pt>, <style> and <title>.
...>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscri
pt>, <object>, <ol>, <output>, <p>, <picture>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <scri
pt>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr> and text.
... elements belonging to this category are <abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <dfn>, <em>, <embed>, <i>, <iframe>, <img>, <input>, <kbd>, <keygen>, <label>, <mark>, <math>, <meter>, <noscri
pt>, <object>, <output>, <picture>, <progress>, <q>, <ruby>, <samp>, <scri
pt>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <time>, <var>, <video>, <wbr> and plain text (not only consisting of white spaces characters).
...And 4 more matches
A hybrid approach - Developer guides
the most important conce
pt to remember is that server-side and client-side techniques can be combined to fit your situation.
...if your mobile and desktop use cases are similar enough, this is definitely the preferred o
ption for layout changes.
... luckily, we aren’t technically constrained to using client-side techniques here: another o
ption is to use server-side user-agent detection to show the user the proper content.
...And 4 more matches
Separate sites for mobile and desktop - Developer guides
the good the first o
ption is the most popular by far: use user-agent detection to route users on phones to a separate mobile site, typically at m.example.com.
... in a nutshell, this technique uses server-side logic to solve all three goals of mobile web development at once — if the user’s browser looks like it’s on a phone, you serve them mobile content, formatted for their phone and o
ptimized for speed.
... conce
ptually simple, this is the easiest o
ption to add to an existing site, especially if you are using a cms or web application that supports templates.
...And 4 more matches
Mobile Web Development - Developer guides
designing for mobile devices mobile devices have quite different hardware characteristics compared with desktop or la
ptop computers.
... working with small screens responsive web design is a term for a set of techniques that enables your web site to ada
pt its layout as its viewing environment — most obviously, the size and orientation of the screen — changes.
... it includes techniques such as: fluid css layouts, to make the page ada
pt smoothly as the browser window size changes the use of media queries to conditionally include css rules appropriate for the device screen width and height the viewport meta tag instructs the browser to display your site at the appropriate scale for the user's device.
...And 4 more matches
disabled - HTML: Hypertext Markup Language
the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <o
ptgroup>, <o
ption>, <select>, <textarea> and <input>.
...if declared on an <o
ptgroup>, the select is still interactive (unless otherwise disabled), but none of the items in the o
ption group are selectable.
... note: if a <fieldset> is disabled, the descendant form controls are all disabled, with the exce
ption of form controls within the <legend>.
...And 4 more matches
JS_GetFunctionObject
syntax jsobject * js_getfunctionobject(jsfunction *fun); name type descri
ption fun jsfunction * pointer to a js function.
... descri
ption js_getfunctionobject returns the javascri
pt function object for a specified function pointer, fun.
...in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be exposed to scri
pt.
...And 3 more matches
JS_GetGlobalObject
(in javascri
pt, global variables are stored as properties of the global object.) syntax jsobject * js_getglobalobject(jscontext *cx); name type descri
ption cx jscontext * the context from which to retrieve the global object.
... descri
ption this function is obsolete: use js_getglobalforobject or js_getglobalforscopechain instead.
... the conce
pt of a global object belonging to a context will likely be phased out in future versions of spidermonkey.
...And 3 more matches
JS_GetReservedSlot
syntax // added in spidermonkey 42 js::value js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, js::value v); // obsolete since spidermonkey 42 jsval js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, jsval v); name type descri
ption obj jsobject * an object that has reserved slots.
... descri
ption if a jsclass has jsclass_has_reserved_slots(n) in its flags, with n > 0, or has a non-null jsclass.reserveslots callback, then objects of that class have n reserved slots in which the application may store data.
... these fields are not directly exposed to scri
pts.
...And 3 more matches
JS_LookupProperty
pertywithflags(jscontext *cx, js::handleobject obj, const char *name, unsigned flags, js::mutablehandlevalue vp); bool js_lookuppropertywithflagsbyid(jscontext *cx, js::handleobject obj, js::handleid id, unsigned flags, js::mutablehandleobject objp, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
... descri
ption the functions js_lookupproperty, js_lookupucproperty, js_lookuppropertybyid, js_lookuppropertywithflags, and js_lookuppropertywithflagsbyid search a specified object, obj, for a property with the given name.
... on error or exce
ption (such as running out of memory during the search), the return value is false, and the value left in *vp is undefined.
...And 3 more matches
JS_NewObject
creates a new javascri
pt object.
...oto); // obsolete since spidermonkey 38 jsobject * js_newobject(jscontext *cx, const jsclass *clasp, js::handle<jsobject*> proto, js::handle<jsobject*> parent); jsobject * js_newobjectwithgivenproto(jscontext *cx, const jsclass *clasp, js::handle<jsobject*> proto, js::handle<jsobject*> parent); // added in spidermonkey 1.8 name type descri
ption cx jscontext * the context in which to create the new object.
...if this is null, an ordinary javascri
pt object is created.
...And 3 more matches
JS_NewStringCopyZ
create a new javascri
pt string based on a null-terminated c string.
... syntax jsstring * js_newstringcopyz(jscontext *cx, const char *s); jsstring * js_newucstringcopyz(jscontext *cx, const char16_t *s); name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
... descri
ption js_newstringcopyz allocates space for a new javascri
pt string and its underlying storage, and then copies the contents of a null-terminated character array, s, into the new string.
...And 3 more matches
JS_SealObject
obsolete since javascri
pt 1.8.5this feature is obsolete.
... as of spidermonkey 1.8.5, js_sealobject has been removed from the jsapi, because ecmascri
pt 5 includes a "seal" conce
pt (namely, that of object.seal) which is quite different from that of js_sealobject.
... moreover, js_sealobject's exact semantics are subtly incompatible with ecmascri
pt.
...And 3 more matches
JS_SetGCCallback
syntax void js_setgccallback(jsruntime *rt, jsgccallback cb, void *data); jsgccallback js_setgccallback(jscontext *cx, jsgccallback cb); // obsolete since jsapi 13 jsgccallback js_setgccallbackrt(jsruntime *rt, jsgccallback cb); // obsolete since jsapi 13 name type descri
ption cx jscontext * (for the old js_setgccallback) any jscontext.
... callback syntax typedef enum jsgcstatus { jsgc_begin, jsgc_end, jsgc_mark_end, // obsolete since jsapi 13 jsgc_finalize_end // obsolete since jsapi 13 } jsgcstatus; typedef void (* jsgccallback)(jsruntime *rt, jsgcstatus status, void *data); name type descri
ption cx jscontext * the context in which garbage collection is happening.
... descri
ption js_setgccallback sets a callback function which the garbage collector calls at several points during garbage collection.
...And 3 more matches
JS_SetGCZeal
syntax void js_setgczeal(jscontext *cx, uint8_t zeal, uint32_t frequency); name type descri
ption cx jscontext * a context.
... descri
ption js_setgczeal sets the level of additional garbage collection to perform for a runtime, for the purpose of finding or reproducing bugs.
... there are several different levels which have different functions: zeal level descri
ption 0 normal amount of collection.
...And 3 more matches
JS_ValueToString
syntax jsstring * js_valuetostring(jscontext *cx, jsval v); name type descri
ption cx jscontext * the context in which to perform the conversion.
... descri
ption js_valuetostring converts a specified javascri
pt value, v, to a string.
...the result is like the javascri
pt expression ""+v.
...And 3 more matches
Thread Sanitizer
adjusting the build configuration create the build configuration file .mozconfig with the following content in your mozilla-central directory: mk_add_o
ptions moz_objdir=@topsrcdir@/objdir-ff-tsan mk_add_o
ptions moz_make_flags=-j12 # enable llvm specific code and build workarounds ac_add_o
ptions --enable-thread-sanitizer # if clang is already in your $path, then these can simply be: # export cc=clang # export cxx=clang++ export cc="/path/to/clang" export cxx="/path/to/clang++" # llvm-symbolizer displays much more complete backtraces when data...
...# note: the use of this flag causes clang to automatically link the tsan runtime :) export ldflags="-fsanitize=thread -fpic -pie" # these three are required by tsan ac_add_o
ptions --disable-jemalloc ac_add_o
ptions --disable-crashreporter ac_add_o
ptions --disable-elf-hack # keep symbols to symbolize tsan traces export moz_debug_symbols=1 ac_add_o
ptions --enable-debug-symbols ac_add_o
ptions --disable-install-strip # settings for an o
pt build ac_add_o
ptions --enable-o
ptimize="-o2 -gline-tables-only" ac_add_o
ptions --disable-debug starting the build process now you st...
... building only the javascri
pt shell if you want to build only the javascri
pt shell instead of doing a full firefox build, the build scri
pt below will probably help you to do so.
...And 3 more matches
WebReplayRoadmap
static type integration (not yet implemented) static type systems like flow and typescri
pt are great and really useful for managing an app's codebase, but they are unsound by design, and it is pretty easy to satisfy the type system and yet have different types in practice.
... an alternate use of the types that appear in practice would be to provide seed information for automatically populating the types in an app that is being converted to use flow or typescri
pt.
... type profiling (not yet implemented) the types that appear in practice have a large effect on how well the associated code can be o
ptimized by jits.
...And 3 more matches
XUL Accessibility
at api general rules this section holds some rules applied to generating accessible name and descri
ption.
... aggregating the text from element subtree if the child node is hidden then it's ignored exce
pting the case when the element used as label is hidden itself if the child node is text node then its rendered value is appended if the child node is element then if it implements nsidomxullabeledcontrolelement then the value of label property is appended otherwise if it's a label element then then value attribute is appended otherwise append toolti
ptext attribute append the accessible value searching specific element in neighbour of the element search inside the element subtree go up through parents (max level is 5) and search inside theirs subtrees if the element is anonymous then search in whole anonymous subtree, here the attribute anonid is used instead of id attribute accessible prop...
...name the following rules to generate accessible name are applied: check aria-labelledby attribute, name is generated from elements pointed by aria-labelledby attribute <descri
ption id="descr1">label1</descri
ption> <descri
ption id="descr2">label2</descri
ption> <textbox aria-labelledby="descr1 descr2" /> if the element implements nsidomxullabeledcontrolelement or nsidomxulselectcontrolitemelement interface then it is used label property if the element doesn't implement nsidomxulselectcontrolelement then label attribute is used if neighbour of the element has label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content...
...And 3 more matches
Using the Places annotation service
setting an annotation the annotation provides a variety of scri
ptable and non-scri
ptable setters for annotations on both pages and on items in the places database (see nsiannotationservice.idl for the exact declarations).
...he places database: setitemannotationstring(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint32(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint64(aitemid, aname, avalue, aflags, aexpiration); setitemannotationdouble(aitemid, aname, avalue, aflags, aexpiration); setitemannotationbinary(aitemid, aname, avalue, adatalen, aflags, aexpiration); from javascri
pt there are two simple function to perform all of these operations: setpageannotation(auri, aname, avalue, aflags, aexpiration); setitemannotation(aitemid, aname, avalue, aflags, aexpiration); these annotations all take similar parameters: uri or itemid: this is the nsiuri of the page to annotate, or for items in the places database, the id of the item.
...; getpageannotationint64(auri, aname); getpageannotationdouble(auri, aname); getpageannotationbinary(auri, aname, adata, adatalen, amimetype); getitemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, aname, adata, adatalen, amimetype); from javascri
pt: getpageannotation(auri, aname); getitemannotation(aitemid, aname); these functions will return/throw ns_error_not_available if the annotation requested does not exist.
...And 3 more matches
Using the Places keywords API
keywords in firefox are currently created through the add keyword for this search contextual menu o
ption in form text fields.
... using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an url the insert() method acce
pts a keyword entry object describing the keyword to insert.
... it has the following properties: keyword: string representing the keyword url: either a url or spec represeting the url to associate to postdata: o
ptional post data string.
...And 3 more matches
nsIFilePicker
widget/nsifilepicker.idlscri
ptable the file picker component is used to display standard user interface for selecting files and directories, as well as for selecting destinations for, and naming, new files.
...picker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type descri
ption addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happens if there is no such conce
pt on the user's platform).
... exce
ptions thrown ns_error_failure if you try to read this attribute.
...And 3 more matches
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscri
ptable provides methods for managing message listeners on local frames.
... method overview void addmessagelistener(in astring amessage, in nsiframemessagelistener alistener, [o
ptional] in boolean listenwhenclosed); void removemessagelistener(in astring amessage, in nsiframemessagelistener alistener); void sendasyncmessage(in astring amessage, in astring json); methods addmessagelistener() adds a message listener to the local frame.
... void addmessagelistener( in astring amessage, in nsiframemessagelistener alistener [o
ptional in boolean listenwhenclosed ); parameters amessage the name of the message for which to add a listener.
...And 3 more matches
nsILoginInfo
toolkit/components/passwordmgr/public/nsilogininfo.idlscri
ptable please add a summary to this article.
...ilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type descri
ption formsubmiturl astring the origin, not url, a form-based login was submitted to.
...non-form logins should specify an em
pty string ("").
...And 3 more matches
nsIMemory
xpcom/base/nsimemory.idlscri
ptable this interface represents a generic memory allocator.
... method overview void
ptr alloc(in size_t size); violates the xpcom interface guidelines void free(in void
ptr
ptr); violates the xpcom interface guidelines void heapminimize(in boolean immediate); boolean islowmemory(); deprecated since gecko 2.0 void
ptr realloc(in void
ptr
ptr, in size_t newsize); violates the xpcom interface guidelines methods alloc allocates a block of memory of a particular size.
... void
ptr alloc( in size_t size ); parameters size the size of the block to allocate.
...And 3 more matches
nsIMemoryReporter
xpcom/base/nsimemoryreporter.idlscri
ptable reports memory usage information for a single area of the software.
...attributes attribute type descri
ption amount print64 the numeric value reported by the memory reporter, specified in the units indicated by the units attribute.
... descri
ption autf8string a human-readable descri
ption of this memory usage report.
...And 3 more matches
nsIMessageListenerManager
dom/base/nsimessagemanager.idlscri
ptable this interface enables clients to listen for messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces.
...to access this service, use: var globalmm = components.classes["@mozilla.org/globalmessagemanager;1"] .getservice(components.interfaces.nsimessagelistenermanager); method overview void addmessagelistener(in astring messagename, in nsimessagelistener listener, [o
ptional] in boolean listenwhenclosed) void removemessagelistener(in astring messagename, in nsimessagelistener listener); void addweakmessagelistener(in astring messagename, in nsimessagelistener listener); void removeweakmessagelistener(in astring messagename, in nsimessageli...
... void addmessagelistener(in astring messagename, in nsimessagelistener listener, [o
ptional] in boolean listenwhenclosed); parameters messagename a string indicating the name of the message to listen for.
...And 3 more matches
nsIMsgFolder
istener); void compact(in nsiurllistener alistener, in nsimsgwindow amsgwindow); void compactall(in nsiurllistener alistener, innsimsgwindow amsgwindow,in nsisupportsarray afolderarray, in boolean acompactofflinealso,in nsisupportsarray aofflinefolderarray); void compactallofflinestores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); void em
ptytrash(in nsimsgwindow amsgwindow, in nsiurllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); ...
...); boolean confirmfolderdeletionforfilter(in nsimsgwindow msgwindow); void alertfilterchanged(in nsimsgwindow msgwindow); void throwalertmsg(in string msgname, in nsimsgwindow msgwindow); astring getstringwithfoldernamefrombundle(in string msgname); void notifycompactcompleted(); long comparesortkeys(in nsimsgfolder msgfolder); [noscri
pt] void getsortkey(out octet_
ptr key, out unsigned long length); boolean callfilterplugins(in nsimsgwindow amsgwindow); acstring getstringproperty(in string propertyname); void setstringproperty(in string propertyname, in acstring propertyvalue); boolean isancestorof(in nsimsgfolder folder); boolean containschildnamed(in astring name); nsimsgfol...
...void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfrommessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abytestoread, in long amaxoutputlen, in boolean acompressquotes); attributes attribute type descri
ption supportsoffline boolean readonly offlinestoreoutputstream nsioutputstream readonly offlinestoreinputstream nsiinputstream readonly retentionsettings nsimsgretentionsettings downloadsettings nsimsgdownloadsettings sortorder long used for order in the folder pane, folder pickers, etc.
...And 3 more matches
nsIMsgIdentity
ibute(in string name); void setcharattribute(in string name, in acstring value); boolean getboolattribute(in string name); void setboolattribute(in string name, in boolean value); long getintattribute(in string name); void setintattribute(in string name, in long value); astring tostring(); attributes attribute type descri
ption identityname astring fullname astring user's full name, i.e.
...john@doe.com replyto astring o
ptional replyto address, i.e.
... johnnospam@doe.com organization astring o
ptional organization composehtml boolean should we compose with html by default?
...And 3 more matches
nsIMsgSearchSession
ib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); long countsearchscopes(); void getnthsearchscope(in long which,out nsmsgsearchscopevalue scopeid, out nsimsgfolder folder); void addscopeterm(in nsmsgsearchscopevalue scope, in nsimsgfolder folder); void adddirectoryscopeterm(in nsmsgsearchscopevalue scope); void clearscopes(); [noscri
pt] boolean scopeusescustomheaders(in nsmsgsearchscopevalue scope, in void
ptr selection, in boolean forfilters); boolean isstringattribute(in nsmsgsearchattribvalue attrib); void addallscopes(in nsmsgsearchscopevalue attrib); void search(in nsimsgwindow awindow); void interru
ptsearch(); void pausesearch(); void resumesearch(); [noscri
pt]...
... nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in void
ptr param); [noscri
pt] void addresultelement(in nsmsgresultelement element); boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); void addsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); attributes attribute type descri
ption searchterms nsisupportsarray readonly: numsearchterms unsigned long readonly: runningada
pter nsimsgsearchada
pter readonly: searchparam void
ptr not scri
ptable and readonly: searchtype nsmsgsearchtype readonly: numresults long readonly: window nsimsgwindow constants name value descri
ption boo...
... [noscri
pt] boolean scopeusescustomheaders(in nsmsgsearchscopevalue scope, in void
ptr selection, in boolean forfilters); parameters scope selection could be a folder or server based on scope forfilters isstringattribute() use this to determine if your attribute is a string attribute.
...And 3 more matches
nsINavBookmarkObserver
toolkit/components/places/nsinavbookmarksservice.idlscri
ptable this interface is an observer for bookmark changes.
...if this string is em
pty, all properties have been deleted.
... in this situation, you should not attem
pt to get any properties, since this will result in the automatic regeneration of properties that will then be leaked into the database, causing trouble later.
...And 3 more matches
nsINavHistoryObserver
toolkit/components/places/nsinavhistoryservice.idlscri
ptable this interface is similar to the nsirdfobserver class, but is used to observe interactions on the global history.
...rtime avisittime, in boolean awholeentry); obsolete since gecko 2.0 void ontitlechanged(in nsiuri auri, in astring apagetitle); void onvisit(in nsiuri auri, in long long avisitid, in prtime atime, in long long asessionid, in long long areferringid, in unsigned long atransitiontype, in acstring aguid, out unsigned long aadded); constants constant value descri
ption attribute_favicon 3 the page's favicon changed.
...it's important to note that there is a difference between an em
pty title and a null title.
...And 3 more matches
nsIParserUtils
parser/html/nsiparserutils.idlscri
ptable provides non-web html parsing functionality to firefox extensions and xulrunner applications.
... method overview astring converttoplaintext(in astring src, in unsigned long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value descri
ption sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes.
... at present, sanitizing css syntax in svg presentational attributes is not supported, so this o
ption flattens out svg.
...And 3 more matches
nsIPlacesImportExportService
toolkit/components/places/nsiplacesimportexportservice.idlscri
ptable provides methods for exporting places data.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) in the past, this interface also offered methods for importing places data, but those methods are now part of the bookmarkhtmlutils.jsm javascri
pt code module.
... the interface name has been ke
pt for compatibility reasons for code using the export service.
...And 3 more matches
nsIProtocolProxyService
netwerk/base/public/nsiprotocolproxyservice.idlscri
ptable this interface provides methods to access information about various network proxies.
...g 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 afilter); constants constant value descri
ption resolve_non_blocking 1<<0 this flag may be passed to the resolve method to request that it fail instead of block the calling thread.
... when this flag is passed to resolve, resolve may throw the exce
ption ns_base_stream_would_block to indicate that it failed due to this flag being present.
...And 3 more matches
nsIPushMessage
dom/interfaces/push/nsipushnotifier.idlscri
ptable a push message sent to a system subscri
ption.
... method overview domstring text(); jsval json(); void binary([o
ptional] 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.
... void binary( [o
ptional] out uint32_t datalen, [array, retval, size_is(datalen)] out uint8_t data ); parameters datalen the data size.
...And 3 more matches
PRLinger
structure used with the pr_socko
pt_linger socket o
ption to specify the time interval (in printervaltime units) to linger on closing a socket if any data remain in the socket send buffer.
... syntax #include <prio.h> typedef struct prlinger { prbool polarity; printervaltime linger; } prlinger; fields the structure has the following fields: polarity polarity of the o
ption's setting: pr_false means the o
ption is off, in which case the value of linger is ignored.
... pr_true means the o
ption is on, and the value of linger will be used to determine how long pr_close waits before returning.
...And 2 more matches
PR ImportTCPSocket
syntax #include "private/pprio.h" prfiledesc* pr_importtcpsocket(prosfd osfd); parameters the function has the following parameters: osfd the native file descri
ptor for the tcp socket to import.
... descri
ption a native tcp socket osfd can be imported into nspr with pr_importtcpsocket.
...the caller needs to understand what nspr will do to the native file descri
ptor and make sure that nspr can use the native file descri
ptor successfully.
...And 2 more matches
PR_WaitCondVar
timeout the value pr_interval_no_timeout requires that a condition be notified (or the thread interru
pted) before it will resume from the wait.
... the value pr_interval_no_wait causes the thread to release the lock, possibly causing a rescheduling within the runtime, then immediately attem
pt to reacquire the lock and resume.
... if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable or the thread was interru
pted with pr_interru
pt), pr_failure.
...And 2 more matches
Threads
this cha
pter describes the basic nspr threading api.
... threading types and constants prthread prthreadtype prthreadscope prthreadstate prthreadpriority prthreadprivatedtor threading functions most of the functions described here acce
pt a pointer to the thread as an argument.
... creating, joining, and identifying threads controlling thread priorities interru
pting and yielding setting global thread concurrency getting a thread's scope creating, joining, and identifying threads pr_createthread creates a new thread.
...And 2 more matches
NSS Key Log Format
key logs can be written by nss so that external programs can decry
pt tls connections.
... wireshark 1.6.0 and above can use these log files to decry
pt packets.
...note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for o
ptimized builds using the makefile (those using gyp via build.sh are not affected).
...And 2 more matches
NSS 3.12.5 release_notes
nss 3.12.5 release notes 2009-12-02 newsgroup: mozilla.dev.tech.cry
pto introduction network security services (nss) 3.12.5 is a patch release for nss 3.12.
...this will cause programs that attem
pt to perform renegotiation to experience failures where they formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf.
... this default setting can also be changed within the application by using the following existing api functions: secstatus ssl_o
ptionset(prfiledesc *fd, print32 o
ption, prbool on) secstatus ssl_o
ptionsetdefault(print32 o
ption, prbool on) there is now a new value for "o
ption", which is: ssl_enable_renegotiation the corresponding new values for ssl_enable_renegotiation are: ssl_renegotiate_never: never renegotiate at all (default).
...And 2 more matches
NSS 3.15.4 release notes
bug 919877 - (cve-2013-1740) when false start is enabled, libssl will sometimes return unencry
pted, unauthenticated data from pr_recv new in nss 3.15.4 new functionality implemented ocsp querying using the http get method, which is the new default, and will fall back to the http post method.
... added the --em
pty-password command-line o
ption to certutil, to be used with -n: use an em
pty password when creating a new database.
... added the -w command-line o
ption to pp: don't wrap long output lines.
...And 2 more matches
NSS 3.15 release notes
tls client applications may enable this via a call to ssl_o
ptionsetdefault(ssl_enable_ocsp_stapling, pr_true); added function secitem_reallocitemv2.
... support for single-operation (eg: not multi-part) symmetric key encry
ption and decry
ption, via pk11_encry
pt and pk11_decry
pt.
... in pk11pub.h pk11_decry
pt - performs decry
ption as a single pkcs#11 operation (eg: not multi-part).
...And 2 more matches
NSS Sample Code Utilities_1
this code shows the following: extract seed from noise file read der encoding from a file extract the password from a text file get the module password print as ascii or hexadecimal sample code #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include <prprf.h> #include "util.h" /* * these utility functions are ada
pted from those found in * the sectool library used by the nss security tools and * other nss test applications.
..._datatoascii(data, len); pr_fprintf(out, "%s", b64data); pr_fprintf(out, "\n"); if (b64data) { port_free(b64data); } } /* * printashex */ void printashex(prfiledesc* out, const unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(em
pty)\n"); return; } for (i = 0; i < len; i++) { if (i != len - 1) { pr_fprintf(out, "%02x:", data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit ...
... char *end; len = port_strlen(cp); if (len < 8) { return pr_false; } end = cp + len; while (cp < end) { unsigned char ch = *cp++; if (!((ch >= 'a') && (ch <= 'z')) && !((ch >= 'a') && (ch <= 'z'))) { return pr_true; } } return pr_false; } /* * getpassword */ char* getpassword(file *input, file *output, char *prom
pt, prbool (*ok)(char *)) { char phrase[200] = {'\0'}; int infd = fileno(input); int istty = isatty(infd); for (;;) { /* prom
pt for password */ if (istty) { fprintf(output, "%s", prom
pt); fflush (output); echooff(infd); } fgets(phrase, sizeof(phrase), input); if (istty) { ...
...And 2 more matches
Hashing - sample 1
*/ /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgeto
pt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> #include <nss.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, ...
...oid; break; } } return hashtag; } /* * newline */ static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printashex */ void printashex(prfiledesc* out, unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(em
pty)\n"); return; } for (i = 0; i < len; i++) { if (i != len - 1) { pr_fprintf(out, "%02x:", data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit ...
... fprintf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* * check for the missing arguments */ static void printmsgandexit(const char *progname, char o
pt) { fprintf(stderr, "%s: o
ption -%c requires an argument\n", progname, o
pt); usage(progname); } #define require_arg(o
pt,value) if (!(value)) printmsgandexit(progname, o
pt) /* * digests a file according to the specified algorithm.
...And 2 more matches
sample1
/* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgeto
pt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag.
...break; } } return hashtag; } /* newline */ static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* printashex */ void printashex(prfiledesc* out, unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(em
pty)\n"); return; } for (i = 0; i < len; i++) { if (i != len - 1) { pr_fprintf(out, "%02x:", data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; ...
...ntf(stderr, ", "); } fprintf(stderr, " (case ignored))\n"); fprintf(stderr, "%-20s define an input file to use (default is stdin)\n", "< input"); fprintf(stderr, "%-20s define an output file to use (default is stdout)\n", "> output"); exit(-1); } /* check for the missing arguments */ static void printmsgandexit(const char *progname, char o
pt) { fprintf(stderr, "%s: o
ption -%c requires an argument\n", progname, o
pt); usage(progname); } #define require_arg(o
pt,value) if (!(value)) printmsgandexit(progname, o
pt) /* digests a file according to the specified algorithm.
...And 2 more matches
nss tech note2
for example, to log the softoken, use: nss_debug_pkcs11_module="nss internal pkcs #11 module" note: in the command prom
pt on windows, do not quote the name of the target module, otherwise the quotes are considered part of the name.
...for o
ptimized builds, nss must be built with the variable debug_pkcs11 set.
...for example, 1024[805ef10]: c_findobjectsinit 1024[805ef10]: hsession = 0x1000001 1024[805ef10]:
ptemplate = 0xbffff410 1024[805ef10]: ulcount = 3 1024[805ef10]: cka_label = localhost.nyc.rr.com [20] 1024[805ef10]: cka_token = ck_true [1] 1024[805ef10]: cka_class = cko_certificate [4] 1024[805ef10]: rv = 0x0 1024[805ef10]: c_findobjects 1024[805ef10]: hsession = 0x1000001 1024[805ef10]: phobject = 0x806d810 1024[805ef10]: ulmaxobjectcount = 16 1024[805ef10]: pulobjectcou...
...And 2 more matches
NSS Tools sslstrength
sslstrength summary a simple command-line client which connects to an ssl-server, and reports back the encry
ption cipher and strength used.
... synopsis 1) sslstrength ciphers 2) sslstrength hostname[:port] [ciphers=xyz] [debug] [verbose] [policy=export|domestic] descri
ption the first form simple lists out the possible ciphers.
...the second form attem
pts to connect to the named ssl host.
...And 2 more matches
NSS_Initialize
descri
ption nss_initialize initializes nss.
...nss_init_o
ptimizespace - o
ptimize for space instead of speed.
...nss_init_pk11reload - ignore the ckr_cry
ptoki_already_initialized error when loading pkcs#11 modules.
...And 2 more matches
sslkey.html
upgraded documentation may be found in the current nss reference key functions cha
pter 6 key functions this cha
pter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with communicator.
... descri
ption nss_init opens the certificate, key, and security module databases that you specify for use with nss.
... descri
ption certificate and key structures are shared objects.
...And 2 more matches
nsCAutoString
left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii ass...
...ignliteral(const char assignliteral(char ado
pt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsfixedcstring data members no public members.
...source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const ...
...And 2 more matches
nsDependentCString
nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
...this is similar to using substring(str, startpos), exce
pt that the resulting string is flat.
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...And 2 more matches
nsFixedCString
nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... methods constructors void nsfixedcstring(char*, pruint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (o
ptional) the length of the string already contained in the buffer parameters char* data pruint32 storagesize void nsfixedcstring(char*, pruint32, pruint32) - source parameters char* data pruint32 storagesize pruint32 length operator= nscstring& operator=(const nscstring&) - source parameters nscstring& str nsacstring_internal& operator=(char) - source parameters char c nsac...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...And 2 more matches
nsFixedString
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... methods constructors void nsfixedstring(prunichar*, pruint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (o
ptional) the length of the string already contained in the buffer parameters prunichar* data pruint32 storagesize void nsfixedstring(prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 storagesize pruint32 length operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters ...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...And 2 more matches
nsXPIDLCString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to ado
pt data allocated with ns_alloc, such as "out string" parameters in xpidl.
...nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char ado
pt replace replaceascii append append...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruint32 countchar(char) const - source parameters char <anonymous> findchar pr...
...And 2 more matches
nsXPIDLString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to ado
pt data allocated with ns_alloc, such as "out string" parameters in xpidl.
... findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char ado
pt replace replaceascii append append...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source countchar pruint32 countchar(prunichar) const - source parameters prunichar <anon...
...And 2 more matches
XPCOM glue classes
this class is typically used to represent ascii or utf-8 character arrays.nsacstring (external)class declarationnsacstring_internalclass declarationnsado
ptingcstringclass declarationnsado
ptingstringclass declarationnsastringthe nsastring abstract class represents a character string composed of double-byte storage units.
...ject that holds a handle to a resource that must be released, typically on destruction of the object.</t>nsautoreftraitsnsautoreftraits<t> is a template class describing traits of resources held by objects of class nsautoref<t> and/or nscountedref<t>.</t>nsautostringclass declarationnsautostring (external)class declarationnscautostringclass declarationnscautostring (external)class declarationnscom
ptrthis 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 resource that must be released, typically on destruction of the object.</t>nscstringclass declarationnscstring externalclass declarationnscstringcontainer (external)class declaration nscstrin...
...these routines allow easy access to xpcom's global nsimemory implementation without having to go through the service manager to get it.nspromiseflatcstringclass declarationnspromiseflatstringclass declarationnsref
ptrref
ptr (formerly known as nsref
ptr, see bug 1207245) is a general class to implement reference counting pointers for objects.
...And 2 more matches
amIWebInstaller
toolkit/mozapps/extensions/amiwebinstaller.idlscri
ptable this interface is used to allow web pages to start installing add-ons.
...hanged in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean installaddonsfromwebpage(in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, [o
ptional] in amiinstallcallback acallback, [o
ptional] in pruint32 ainstallcount); boolean isinstallenabled(in astring amimetype, in nsiuri areferer); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
...boolean installaddonsfromwebpage( in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, in amiinstallcallback acallback, o
ptional in pruint32 ainstallcount o
ptional ); parameters amimetype the mimetype for the add-ons.
...And 2 more matches
mozIAsyncHistory
toolkit/components/places/moziasynchistory.idlscri
ptable this interface allows you to add multiple visits to a single url in a batch.
...s a service: var asynchistory = components.classes["@mozilla.org/browser/history;1"] .getservice(components.interfaces.moziasynchistory); method overview void getplacesinfo(in jsval aplaceidentifiers, in mozivisitinfocallback acallback); void isurivisited(in nsiuri auri, in mozivisitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [o
ptional] in mozivisitinfocallback acallback); methods getplacesinfo() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request.
...void updateplaces( in moziplaceinfo aplaceinfo, in mozivisitinfocallback acallback o
ptional ); parameters aplaceinfo the moziplaceinfo object[s] containing the information to store or update.
...And 2 more matches
mozISpellCheckingEngine
extensions/spellcheck/idl/mozispellcheckingengine.idlscri
ptable this interface represents a spelling checker.
...); boolean check(in wstring word); void getdictionarylist([array, size_is(count)] out wstring dictionaries, out pruint32 count); void removedirectory(in nsifile dir); void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out pruint32 count); attributes attribute type descri
ption copyright wstring a string indicating the copyright of the engine.
...this will be either element from the array returned by getdictionarylist() or an em
pty string if no dictionary is selected.
...And 2 more matches
mozIStorageAggregateFunction
storage/public/mozistorageaggregatefunction.idlscri
ptable please add a summary to this article.
... javascri
pt // first, create our object that will represent our function.
...tal = 0; for (pruint32 i = 0; i < mnumbers.length(); i++) total += mnumbers[i]; print32 mean = total / mnumbers.length(); nstarray<print64> data(mnumbers); for (pruint32 i = 0; i < data.length(); i++) { print32 value = data[i] - mean; data[i] = value * value; } total = 0; for (pruint32 i = 0; i < data.length(); i++) total += data[i]; nscom
ptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasdouble(sqrt(double(total) / double(data.length()))); ns_ensure_success(rv, rv); ns_addref(*_result = result); return ns_ok; } private: nstarray<print32> mnumbers; }; // now, register our function with the database connection.
...And 2 more matches
mozIStorageFunction
storage/public/mozistoragefunction.idlscri
ptable please add a summary to this article.
... javascri
pt starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbconn.createfunction("square", 1, function(aarguments) { let value = aarguments.getint32(0); return value * value; }); // run some query that uses the function.
...class squarefunction : public mozistoragefunction { public: ns_imethod onfunctioncall(mozistoragevaluearray *aarguments, nsivariant **_result) { print32 value; nsresult rv = aarguments->getint32(&value); ns_ensure_success(rv, rv); nscom
ptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasint64(value * value); ns_ensure_success(rv, rv); ns_addref(*_result = result); return ns_ok; } }; // now, register our function with the database connection.
...And 2 more matches
mozIStorageStatementWrapper
you can then wrap that statement with a wrapper, which implements nsixpcscri
ptable and provides scri
ptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.
... storage/public/mozistoragestatementwrapper.idlscri
ptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type descri
ption statement mozistoragestatement the statement that is wrapped.
...And 2 more matches
mozIStorageValueArray
storage/public/mozistoragevaluearray.idlscri
ptable please add a summary to this article.
...ex); double getdouble(in unsigned long aindex); autf8string getutf8string(in unsigned long aindex); astring getstring(in unsigned long aindex); void getblob(in unsigned long aindex, out unsigned long adatasize, [array,size_is(adatasize)] out octet adata); boolean getisnull(in unsigned long aindex); attributes attribute type descri
ption numentries unsigned long the number of entries in the array.
... constants constant value descri
ption value_type_null 0 null data type.
...And 2 more matches
nsIAccessibleDocument
accessible/public/nsiaccessibledocument.idlscri
ptable an interface for in-process accessibility clients that wish to retrieve information about a document.
...you can also get one from nsiaccessnode.getaccessibledocument() or nsiaccessibleevent.getaccessibledocument() method overview nsiaccessible getaccessibleinparentchain(in nsidomnode adomnode, in boolean acancreate); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in void
ptr auniqueid); native code only!
... obsolete since gecko 2.0 astring getnamespaceuriforid(in short namespaceid); attributes attribute type descri
ption caretaccessible nsiaccessible read only.
...And 2 more matches
ARIA: button role - Accessibility
descri
ption the button role identifies an element as a button to screen readers.
... required javascri
pt features required event handlers buttons can be operated by mouse, touch, and keyboard users.
...input type="text" id="newname"> <span role="button" tabindex="0" onclick="handlecommand()" onkeydown="handlecommand()">add name</span> css [role="button"] { padding: 2px; background-color: navy; color: white; cursor: default; } [role="button"]:hover, [role="button"]:focus, [role="button"]:active { background-color: white; color: navy; } ul { list-style: none; } javascri
pt function handlecommand(event) { // handles both mouse clicks and keyboard // activate with enter or space // get the new name value from the input element let newnameinput = document.getelementbyid('newname'); let name = newnameinput.value; newnameinput.value = ''; // clear the text field newnameinput.focus(); // give the text field focus to enable entering and addi...
...And 2 more matches
ARIA: textbox role - Accessibility
descri
ption when an element has the textbox role, the browser sends an accessible textbox event to assistive technologies, which can then notify the user about it.
...="textbox" contenteditable="true" aria-placeholder="5-digit zipcode" aria-labelledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="txtboxmultilinelabel">enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxmultilinelabel" aria-required="true"></div> semantic elements are more concise and require no javascri
pt to support textbox features.
...the hint should be a sample value or a brief descri
ption of the expected format.this information should not be used as a substitute for a label: a label is focusable, permanent, indicates what kind of information is expected, and increases the hit area for setting focus on the control, whereas placeholder text is only temporary hint about the expected value, which if implemented incorrectly can decrease accessibility.
...And 2 more matches
Accessibility: What users can do to browse more safely - Accessibility
one work station can be set up to acommodate both a low-vision individual (needs high-contrast) and to accomodate an individual with photosensitive susce
ptibilities, by simply, adjusting personalization and accessiblity settings.
... according to eric bailey, in his april 30, 2019 article revisiting prefers-reduced-motion, the reduced motion media query, "while microsoft edge does not have support for prefers-reduced-motion, it will become chrome under the hood soon." safari 10.1 and above (desktop) do not enable auto-play (does not work for gifs) ios safari 10.3 and above (mobile and tablet) select the "reduce motion o
ption" in os accessibility settings for apple (image source: developers.google.com from thomas steiner's article "move ya!
...there is a github repository for it at https://github.com/0ui/gif-scrubber beeline reader beeline reader has a browser extension that allows you to set up for grayscale and dyslexi font, among other things take advantage operating system accessibility features most operating systems such as windows 10, have accessibility o
ptions that are surprisingly powerful.
...And 2 more matches
additive-symbols - CSS: Cascading Style Sheets
the additive-symbols descri
ptor lets you specify symbols when the value of a counter system descri
ptor is additive.
... the additive-symbols descri
ptor defines additive tuples, each of which is a pair containing a symbol and a non-negative integer weight.
... syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descri
ptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descri
ptor instead of additive-symbols.
...And 2 more matches
font-stretch - CSS: Cascading Style Sheets
the font-stretch css descri
ptor allows authors to specify a normal, condensed, or expanded face for the fonts specified in the @font-face rule.
... for a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-stretch descri
ptor to explicitly specify the font face's stretch.
... the values for the css descri
ptor is same as that of its corresponding font property.
...And 2 more matches
font-weight - CSS: Cascading Style Sheets
the font-weight css descri
ptor allows authors to specify font weights for the fonts specified in the @font-face rule.
... for a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-weight descri
ptor to explicitly specify the font face's weights.
... the values for the css descri
ptor is same as that of its corresponding font property.
...And 2 more matches
@font-face - CSS: Cascading Style Sheets
syntax @font-face { font-family: "open sans"; src: url("/fonts/opensans-regular-webfont.woff2") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); } descri
ptors font-display determines how a font face is displayed based on whether and when it is downloaded and ready to use.
...since firefox 61 (and in other modern browsers) this also acce
pts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; font-style a font-style value.
... since firefox 61 (and in other modern browsers) this also acce
pts two values to specify a range that is supported by a font-face, for example font-style: oblique 20deg 50deg; font-weight a font-weight value.
...And 2 more matches
Using CSS gradients - CSS: Cascading Style Sheets
cked-linear"></div> div { width: 200px; height: 200px; } .stacked-linear { background: linear-gradient(217deg, rgba(255,0,0,.8), rgba(255,0,0,0) 70.71%), linear-gradient(127deg, rgba(0,255,0,.8), rgba(0,255,0,0) 70.71%), linear-gradient(336deg, rgba(0,0,255,.8), rgba(0,0,255,0) 70.71%); } using radial gradients radial gradients are similar to linear gradients, exce
pt that they radiate out from a central point.
...you can also make them circular or elli
ptical.
...by default, the center of the gradient is at the 50% 50% mark, and the gradient is elli
ptical matching the aspect ratio of it's box: <div class="simple-radial"></div> div { width: 240px; height: 120px; } .simple-radial { background: radial-gradient(red, blue); } positioning radial color stops again like linear gradients, you can position each radial color stop with a percentage or absolute length.
...And 2 more matches
Consistent list indentation - CSS: Cascading Style Sheets
this is why, in every browser exce
pt internet explorer for windows, markers are placed outside any border set for an <li> element, assuming the value of list-style-position is outside.
... in order to avoid this and get some indentation, there are really only three o
ptions available to browser implementors.
... as it turns out, nobody seems to have used the first o
ption.
...And 2 more matches
Pseudo-classes - CSS: Cascading Style Sheets
index of standard pseudo-classes :active :any-link :blank :checked :current :default :defined :dir() :disabled :drop :em
pty :enabled :first :first-child :first-of-type :fullscreen :future :focus :focus-visible :focus-within :has() :host :host() :host-context() :hover :indeterminate :in-range :invalid :is() :lang() :last-child :last-of-type :left :link :local-link :not() :nth-child() :nth-col() :nth-last-child() :nth-last-col() :nth-last-of-type() :nth-of-type() :only-...
...child :only-of-type :o
ptional :out-of-range :past :placeholder-shown :read-only :read-write :required :right :root :scope :state() :target :target-within :user-invalid :valid :visited :where() specifications specification status comment fullscreen api living standard defined :fullscreen.
... changed :em
pty to behave like :-moz-only-whitespace .
...And 2 more matches
color-adjust - CSS: Cascading Style Sheets
the color-adjust css property sets what, if anything, the user agent may do to o
ptimize the appearance of the element on the output device.
... values economy the user agent is allowed to make adjustments to the element as it deems appropriate and prudent in order to o
ptimize the output for the device it's being rendered for.
... for example, when printing, a browser might o
pt to leave out all background images and to adjust text colors to be sure the contrast is o
ptimized for reading on white paper.
...And 2 more matches
font-variant-position - CSS: Cascading Style Sheets
the font-variant-position css property controls the use of alternate, smaller glyphs that are positioned as superscri
pt or subscri
pt.
... values normal deactivates alternate superscri
pt and subscri
pt glyphs.
... sub activates subscri
pt alternate glyphs.
...And 2 more matches
overflow-y - CSS: Cascading Style Sheets
formal definition initial valuevisibleapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, exce
pt with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples setting overflow-y behavior html <ul> <li><code>overflow-y:hidden</code> — hides the text outside the box <div id="div1"> lorem ipsum dolor sit amet, consectetur adipisicing elit, ...
...duis aute irure dolor in reprehenderit in volu
ptate velit esse cillum dolore eu fugiat nulla pariatur.
...duis aute irure dolor in reprehenderit in volu
ptate velit esse cillum dolore eu fugiat nulla pariatur.
...And 2 more matches
repeating-radial-gradient() - CSS: Cascading Style Sheets
syntax /* a gradient at the center of its container, starting red, changing to blue, and finishing green, with the colors repeating every 30px */ repeating-radial-gradient(circle at center, red 0, blue, green 30px); /* an elli
ptical gradient near the top left of its container, starting red, changing to green and back again, repeating five times between the center and the bottom right corner, and only once between the center and the top left corner */ repeating-radial-gradient(farthest-corner at 20% 20%, red 0, green, red 20%); values <position> the position of the gradient, interpreted in the same way as b...
...the possible values are: keyword descri
ption closest-side the gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the vertical and horizontal sides closest to the center (for ellipses).
... farthest-side similar to closest-side, exce
pt the ending shape is sized to meet the side of the box farthest from its center (or vertical and horizontal sides).
...And 2 more matches
Ajax - Developer guides
asynchronous javascri
pt and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together, including html or xhtml, css, javascri
pt, dom, xml, xslt, and most importantly the xmlhttprequest object.
... although x in ajax stands for xml, json is used more than xml nowadays because of its many advantages such as being lighter and a part of javascri
pt.
...possible values are the em
pty string (default), arraybuffer, blob, document, json, and text.
...And 2 more matches
Add-on SDK - Archive of obsolete content
you can use various standard web technologies: javascri
pt, html, and css, to create the add-ons.
... the sdk includes javascri
pt apis, which you can use to create add-ons and tools for creating, running, testing, and packaging add-ons.
... content scri
pts a detailed guide to working with content scri
pts.
... sdk idioms the sdk's event framework and the distinction between add-on scri
pts and content scri
pts.
SVG General - Archive of obsolete content
you will also find some general purpose scri
pting helpers, that should make scri
pting svg a little easier.
... dynamic scri
pting helper this little helper scri
pt can be used to simplify creation of svg elements in scri
pt.
...here is the scri
pt: var svgns = "http://www.w3.org/2000/svg"; var xlinkns = "http://www.w3.org/1999/xlink"; var attr_map = { "classname": "class", "svghref": "href" } var ns_map = { "svghref": xlinkns }; function makesvg(tag, attributes) { var elem = document.createelementns(svgns, tag); for (var attribute in attributes) { var name = (attribute in attr_map ?
... attr_map[attribute] : attribute); var value = attributes[attribute]; if (attribute in ns_map) elem.setattributens(ns_map[attribute], name, value); else elem.setattribute(name, value); } return elem; } attributes are packed in a literal object and the helper scri
pt unpacks them and adds them to the element.
Multiple item extension packaging - Archive of obsolete content
as a consequence, these packages are no longer acce
pted by amo.
...every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same requirements as an extension exce
pt as noted below.
...<rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <descri
ption about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type nc:parsetype="integer">32</em:type> ...
...<rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <descri
ption about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type>32</em:type> ...
Local Storage - Archive of obsolete content
it used to be the case that custom logging solutions were necessary, but mozilla labs have come up with a javascri
pt implementation of a logger similar to the log4j logger used in java projects.
... the logger is called log4moz and it is implemented as a javascri
pt code module, so it only works on firefox 3 and above.
... note: we recommend that all exce
ption catch blocks include some logging at the error or warn levels, and in general you should use logging freely in order to have as much information as possible to fix bugs and know what is going on.
...there's a section about sqlite templates in the guide, but there are some conce
pts in it that will require you to read at least some of the rest of it.
Extensions support in SeaMonkey 2 - Archive of obsolete content
the code for that will look something like this: <em:targetapplication> <!-- seamonkey --> <descri
ption> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </descri
ption> </em:targetapplication> the install.js is not supported any more and should be removed.
...there are exce
ptions, but these are few and far between.
...bird 3 gfolderdisplay api seamonkey 2.0 only supports a reduced set of methods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascri
pt tweaks firefox supports some shorthand in various places.
... in javascri
pt code you can use the following technique to detect the application: const firefox_id = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; const thunderbird_id = "{3550f703-e582-4d05-9a08-453d09bdfdc6}"; const seamonkey_id = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"; var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); if...
Updating addons broken by private browsing changes - Archive of obsolete content
nsihttpauthmanager: setauthidentity and getauthidentity now take an o
ptional boolean parameter to indicate whether the identity is classified as private.
... nsiprivatebrowsingservice: this service is deprecated, and as of firefox 20 it is now an em
pty interface.
... chrome apis openbrowserwindow: takes an o
ptional parameter to indicate desired properties of the window.
... internalsave: takes a new required document argument (prior to the o
ptional boolean and string arguments) indicating the document that originated the save action.
Creating reusable content with CSS and XBL - Archive of obsolete content
you can place stylesheets in separate files, and you can place scri
pts in separate files.
...this wiki does not support javascri
pt in pages, so it is not possible to show the demonstration here.
... it looks something like this, before and after you press the button: notes about this demonstration: the html document links the document stylesheet as usual, but it does not link any javascri
pt code.
... the binding links its own stylesheet, and it supplies its own content and javascri
pt code.
List of Former Mozilla-Based Applications - Archive of obsolete content
applications that switched to another technology name descri
ption additional information angelsoft tools for startups, vcs, and angel investors switched from xulrunner-based client to a web application autodesk maya 3d modeling tool switched off of gecko for help browser in version 8.5 blam feed reader switched to webkit in version 1.8.6 boxee media center software switched to webkit in version 1.0 epiphany browser switched from gecko to webkit flock social browsing...
... mozilla-based but now i believe the have a web-based tool (need reference for that) miro (formerly democracy player) video switched from xulrunner to webkit in version 3.0.2 moblin browser browser when moblin became meego it switched from a custom gecko-based browser to chrome nautilus file manager hasn't used mozilla code since version 2.0 ra
ptr client gaming client was a xulrunner app initially but now uses adobe air rift technologies software installation over internet no longer using mozilla technology -- need confirmation and details second life virtual world desktop client switched from embedded mozilla browser to a plugin architecture with a qtwebkit plugin applications that are no longer...
... being developed name descri
ption additional information aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from se
ptember 2006 gencatrss rss reader domain switched over to domain parking service ...
...scape navigator browser support for netscape ended on february 1, 2008 nvu web authoring tool development stopped in 2005 and is being continued as an unofficial bugfix release by the kompozer project pogo browser from at&t site no longer accessible as of may 2009 pyro desktop desktop environment last news item on site from july 2007 scri
pt editor editor inactive skipstone gtk+ browser last news item on site from february 2008 xabyl visual xbl editor inactive xulplayer media player last project update on 3/14/09 zoomcreator photo collage tool on april 29, 2010 the site announced zoomara was shutting down.
No Proxy For configuration - Archive of obsolete content
user interface "no proxy for" is an o
ptional field, part of "manual proxy configuration".
... 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") o
ptional - port-specific (o
ptional) ":" + port number "<filter>:81" only black-lists port.
...for example: "https://mycompanyintranet/" formats that are not acce
pted example domain filters with interior wildcards www.*.com ip address string prefixes 127.
...all proxied urls will return errors, all non-proxied connections will be attem
pted normally (direct connection).
Getting Started - Archive of obsolete content
<descri
ption about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number.
...you will also have to update the minimum and maximum compatible versions for the target application (seamonkey) in the following section: <em:targetapplication> <descri
ption> <!-- seamonkey's uuid --> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>min_sm_version</em:minversion> <em:maxversion>max_sm_version</em:maxversion> </descri
ption> </em:targetapplication> establishing both minimum and maximum compatible versions lets you avoid conflicts with versions of seamonkey your theme wasn't designed for -- or wasn't tested on.
...once you have put the files in the zip folder, rename it to myskin.jar triggering the install from the web to install the theme's jar file directly from the web, you need to run some javascri
pt.
... <a href='javascri
pt:installtrigger.installchrome(installtrigger.skin, "myskin.jar", "my skin theme")'>install my skin</a> if you have jar files on your hard drive and would like to install them, then download/use this form.
DTrace - Archive of obsolete content
probe data can be collected with scri
pts written in d (no, not that one).
... documentation writing scri
pts a general introduction to writing d scri
pts and using the built-in mozilla probes.
... o
ptimizing javascri
pt with dtrace a guide on profiling javascri
pt code using dtrace.
... community dtrace forums #dtrace on irc.freenode.org sun's dtrace howto guide tools nightly trunk builds for solaris dtracetoolkit related topics javascri
pt ...
Drag and Drop - Archive of obsolete content
mozilla and xul provide a number of events that can handle when the user attem
pts to drag objects around.
...the scri
pt in this handler should set up a drag session.
...the second is to use a javascri
pt wrapper object that handles some of this for you.
...the following properties and methods are available: candrop set this property to true if the element the mouse is currently over can acce
pt the object currently being dragged to be dropped on it.
importUserCertificates - Archive of obsolete content
use <keygen> or the future web cry
pto api instead.
... resultstring = cry
pto.importusercertificates("nicknamestring","certstring",forcebackup); argument descri
ption "nicknamestring" this is the nickname that will be used to describe the certificate in the client's certificate management ui.
...if the import operation succeeds, an em
pty string will be returned.
... if it fails, one of the following error strings will be returned: error string descri
ption "error:usercancel" the user canceled the import operation "error:invalidcertificate" one of the certificate packages was incorrectly formatted "error:internalerror" the software encountered some internal error, such as out of memory "error:invalidrequestid" the request id in the response message does not match any outstanding request ...
Makefile.mozextension.2 - Archive of obsolete content
which is why the code shown below is corru
pt - so you may wanna click on edit and view source instead !!
... then again if you do that, all of the < > will be quoted as & lt ; so again it will be corru
pt :( therefore, here is a direct link to this makefile: makefile.mozextension2 ## file: makefile.mozextension2 ## based on http://kb.mozillazine.org/makefile_for_packaging_an_extension ## "this makefile.mozextention is for the test extension" ## the original makefile.mozextention reconstructs http://kb.mozillazine.org/getting_started_with_extension_development # call with: # make -f makefile.mozextension2 make_structure ## (without args for 'all') # note: @echo silent; without @ the command is written in stdout project=test project_name=testworld #~ project_id={xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} project_id=test@testworld.ext project_version=1.0 project_desc="a $(project_name) project wi...
...6} #nvu {136c295a-4a5a-41cf-bf24-5cee526720d5} #mozilla suite {86c18b42-e466-45a9-ae7a-9b95ba6f5640} #seamonkey {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} #sunbird {718e30fb-e89b-41dd-9da7-e25a45638b28} #netscape browser {3db10fab-e461-4c80-8b97-957ad5f8ea47} ###### define install_rdf <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <descri
ption about="urn:mozilla:install-manifest"> <id>$(project_id)</id> <name>$(project_name)</name> <version>$(project_version)</version> <descri
ption>$(project_desc)</descri
ption> <creator>$(project_author)</creator> <contributor>here is a place for you who helped me</contributor> <homepageurl>http://$(project).mozdev.org/</homepageurl> <o
ptionsurl>chrome://$(project)/content/settings.xul</o
ptionsur...
...l> <abouturl>chrome://$(project)/content/about.xul</abouturl> <iconurl>chrome://$(project)/skin/mainicon.png</iconurl> <updateurl>http://$(project).mozdev.org/update.rdf</updateurl> <type>2</type> <targetapplication> <descri
ption> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <minversion>2.0</minversion> <maxversion>9.0</maxversion> </descri
ption> </targetapplication> </descri
ption> </rdf> endef export install_rdf install.rdf: @echo generating $(project)/install.rdf @echo "$$install_rdf" > $(project)/install.rdf ###### define overlay_xul <overlay id="$(project)-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><scri
pt src="overlay.js"/></overlay> ...
Modularization techniques - Archive of obsolete content
nscanunload() is an o
ptional, but useful function.
... you can use c everywhere exce
pt your interface.
...xpcom uses these typelibraries to allow other languages, such as javascri
pt, to implement and call xpcom objects.
... links the component object model specification revision history feb 25, 1998, created oct 19, 1998, dusted off momentarily oct 10, 1999, added comments about xpidl, language-independentness original document information author(s): will scullin last updated date: se
ptember 13, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details ...
dlgtype - Archive of obsolete content
for example, if the dlgtype is set to acce
pt, the button will replace the dialog box's acce
pt button, which is usually labeled ok.
...the following values can be used as the dialog type: acce
pt the ok button, which will acce
pt the changes when pressed.
... extra1 an o
ptional additional button.
... extra2 a second o
ptional additional button.
textbox.onblur - Archive of obsolete content
« xul reference home onblur type: scri
pt code this event is sent when a textbox loses keyboard focus.
...prior to gecko 1.9 (firefox 3), the scri
pt code would execute in the context of the anonymous html <input> element inside the textbox binding.
... from gecko 1.9 to gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9), the scri
pt code would actually execute twice, once in the context of the anonymous html <input> element and once in the context of the <textbox> element itself.
... as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the scri
pt code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.
textbox.onfocus - Archive of obsolete content
« xul reference home onfocus type: scri
pt code this event is sent when a textbox receives keyboard focus.
...prior to gecko 1.9 (firefox 3), the scri
pt code would execute in the context of the anonymous html <input> element inside the textbox binding.
... from gecko 1.9 to gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9), the scri
pt code would actually execute twice, once in the context of the anonymous html <input> element and once in the context of the <textbox> element itself.
... as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the scri
pt code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.
Working With Directories - Archive of obsolete content
file and stream guide: [ nsiscri
ptableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscri
ptableio), which was not available in any released version of the platform (pending some fixes).
...other documentation on files and i/o not using the unavailable nsiscri
ptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes.
... a reference to a directory may be created in the same way as with a file by using nsiscri
ptableio.getfile().
...this method returns true if a file object returned by nsiscri
ptableio.getfile() refers to a directory, and false otherwise.
How to Quit a XUL Application - Archive of obsolete content
scri
pt can attem
pt to quit a xul application, or force the application to quit, using the nsiappstartup interface.
... <scri
pt> function quit (aforcequit) { var appstartup = components.classes['@mozilla.org/toolkit/app-startup;1'].
... getservice(components.interfaces.nsiappstartup); // eattem
ptquit will try to close each xul window, but the xul window can cancel the quit // process if there is unsaved data.
...components.interfaces.nsiappstartup.eforcequit : components.interfaces.nsiappstartup.eattem
ptquit; appstartup.quit(quitseverity); } </scri
pt> calling this function if there is an uncaught exce
ption, to force the application to quit: <scri
pt> try { dosomething(); } catch (e) { quit(true); } </scri
pt> the "quit" menuitem should typically prom
pt the user if there is unsaved data: <menuitem label="quit" oncommand="quit(false);"/> ...
MenuModification - Archive of obsolete content
<scri
pt> function addtomenu() { var menu = document.getelementbyid("edit-menu"); menu.appenditem("insert", "insert"); } </scri
pt> <menu id="edit-menu"/> <button label="add" oncommand="addtomenu()"/> in this example, the addtomenu function is called when the button is pressed.
... <scri
pt> function addsubmenu() { var popup = document.getelementbyid("file-popup"); var newmenu = document.createelement("menu"); popup.appendchild(newmenu); newmenu.label = "new"; newmenu.appenditem("document", "doc"); newmenu.appenditem("image", "image"); } </scri
pt> <menu label="file" onpopupshowing="addsubmenu()"> <menupopup id="file-popup"/> </menu>.
...also, need replace newmenu.label= "new" by newmenu.setattribute("label", "new"); (all when creating from bootstrap.js in a bootstrapped addon) the addsubmenu function is called during the popupshowing event, which will be fired when an attem
pt to open the menu is made.
... <scri
pt> function addsubmenu() { var popup = document.getelementbyid("file-popup"); if (popup.haschildnodes()) return; var newmenu = document.createelement("menu"); popup.appendchild(newmenu); newmenu.label = "new"; newmenu.appenditem("document", "doc"); newmenu.appenditem("image", "image"); } </scri
pt> the haschildnodes method may be used to check if a node has any children.
Panels - Archive of obsolete content
you can also place a close button in the panel which will close the panel with a scri
pt if desired.
...this works just like using context menus exce
pt that the panel element is used instead of the menupopup element.
... opening a panel with scri
pt the panel, like all popups, has an openpopup method which may be used to open the popup using a scri
pt.
...for instance, using the search panel example above, we could add a button which closes the panel when pressed: <scri
pt> function dosearch() { document.getelementbyid("search-panel").hidepopup(); } </scri
pt> <toolbarbutton label="search" type="panel"> <panel id="search-panel" position="after_start"> <textbox id="search"/> <button label="search" oncommand="dosearch();"/> </panel> </toolbarbutton> in this example, the dosearch() function is called when the "search" button is pressed.
Special per-platform menu considerations - Archive of obsolete content
menu_prefsseparator the separator just before the preferences/o
ptions item.
... menu_mac_hide_others selecting this item will hide all other applications exce
pt this one.
... here is an example: <menubar> <menu label="tools"> <menupopup> <menuitem label="spell check"/> <menuitem id="menu_preferences" label="preferences" oncommand="window.opendialog('o
ptions.xul', '_new', 'chrome');"/> </menupopup> </menu> </menubar> this menu item will be placed on the application menu on the macintosh but left in the tools menu on other platforms.
... notes for firefox extension developers on the mac, some elements, once moved to the application menu, are no longer accessible from xul overlays or from javascri
pt injected into browser.xul.
Popup Guide - Archive of obsolete content
context menus a context menu is like a regular menu exce
pt that the commands it contains apply to what the user had clicked on to open the context menu.
... tooltips when the mouse is positioned over a ui control, a tooltip provides a small box with descri
ptive help about that control.
... a tooltip can be created by setting the toolti
ptext attribute on an element or by using the tooltip element.
...to open a popup using scri
pt use the openpopup method or the openpopupatscreen method.
Attribute Substitution - Archive of obsolete content
you can include multiple variables in one attribute if desired: <label value="my name is ?name and my age is ?age"/> this technique will work for any variable replacement in the action body, exce
pt for the uri attribute since that wouldn't be meaningful.
...it may be desirable to have longer text wrap by placing it as the content of a descri
ption element.
...for instance, if the template contained: <descri
ption><textnode value="?descri
ption"/></descri
ption> the resulting generated content might be: <descri
ption>view from the top of the tower looking east of the doges palace</descri
ption> note that the textnode has been replaced with the substituted value attribute.
...another possibilty is to rearrange the rdf such that the values, in this example, the descri
ptions, are specified before the containers.
Sorting Results - Archive of obsolete content
for an rdf datasource, again, the results are in the order the query generates them, although exce
pt in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order.
...for instance, if a list of photos was displayed in a two column tree showing the title and descri
ption, you could sort by either title or descri
ption.
...for instance, in the example the second column sorts by date, but if you were to use a different variable such as ?descri
ption, the tree would sort by the value of the descri
ption variable for each row.
...here is a sample of how to specify this in the rdf/xml datasource: <rdf:rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:r="http://www.xulplanet.com/rdf/" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:descri
ption rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"> <r:date nc:parsetype="date">1125966767295<r:date> </rdf:descri
ption> </rdf:rdf> you can also specify parsetype="integer" for numbers which will allow sorting numerically.
Template Builder Interface - Archive of obsolete content
both types of builder share much of the same code exce
pt for how they generate output to be displayed.
...for non-xul elements, the template builder will be assigned to a builder property on the element using a custom javascri
pt property instead.
...if you do plan on determining the datasources dynamically, it is common to start with an em
pty datasource using the special uri 'rdf:null'.
...the rdf service's getdatasource method however, only acce
pts absolute urls.
Adding Style Sheets - Archive of obsolete content
there may be certain cases where the style attribute is acce
ptable.
... an example would be when a scri
pt changes the style, or where a difference in layout might change the meaning of the element.
...<spacer class="titlespace"/> <groupbox orient="horizontal"> <ca
ption label="search criteria"/> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> ...
...this will be changed by a scri
pt so it was left in, as it doesn't really make sense to have the progress bar visible initially.
Box Objects - Archive of obsolete content
these properties will return an em
pty string if the width or height attributes or properties were not set already.
...the collapsed attribute will have the same effect to the user element visually, exce
pt that it leaves the element on screen and keeps the layout objects intact, but changes the size of the element to 0.
...example 2 : source view <scri
pt> function showpositionandsize() { var labelbox = document.getelementbyid('thelabel').boxobject; alert("position is (" + labelbox.x + "," + labelbox.y + ") and size is (" + labelbox.width + "," + labelbox.height + ")"); } </scri
pt> <button label="hide" oncommand="document.getelementbyid('thelabel').hidden = true;"/> <button label="show" oncommand="document.getelementbyid('thelabel').hidden = false;"/> <button label="coll...
...next, we'll find out how to use xpcom objects from xul and scri
pts.
Broadcasters and Observers - Archive of obsolete content
although we could write a scri
pt to do this, it is quite tedious.
...they work the same as commands exce
pt that a command is used for actions, while a broadcaster is instead used for holding state information.
...you should declare all your broadcasters inside a broadcasterset element so that they are all ke
pt together.
...the scri
pt here gets a reference to the broadcaster and changes the style of it to have a color that is red.
Commands - Archive of obsolete content
you don't need to use commands, since you can just call a scri
pt to handle things.
...in this case, the command will not invoke a scri
pt directly, but instead, find an element or function which will handle the command.
... <window id="controller-example" title="controller example" onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <scri
pt> function init() { var list = document.getelementbyid("thelist"); var listcontroller = { supportscommand : function(cmd){ return (cmd == "cmd_delete"); }, iscommandenabled : function(cmd){ if (cmd == "cmd_delete") return (list.selecteditem != null); return false; }, docommand : function(cmd){ list.removeitemat(list.selectedindex); }, onevent : functi...
...on(evt){ } }; list.controllers.appendcontroller(listcontroller); } </scri
pt> <listbox id="thelist"> <listitem label="ocean"/> <listitem label="desert"/> <listitem label="jungle"/> <listitem label="swamp"/> </listbox> </window> the controller (listcontroller) implements the four methods described above.
Introduction to XBL - Archive of obsolete content
the following example shows the basic skeleton of an xbl file: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl"> <binding id="binding1"> <!-- content, property, method and event descri
ptions go here --> </binding> <binding id="binding2"> <!-- content, property, method and event descri
ptions go here --> </binding> </bindings> the bindings element is the root element of an xbl file and contains one or more binding elements.
...they can be accessed through a scri
pt.
...they can be called from a scri
pt.
...the binding can add scri
pts to provide default handling.
List Controls - Archive of obsolete content
example 1 : source view <listbox> <listitem label="butter pecan" /> <listitem label="chocolate chip" /> <listitem label="raspberry ripple" /> <listitem label="squash swirl" /> </listbox> like with the html o
ption element, you can assign a value for each item using the value attribute.
... you can then use the value in a scri
pt.
...this is much like a regular row exce
pt that it is displayed differently.
...the header row is not a normal row however, so using a scri
pt to get the first row in the list box will skip the header row.
Modifying a XUL Interface - Archive of obsolete content
for example, the following will add a button to a xul window: example 1 : source view <scri
pt> function addbutton(){ var abox = document.getelementbyid("abox"); var button = document.createelement("button"); button.setattribute("label","a new button"); abox.appendchild(button); } </scri
pt> <box id="abox" width="200"> <button label="add" oncommand="addbutton();"/> </box> this example has two parts a box container element in xul.
... the button element has two attributes "label" and "oncommand" a javascri
pt function named "addbutton()" this scri
pt first gets a reference to the box with getelementbyid(), which is the container to add a new button to.
...manipulating basic elements the main xul elements such as buttons, checkboxes and radio buttons may be manipulated using a number of scri
pt properties.
...example 7 : source view <scri
pt> function updatestate(){ var name = document.getelementbyid("name"); var sindex = document.getelementbyid("group").selectedindex; name.disabled = sindex == 0; } </scri
pt> <radiogroup id="group" onselect="updatestate();"> <radio label="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> ...
The Box Model - Archive of obsolete content
login prom
pt example you can add as many elements as you want inside a box, including other boxes.
...the example below shows a simple login prom
pt: example 2 : source view <vbox> <hbox> <label control="login" value="login:"/> <textbox id="login"/> </hbox> <hbox> <label control="pass" value="password:"/> <textbox id="pass"/> </hbox> <button id="ok" label="ok"/> <button id="cancel" label="cancel"/> </vbox> here four elements have been oriented vertically, two inner hbox tags and two button elements.
... <vbox flex="1"> <descri
ption> enter your search criteria below and select the find button to begin the search.
... </descri
ption> <hbox> <label value="search for:" control="find-text"/> <textbox id="find-text"/> </hbox> <hbox> <spacer flex="1"/> <button id="find-button" label="find"/> <button id="cancel-button" label="cancel"/> </hbox> </vbox> the vertical box causes the main text, the box with the textbox and the box with the buttons to orient vertically.
Trees - Archive of obsolete content
this allows the view to be o
ptimized such that it only needs to load the data for displayed content.
...if you do, you might store the data in an array or javascri
pt data structure, or load the data from an xml file.
... in this case we haven't specified a view to supply the tree's data, so we'll only see column headers and an em
pty tree body.
...in a real implementation, the rows would be added by a scri
pt as the search was performed, or a custom view would be created to hold the data.
Trees and Templates - Archive of obsolete content
trees which generate their data from a datasource have the o
ptional ability to sort their data.
...this sorting feature is not available for trees with static content, although you can write a scri
pt to sort the data.
... isem
pty if this attribute is set to true, then the rule will match all resources that have no children.
... a resource might be a container and be an em
pty one as well.
Updating Commands - Archive of obsolete content
if you include the scri
pt 'chrome://global/content/globaloverlay.js' in a xul file, you can call the godocommand method which executes the command passed as the argument.
...<scri
pt src="chrome://global/content/globaloverlay.js"/> <command id="cmd_paste" oncommand="godocommand('cmd_paste');"/> <button label="paste" command="cmd_paste"/> the example above will implement a paste button.
...in the example, the goupdatecommand method is called which is a function provided by the globaloverlay.js scri
pt described earlier.
...the functions used can be found in the 'chrome://communicator/content/utilityoverlay.js' scri
pt.
XBL Example - Archive of obsolete content
conveniently, we can change the page using the custom 'page' property that was just added: <xul:button xbl:inherits="label=previoustext" oncommand="parentnode.parentnode.parentnode.page--;"/> <xul:descri
ption flex="1"/> <xul:button xbl:inherits="label=nexttext" oncommand="parentnode.parentnode.parentnode.page++;"/> because the 'page' property is only on the outer xul element, we need to to use the parentnode property to get to it.
...this will call the onget scri
pt to get the value, increment or decrement the value by one, and then call the onset handler to set the value.
...the reference to 'this.page' will call the onget scri
pt of the page property, which in turn will retrieve the initial page from the selectedindex attribute.
...final code the final code is as follows: example 2 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selectedindex" selectedindex="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="label=previoustext" oncommand="parentnode.parentnode.parentnode.page--;"/> <xul:descri
ption flex="1"/> <xul:button xbl:inherits="label=nexttext" oncommand="parentnode.parentnode.parentnode.page++;"/> </xul:hbox> </xul:vbox> </content> <implementation> <constructor> var totalpages=this.childnodes.length; document.getanonymousnodes(this)[0].childnodes[1].childnodes[1] .setattribute("value",(this.page+1)+" of "+to...
XUL Changes for Firefox 1.5 - Archive of obsolete content
for other changes you should be aware of, see ada
pting xul applications for firefox 1.5.
...this is used typically on gnome systems where possible values are: acce
pt, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network.
... <menulist> items in a <menulist> support the descri
ption attribute to allow for extra descri
ptive text to appear beside an item's label.
... the menulist modification methods appenditem and insertitemat take an extra descri
ption argument when creating items this way.
XUL Reference - Archive of obsolete content
« xul reference « alphabetical list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox ca
ption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck descri
ption dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem 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 sc...
...ri
pt 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 treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups ...
... --- toolbars toolbar toolbarbutton toolbargrippy toolbaritem toolbarpallete toolbarseperator toolbarspring tabs and grouping tab tabbox tabpanel tabpanels tabs controls --- text and images label ca
ption image lists --- trees --- layout --- templates --- scri
pting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer...
... toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox ca
ption separator spacer button checkbox colorpicker datepicker menulist progressmeter radio radiogroup scale splitter textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker descri
ption label image listbox listitem listcell listcol listcols listhead listheader richlistbox 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 scri
pt commandset command broadcaster broadcasterset observes key keyset stringbundl...
XUL Template Primer - Bindings - Archive of obsolete content
the <bindings> element is used to create additional,o
ptional variable bindings, in addition to those that are specified in a rule's <conditions>.
... <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:descri
ption about="urn:root"> <nc:friends> <rdf:seq> <rdf:li> <rdf:descri
ption nc:name="alison appel"> <nc:address resource="#home"/> </rdf:descri
ption> </rdf:li> <rdf:li> <rdf:descri
ption nc:name="jack"> <nc:address resource="#doghouse"/> </rdf:descri
ption> </rdf:li> <rdf:li> <rdf:d...
...escri
ption nc:name="lumpy"/> </rdf:li> </rdf:seq> </nc:friends> </rdf:descri
ption> <rdf:descri
ption id="home" nc:street="437 hoffman"/> <rdf:descri
ption id="doghouse" nc:street="435 hoffman"/> </rdf:rdf> the rdf model that this file creates can be represented with the following graph.
... the <bindings> element the <bindings> element is o
ptional in a xul template, but if present, must appear as a sibling of the <conditions> and <action> elements in a rule.
command - Archive of obsolete content
if you include the scri
pt chrome://global/content/globaloverlay.js in your window, you can use the function godocommand function to invoke the command.
... visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... oncommand type: scri
pt code this event handler is called when the command is activated.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
dialogheader - Archive of obsolete content
the header may have a title and a descri
ption.
... attributes crop, descri
ption, title examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <dialogheader title="my dialog" descri
ption="example dialog"/> <!-- other widgets --> </dialog> attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
...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; } descri
ption type: string descri
ptive text to appear in addition to the dialog title.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
image - Archive of obsolete content
attributes onerror, onload, src, validate properties accessibletype, src style classes alert-icon, error-icon, message-icon, question-icon examples <image src='firefoxlogo.png' width='135' height='130'/> attributes onerror type: scri
pt code this event is sent to an image element when an error occurs loading the image.
... image.onload type: scri
pt code this event handler will be called on the image element when the image has finished loading.
...the following values are acce
pted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
label - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... related elements descri
ption attributes label interfaces nsiaccessibleprovider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable.
... the ca
ption is in the "value" attribute remember that the label element has a "value" attribute, unlike value in html whereas buttons, checkboxes use label="foo" as the attribute <label label="a ca
ption"/> <!-- wrong --> <label value="a ca
ption"/> <label value="click the button"/> <button label="a button"/> <checkbox label="a decision" value="1"/> wrapping by default, label text does not wrap.
...<label control="email">email address</label> <textbox id="email"/> if the text node contains no tags, it can easily be accessed and manipulated from javascri
pt using node.textcontent.
listbox - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
...you may o
ptionally set a value.
...you may o
ptionally set a value.
menu - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
...you may o
ptionally set a value.
...you may o
ptionally set a value.
rule - Archive of obsolete content
the bindings element is o
ptional and may specify additional variable bindings to be used.
... attributes iscontainer, isem
pty, parent, parsetype examples (example needed) attributes iscontainer type: boolean indicates whether rules match based on containment.
... isem
pty type: boolean indicates whether rules match based on em
ptyness.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
template - Archive of obsolete content
attributes container, member examples (example needed) attributes container type: string may o
ptionally be set to the variable to use as the container or reference variable.
... member type: string may o
ptionally be set to the variable to use as the member variable.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , colla...
...psed, 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(),...
window - Archive of obsolete content
--> <window id="rootwnd" title="register online!" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <hbox> <image src="application_form.png"/> <descri
ption>register online!</descri
ption> </hbox> <groupbox align="start"> <ca
ption label="your information"/> <radiogroup> <vbox> <hbox> <label control="your-fname" value="enter first name:"/> <textbox id="your-fname" value="johan"/> </hbox> <hbox> <label control="your-lname" value="enter last name:"/> ...
... <textbox id="your-lname" value="hernandez"/> </hbox> <hbox> <button oncommand="alert('save!')"> <descri
ption>save</descri
ption> </button> </hbox> </vbox> </radiogroup> </groupbox> </vbox> </window> attributes accelerated type: booleanset this attribute to true to allow hardware layer managers to accelerate the window.
... to get the window state from javascri
pt code, use window.windowstate.
... windows 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
wizardpage - Archive of obsolete content
attributes descri
ption, label, next, pageid properties next, pageid attributes descri
ption type: string descri
ptive text to appear in addition to the dialog title.
...if one of the pages has a next attribute, all of the pages should have one, exce
pt that last page.
...if one of the pages has a next attribute, all of the pages should have one, exce
pt that last page.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelem...
XUL Explorer - Archive of obsolete content
it has a list of code snippets (small fragments of xul or javascri
pt) that can be quickly inserted into the editor.
... o
ption to automatically update the preview as the editor changes.
... o
ption to specify the snippet used to load the editor on startup.
... o
ption to include a user snippet file.
calICalendarView - Archive of obsolete content
there is, however, no practical obstacle to the interface being implemented by any javascri
pt object associated with a group of dom nodes, even non-anonymous xul nodes.
... calendar/base/public/calicalendarview.idlscri
ptable please add a summary to this article.
... interface code [scri
ptable, uuid(3e567ccb-2ecf-4f59-b7ca-bf42b0fbf24a)] interface calicalendarview : nsisupports { attribute calicalendar displaycalender; attribute calicalendarviewcontroller controller; void showdate(in calidatetime adate); void setdaterange(in calidatetime astartdate, in calidatetime aenddate); readonly attribute calidatetime startdate; readonly attribute calidatetime enddate; readonly attribute boolean supportsdisjointdates; readonly attribute boolean hasdisjointdates; void setdatelist(in unsigned long acount, [array,size_is(acount)] in calidatetime adates); void getdatelist(out unsigned long acount, [array,size_is(acount),retval] out calidatetime adates); attribute caliitembase selecteditem; attribute calidat...
...the view is free to show other dates as well, although this should be ke
pt to a minimum.
2006-09-29 - Archive of obsolete content
summary: mozilla.dev.apps.calendar - se
ptember 22 - se
ptember 29, 2006 announcements lightning and sunbird 0.3 rc1 test day!
... meetings se
pt.
... 27 status meeting cancelled most of the mozilla calendar participants were unavailable during se
pt.
... se
pt 20 brief status meeting the meeting consisted entirely of the status and details of sunbird 0.3.
2006-10-27 - Archive of obsolete content
these were the following choices stated: search the filesystem for unneeded files delete or archive them, add a hard disk, move all or part of the concerned filesystem there move that tinderbox to a different machine with more em
pty disk space on october 23rd: nick responded to gavin and tony's posting.
...the following is his configuration scri
pt that he used to build firefox 2 on solaris.
... ./configure --prefix=/export/home/alex/thunderbird --enable-application=browser --disable-tests --disable-debug -disable-auto-deps --disable-freetype2 -enable-official-branding --enable-default-toolkit=gtk2 --enable-o
ptimize=-xo5 --enable-static --disable-shared --enable-xft --enable-svg the build tools that he used to build firefox 2 are listed in his posting along with the error that he receives when he tries to build it.
... alex is not sure if he is missing a library or if he needs to pass extra o
ptions to configure the build.
2006-11-03 - Archive of obsolete content
directory (build problem on winxp) november 2nd: kenoa complained that when he is compiling using cygwin on win32 he gets the following error no such file or directory1: /cygdrive/c/mozilla/mail/config/mozconfig client.mk:339: /cygdrive/c/mozilla/.mozconfig.mk: no such file or directory he claims that the file ".mozconfig" exists in /cygdrive/c/mozilla/mail/config/mozconfig the disable-cry
pto cause problem originally posted on november 2nd: gxk is building minimo using the code base from se
pt.
... when he builds using the disable.cry
pto o
ption he encounters the following problem: no rule to make target `../../dist/lib/components/libpipboot.a', needed by `minimo'.
...(http://www.google.com/url?sa=d&q=htt...tail%3fid%3d64) gavin recommended that phil should add |ac_add_o
ptions --disable-airbag| to his .mozconfig.
... problems building browser's trunk on windows using vs 2005 originally posted on october 29th: ricardo sixel is trying to retrieve the trunk source code using the browser check out o
ption.
2006-11-10 - Archive of obsolete content
benjamin smedberg has been "working on some x
ptcall refactoring which will allow us to expose x
ptcall via a frozen api (and c linkage)".
... he is looking for x
ptcall port maintainers to submit patches to bug 349002.
...harry is looking for help with create thread in javascri
pt using nsithread.
... he wants to know how to create new threads using javascri
pt for background download operations.
NPAnyCallbackStruct - Archive of obsolete content
descri
ption callback structures are used to pass platform-specific information.
...this structure contains the file pointer to which the plug-in should write its postscri
pt data.
... at the time the plug-in is called, the browser has already opened the file and written postscri
pt for other parts of the page.
... when the plug-in is done, it should leave the file open, as the browser can continue to write additional postscri
pt data to the file.
NPEvent - Archive of obsolete content
the event type may be any of the ollowing: graphicsexpose focusin focusout enternotify leavenotify motionnotify buttonpress buttonrelease keypress keyrelease descri
ption microsoft windows descri
ption the type npevent represents an event passed by npp_handleevent() to a windowless plug-in.
... mac os descri
ption the npevent object represents an event passed by npp_handleevent() to a windowless plug-in.
... if your instance acce
pts key events, return true, and key events will be sent to the instance until it receives a losefocusevent.
... xwindows descri
ption the npevent object represents an event passed by npp_handleevent() to a windowless plug-in.
NPSetWindowCallbackStruct - Archive of obsolete content
syntax typedef struct { int32 type; display* display; visual* visual; colormap colormap; unsigned int de
pth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow.
... de
pth standard x toolkit attribute.
... de
pth of the plug-in window or drawable.
... descri
ption callback structures are used to pass platform-specific information.
Plugins - Archive of obsolete content
important: since firefox 52, all plugin support exce
pt flash has been dropped (see plug-in support has been dropped other than flash for more details).
...to make your plugin scri
ptable from web pages, use npruntime.
... scri
pting plugins (npruntime) this reference describes the new cross-browser npapi extensions that let plugins be scri
ptable and also let them access the scri
pt objects in the browser.
... scri
pting plugins: macromedia flash this article explains how javascri
pt can be used to access methods from within the flash plugin, as well as how a feature called fscommands can be used to access javascri
pt functions from within the flash animation.
Proposal - Archive of obsolete content
non of these are widely ado
pted standards.
... name descri
ption status easy news topics easy news topics (ent) is intended to be a very simple standard for describing how topic information can be introduced into an rss2.0 news feed.
...spec exists media rss rss extension module used for i
ptv and ipradio/podcasting.
...spec exists rss disposition hinting a proposal to make it so i
ptv and ipradio/podcasting works better with rss.
Security Controls - Archive of obsolete content
an organization may have an acce
ptable use policy that specifies the conduct of users, including not visiting malicious websites.
... security controls to help thwart phishing, besides the management control of the acce
ptable use policy itself, include operational controls, such as training users not to fall for phishing scams, and technical controls that monitor emails and web site usage for signs of phishing activity.
... when usability is an issue, many users will attem
pt to circumvent security controls; for example, if passwords must be long and complex, users may write them down.
... another fundamental principle with security controls is using multiple layers of security—defense in de
pth.
Theme changes in Firefox 2 - Archive of obsolete content
file descri
ption of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes.
...n:hover:active #history-button:hover:active #history-button[checked="true"] #home-button:hover #home-button:hover:active #new-tab-button:hover #new-tab-button:hover:active #new-window-button:hover #new-window-button:hover:active #paste-button:hover #paste-button:hover:active #print-button:hover #print-button:hover:active #reload-button:hover #reload-button:hover:active #searchbar[em
pty="true"] .searchbar-textbox #stop-button:hover #stop-button:hover:active #urlbar-icons-spacer #urlbar-spacer #urlbar[level="high"] #lock-icon:active #urlbar[level="high"] #lock-icon:hover #urlbar[level="low"] #lock-icon:active #urlbar[level="low"] #lock-icon:hover .autocomplete-treebody::-moz-tree-cell(suggesthint) .autocomplete-treebody::-moz-tree-cell-text(suggestfirst, treecolautocom...
... preferences/preferences.css the following styles are no longer used in firefox 2 and should be removed from your theme: #browserstartuphomepage #browserstartuphomepage #panedownloads descri
ption #panegeneral descri
ption radio[pane=panedownloads] radio[pane=panedownloads]:active the following styles need to be added to your theme to make it compatible with firefox 2: #panecontent descri
ption #panemain descri
ption #panesecurity descri
ption radio[pane=paneadvanced]:hover radio[pane=paneadvanced][selected="true"] radio[pane=panecontent]:hover radio[pane=panecontent][selected...
... #application #feedbody #feedchangesubscribeo
ptions #feederror #feedheader #feedheader[firstrun="true"] #feedheader[firstrun="true"] #feedintrotext #feedheader[firstrun="true"] #feedsubscribeline #feedintrotext #feedsubscribedonechangingo
ptions #feedsubscribehandletext #feedsubscribehandler #feedsubscribeline #feedsubscribeo
ptions #feedsubscribeo
ptionsgroup #feedsubscribeo
ptionsgrou
ptitle #feedtitlecontainer #feedtitleimage #fe...
Using Firebug and jQuery (Screencast) - Archive of obsolete content
note: this screencast is originally from: http://ejohn.org/blog/hacking-digg-w...ug-and-jquery/ this is an ada
ptation of a presentation that i gave while at mashup camp boston.
... we're going to take an introductory look at the firebug firefox extension and the jquery javascri
pt library - combining the two to build a reusable bookmarklet that can manipulate digg posts and comments.
... related links: firebug firefox extension jquery javascri
pt library jquery selector documentation digg learning jquery: jquerify bookmarklet if you wish to use greasemonkey instead of a bookmarklet, then by all means, please do so.
... you can use the ability to quickly analyze and inspect a page that firebug and jquery affords you, using the results to build a greasemonkey scri
pt, instead of a simple bookmarklet.
Using workers in extensions - Archive of obsolete content
the refreshinformation() method is fairly similar to the previous versions, with two notable exce
ptions: if the ticker symbol has not been set yet, an exce
ption is thrown (lines 4-6).
...watchstock() is updated to pass the symbol to the ticker thread, and refreshinformation(), whose main functionality is now in the worker, is updated to simply pass an em
pty message to the worker, which tells the worker to refresh the stock information immediately.
... watchstock: function(newsymbol) { this.tickersymbol = newsymbol.touppercase(); this.prefs.setcharpref("symbol", newsymbol); this.worker.postmessage(this.tickersymbol); }, refreshinformation: function() { // em
pty message just means 'refresh'.
...this code is essentially identical to what's done in the previous version, exce
pt that it's done in response to an event instead of within the refreshinformation() method.
-ms-filter - Archive of obsolete content
code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_h.htm <img style="filter:progid:dximagetransform.microsoft.motionblur(strength=50) progid:dximagetransform.microsoft.basicimage(mirror=1)" src="/workshop/samples/author/dhtml/graphics/cone.jpg" height="80px" width="80px" alt="cone"> the following example shows how to use scri
pting to set the filter on an image.
...lute; top: 20px; left: 20px;" src="sphere.jpg" alt="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div> <scri
pt type="text/javascri
pt"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfrom.filters.item(0).apply(); // 12 is the dissolve filter.
... filterfrom.filters.item(0).transition=12; imagefrom.style.visibility = "hidden"; filterto.style.visibility = ""; filterfrom.filters.item(0).play(14); } </scri
pt> </body> gradient progid:dximagetransform.microsoft.gradient( <properties> ) where <properties> = [ <enabled> | <endcolor> | <endcolorstr> | <gradienttype> | <startcolor> | <startcolorstr> ]# where <enabled> = 'enabled=' [ true | false ] <endcolor> = 'startcolor=' <color> <endcolorstr> = 'startcolorstr=' <color> <gradienttype> = 'gradienttype=' <integer> <startcolor> = 'startcolor=' <color> <startcolorstr> = 'startcolorstr=' <color> enabled default: true set to false to disable.
... initial value"" (the em
pty 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-...
-ms-wrap-flow - Archive of obsolete content
start inline flow content can wrap on the start edge of the exclusion area but must leave em
pty the area after the end edge of the exclusion area.
... end inline flow content can wrap after the end edge of the exclusion area but must leave em
pty the area before the start edge of the exclusion area.
... maximum inline flow content can wrap on the side of the exclusion with the largest available space for the given line, and must leave em
pty the other side of the exclusion.
... clear inline flow content can only wrap on top and bottom of the exclusion and must leave em
pty the areas to the start and end edges of the exclusion box.
CSS - Archive of obsolete content
pecifies values for the -ms-content-zoom-limit-min and -ms-content-zoom-limit-max properties.-ms-content-zoom-limit-maxthe -ms-content-zoom-limit-max css property is a microsoft extension that specifies the selected elements' maximum zoom factor.-ms-content-zoom-limit-minthe -ms-content-zoom-limit-min css property is a microsoft extension that specifies the minimum zoom factor.-ms-content-zoom-sna
pthe -ms-content-zoom-snap css shorthand property is a microsoft extension that specifies values for the -ms-content-zoom-snap-type and -ms-content-zoom-snap-points properties.-ms-content-zoom-snap-pointsthe -ms-content-zoom-snap-points css property is a microsoft extension that specifies where zoom snap-points are located.-ms-content-zoom-snap-typethe -ms-content-zoom-snap-type css property is a mi...
...ngthe -ms-content-zooming css property is a microsoft extension that specifies whether zooming is enabled.-ms-filterthe -ms-filter css property is a microsoft extension that sets or retrieves the filter or collection of filters applied to an object.-ms-flow-fromthe -ms-flow-from css property is a microsoft extension that gets or sets a value identifying a region container in the document that acce
pts the content flow from the data source.-ms-flow-intothe -ms-flow-into css property is a microsoft extension that gets or sets a value identifying an iframe container in the document that serves as the region's data source.-ms-high-contrast-adjustthe -ms-high-contrast-adjust css property is a microsoft extension that gets or sets a value indicating whether to override any css properties that would...
... a microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes.-ms-wrap-throughthe -ms-wrap-through css property is a microsoft extension that specifies how content should wrap around an exclusion element.:-moz-full-screen-ancestorthe :-moz-full-screen-ancestor css pseudo-class is a mozilla extension that represents all ancestors of the full-screen element, exce
pt containing frames in parent documents, which are the full-screen element in their own documents.
...a slider control is one possible representation of <input type="range">.::-ms-toolti
pthe ::-ms-tooltip css pseudo-element is a microsoft extension that represents the tooltip of a slider control.
Introduction - Archive of obsolete content
variable declarations are not limited to one element, and as with all javascri
pt, can span multiple lines.
... var element3 = <foo baz="1"/>; manipulating elements the goal of e4x was to provide an easier way for javascri
pt programmers to manipulate an xml document, without going through the dom interfaces.
...the most basic is appendchild var element1 = <foo/>; var element2 = <bar/>; element1.appendchild(element2); which produces exactly the xml document you'd expect <foo> <bar/> </foo> javascri
pt variables the true power of e4x only begins to come to light, however, when the xml document can interact closely with other javascri
pt.
... with special syntax, we can assign the value of a javascri
pt variable to be the value of an e4x element.
Array comprehensions - Archive of obsolete content
the array comprehension syntax was a javascri
pt expression which allowed you to quickly assemble a new array based on an existing one.
... syntax [for (x of iterable) x] [for (x of iterable) if (condition) x] [for (x of iterable) for (y of iterable) x + y] descri
ption inside array comprehensions, these two kinds of components are allowed: for...of and if the for-of iteration is always the first component.
... array comprehension was previously proposed to be standardized in ecmascri
pt 2016, it provide a useful shortcut for constructing a new array based on the contents of another.
...the same as below: [for (i of numbers) for (j of letters) if (i > 1) if(j > 'a') i + j] // ["2b", "2c", "3b", "3c"] [for (i of numbers) if (i > 1) [for (j of letters) if(j > 'a') i + j]] // [["2b", "2c"], ["3b", "3c"]], not the same as below: [for (i of numbers) [for (j of letters) if (i > 1) if(j > 'a') i + j]] // [[], ["2b", "2c"], ["3b", "3c"]] specifications was initially in the ecmascri
pt 2015 draft, but got removed in revision 27 (august 2014).
VBArray.dimensions - Archive of obsolete content
the first part is vbscri
pt code to create a visual basic safe array.
... the second part is javascri
pt code that determines the number of dimensions in the safe array and the upper bound of each dimension.
...the third part is the javascri
pt code that goes in the <body> section to run the other two parts.
... <head> <scri
pt type="text/vbscri
pt"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(j, i) = k k = k + 1 next next createvbarray = a end function --> </scri
pt> <scri
pt type="text/javascri
pt"> <!-- function vbarraytest(vba) { var i; var a = new vbarray(vba); var s = ""; for (i = 1; i <= a.dimensions(); i++) { s += "the upper bound of dimension "; s += i + " is "; s += a.ubound(i); s += ".<br />"; } return(s); } --> </scri
pt> </head> <body> <scri
pt type="text/javascri
pt"> document.write(vbarraytest(createvbarray())); </scri
pt> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 st...
VBArray.getItem - Archive of obsolete content
the first part is vbscri
pt code to create a visual basic safe array.
... the second part is javascri
pt code that iterates the visual basic safe array and prints out the contents of each element.
...the third part is the javascri
pt code that goes in the <body> section to run the other two parts.
... <head> <scri
pt type="text/vbscri
pt"> <!-- function createvbarray() dim i, j, k dim a(2, 2) k = 1 for i = 0 to 2 for j = 0 to 2 a(i, j) = k document.writeln(k) k = k + 1 next document.writeln("<br>") next createvbarray = a end function --> </scri
pt> <scri
pt type="text/javascri
pt"> <!-- function getitemtest(vbarray) { var i, j; var a = new vbarray(vbarray); for (i = 0; i <= 2; i++) { for (j =0; j <= 2; j++) { document.writeln(a.getitem(i, j)); } } } --> </scri
pt> </head> <body> <scri
pt type="text/javascri
pt"> <!-- getitemtest(createvbarray()); --> </scri
pt> </body> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 sta...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
while __nosuchmethod__ has been dropped, the ecmascri
pt 2015 specification has the proxy object, with which you can achieve the below (and more).
...} id the name of the non-existent method that was called args an array of the arguments passed to the method descri
ption by default, an attem
pt to call a method that doesn't exist on an object results in a typeerror being thrown.
...the function takes two arguments, the first is the name of the method attem
pted and the second is an array of the arguments that were passed in the method call.
... if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascri
pt engine will revert to throwing typeerrors.
Object.observe() - Archive of obsolete content
syntax object.observe(obj, callback[, acce
ptlist]) parameters obj the object to be observed.
... acce
ptlist the list of types of changes to be observed on the given object for the given callback.
... descri
ption callback is called each time a change is made to obj, with an array of all changes in the order in which they occurred.
...er.title + ' ' + user.name + '!'; } updategreeting(); object.observe(user, function(changes) { changes.foreach(function(change) { // any time name or title change, update the greeting if (change.name === 'name' || change.name === 'title') { updategreeting(); } }); }); custom change type // a point on a 2d plane var point = {x: 0, y: 0, distance: 0}; function setposition(
pt, x, y) { // performing a custom change object.getnotifier(
pt).performchange('reposition', function() { var olddistance =
pt.distance;
pt.x = x;
pt.y = y;
pt.distance = math.sqrt(x * x + y * y); return {olddistance: olddistance}; }); } object.observe(point, function(changes) { console.log('distance change: ' + (point.distance - changes[0].olddistance)); }, ['reposition...
LiveConnect Reference - Archive of obsolete content
javascri
pt-to-java these classes allow a java object to access javascri
pt code.
... jsexce
ption the public class jsexce
ption extends runtimeexce
ption, and is thrown when javascri
pt returns an error.
...javascri
pt objects are wrapped in an instance of the class jsobject and passed to java, allowing java to manipulate javascri
pt objects.
... java-to-javascri
pt global objects java packages netscape sun javaarray javaclass javaobject javapackage ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
marking up the fish in the old fish cam page, there was a table that contained the pictures and descri
ptions of the fish.
... <div class="card"> <img src="thumb_clown_trigger.jpg" alt="clown trigger" border="0" width="150" height="115"> <h3>clown trigger</h3> <p> our clown trigger is a bold little fish, though for a few weeks he sle
pt a lot and didn't look well in general.
...the reason for the class value being card is that the original idea was to style each fish's descri
ption like a trading card.
... ...or it would have been, exce
pt in some browsers the heading was drawn over the floated image, in contradiction to the css specification.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
this innovation, first introduced by microsoft® internet explorer and later ado
pted into the css specification, is very popular for the styling of text links, particularly those that are supposed to look and act like javascri
pt-driven "rollovers." however, advancing css support in browsers has caused some unexpectedly aggressive hovering behavior on some pages.
...scri
pting may change whether elements react to user events or not, and different devices and uas may have different ways of pointing to, or activating elements.
...the most reliable fix is to add the anchor element to the selectors, like this: a:hover {color: red;} a.nav:hover {color: red;} in an attem
pt to avoid causing problems for legacy documents, browsers based on mozilla 1.0 and later (netscape 7+) include code that causes bare pseudo-classes to be restricted only to links if the document is rendered in "quirks" mode.
... this brings up the second common problem, which is that named anchors can acce
pt hover styles.
RDF in Fifty Words or Less - Archive of obsolete content
the resource descri
ption framework, or "rdf", is really two things.
...that "internet resource" was a uri that pointed to a cgi scri
pt (say, http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox).
... the cgi scri
pt actually generatesserialized rdf, which is basically just a way of formatting a graph into xml: <rdf:rdf xmlns:rdf="http://www.w3.org/tr/wd-rdf-syntax#" xmlns:sm="http://www.mozilla.org/smart-mail/schema#"> <rdf:descri
ption about="http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox"> <sm:message id="4025293"> <sm:recipient> chris waterson "waterson@netscape.com" </sm:recipient> <sm:sender> aunt helga "helga@netcenter.net" </sm:sender> <sm:received-by>x-wing.mcom.com</sm:received-by> <sm:subject>great recipe for yam soup!</sm:subject> <sm:body> http://www.mozilla.org/smart-mail/get-body.cgi?id=4025293 </sm:body> </sm:message> <s...
...n@netscape.com" </sm:recipient> <sm:sender> sarah waterson "waterson.2@postbox.acs.ohio-state.edu" </sm:sender> <sm:received-by>x-wing.mcom.com</sm:received-by> <sm:subject>we won our ultimate game</sm:subject> <sm:body> http://www.mozilla.org/smart-mail/get-body.cgi?id=4025294 </sm:body> </sm:message> </rdf:descri
ption> </rdf:rdf> upon recei
pt of the above monstrosity, the rdf engine folds the rdf into the graph at the appropriate place, and the tree control that actually implements the ui to the bookmarks is notified that it should begin drawing some icons for the latest message about yam soup from aunt helga.
Build the brick field - Game development
building the brick field is a little bit more complicated than adding a single object to the screen, although it's still easier with phaser than in pure javascri
pt.
...add the initbricks() function at the end of our games code, just before the closing </scri
pt> tag, as shown below.
... now, let's start creating the bricks themselves — add an em
pty group first to contain the bricks, by adding the following line at the bottom of the initbricks() function: bricks = game.add.group(); we can loop through the rows and columns to create new brick on each iteration — add the following nested loop below the previous line of code: for(c=0; c<brickinfo.count.col; c++) { for(r=0; r<brickinfo.count.row; r++) { // create new brick and...
...update the brickx and bricky lines as follows: var brickx = (c*(brickinfo.width+brickinfo.padding))+brickinfo.offset.left; var bricky = (r*(brickinfo.height+brickinfo.padding))+brickinfo.offset.top; each brickx position is worked out as brickinfo.width plus brickinfo.padding, multiplied by the column number, c, plus the brickinfo.offset.left; the logic for the bricky is identical exce
pt that it uses the values for row number, r, brickinfo.height, and brickinfo.offset.top.
Game development
note: creating games on the web draws on a number of core web technologies such as html, css, and javascri
pt.
... port native games to the web if you are a native developer (for example writing games in c++), and you are interested in how you can port your games over to the web, you should learn more about our emscri
pten tool — this is an llvm to javascri
pt compiler, which takes llvm bytecode (e.g.
... to get started, see: about emscri
pten for an introduction including high-level details.
... emscri
pten tutorial for a tutorial to teach you how to get started.
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
networking and communications asynchronous communication is a method of exchanging messages between two or more parties in which each party receives and processes messages whenever it's convenient or possible to do so, rather than doing so immediately upon recei
pt.
...for example, the ajax (asynchronous javascri
pt and xml) programming technique—now usually simply "ajax", even though json is usually used rather than xml in modern applications—is a mechanism that requests relatively small amounts of data from the server using http, with the result being returned when available rather than immediately.
... software design asynchronous software design expands upon the conce
pt by building code that allows a program to ask that a task be performed alongside the original task (or tasks), without stopping to wait for the task to complete.
...see the article asynchronous javascri
pt for an introduction to them.
Boolean - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in javascri
pt, boolean conditionals are often used to decide which sections of code to execute (such as in if statements) or repeat (such as in for loops).
... below is some javascri
pt pseudocode (it's not truly executable code) demonstrating this conce
pt.
... /* javascri
pt if statement */ if (boolean conditional) { // code to execute if the conditional is true } if (boolean conditional) { console.log("boolean conditional resolved to true"); } else { console.log("boolean conditional resolved to false"); } /* javascri
pt for loop */ for (control variable; boolean conditional; counter) { // code to execute repeatedly if the conditional is true } for (var i=0; i < 4; i++) { console.log("i print only when the boolean conditional is true"); } the boolean value is named after english mathematician george boole, who pioneered the field of mathematical logic.
... learn more general knowledge boolean on wikipedia technical reference the javascri
pt global object: boolean javascri
pt data types and data structures ...
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
a call stack is a mechanism for an interpreter (like the javascri
pt interpreter in a web browser) to keep track of its place in a scri
pt that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
... when a scri
pt calls a function, the interpreter adds it to the call stack and then starts carrying out the function.
... call stack list: em
pty in summary, then, we start with an em
pty call stack.
...ultimately, the stack is em
pty again.
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
in cry
ptography, a cipher is an algorithm that can encode cleartext to make it unreadable, and to decode it back.
... ciphers were common long before the information age (e.g., substitution ciphers, transposition ciphers, and permutation ciphers), but none of them were cry
ptographically secure exce
pt for the one-time pad.
... modern ciphers are designed to withstand attacks discovered by a cry
ptanalyst.
... asymmetric key algorithms use a different key for encry
ption and decry
ption.
Constructor - MDN Web Docs Glossary: Definitions of Web-related terms
the conce
pt of a constructor can be applied to most object-oriented programming languages.
... essentially, a constructor in javascri
pt is usually declared at the instance of a class.
... syntax // this is a generic default constructor class default function default() { } // this is an overloaded constructor class overloaded // with parameter arguments function overloaded(arg1, arg2, ...,argn){ } to call the constructor of the class in javascri
pt, use a new operator to assign a new object reference to a variable.
... function default() { } // a new reference of a default object assigned to a // local variable defaultreference var defaultreference = new default(); learn more general knowledge constructor on wikipedia technical reference the constructor in object oriented programming for javascri
pt on mdn new operator in javascri
pt on mdn ...
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
javascri
pt uses type conversion to coerce any value to a boolean in contexts that require it, such as conditionals and loops.
... "" em
pty string value null null - the absence of any value undefined undefined - the primitive value nan nan - not a number objects are falsy if and only if they have the [[ishtmldda]] internal slot.
... this slot only exists in document.all and cannot be set using javascri
pt.
... examples examples of falsy values in javascri
pt (which are coerced to false in boolean contexts, and thus bypass the if block): if (false) if (null) if (undefined) if (0) if (-0) if (0n) if (nan) if ("") the logical and operator, && if the first object is falsy, it returns that object false && "dog" // ↪ false 0 && "dog" // ↪ 0 specifications specification ecmascri
pt (ecma-262)the definition of 'toboolean abstract operation' in that specification.
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
an idl (interface descri
ption language) is a generic language used to specified objects' interfaces apart from any specific programming language.
... the idl attribute is also known as a javascri
pt property.
... these are the attributes you can read or set using javascri
pt properties like element.foo.
...if you pass another type, it is automatically converted to a number as specified by the standard javascri
pt rules for type conversion.
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
a man-in-the-middle attack (mitm) interce
pts a communication between two systems.
... comparing this to physical mail: if you're writing letters to each other, the mailman can interce
pt each letter you mail.
... sensitive sites without https encry
ption on public wi-fi networks aren't trustworthy.
... check for https in your address bar and ensure encry
ption is in-place before logging in.
Parse - MDN Web Docs Glossary: Definitions of Web-related terms
parsing means analyzing and converting a program into an internal format that a runtime environment can actually run, for example the javascri
pt engine inside browsers.
...parsing can continue when a css file is encountered, but <scri
pt> tags—particularly those without an async or defer attribute—blocks rendering, and pauses parsing of html.
...javascri
pt is also downloaded, parsed, and then execute.
... javascri
pt parsing is done during compile time or whenever the parser is invoked, such as during a call to a method.
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
screen readers are software applications that attem
pt to convey what is seen on a screen display in a non-visual way, usually as text to speech, but also into braille or sound icons.
... desktop/la
ptop screen reader users navigate websites with a keyboard or other non-pointing device.
...u can navigate through interactive elements using the tab key and the arrow keys: next interactive element: tab previous interactive element: shift + tab next radio button in a same named-group: right or down arrow previous radio button in a same named-group: left or up arrow navigating through the content of a page is done with the tab key and a series of other keys along with control + o
ption keys next heading: control + o
ption + h next list: control + o
ption + x next graphic: control + o
ption + g next table: control + o
ption + t down an html hierarchical order control + o
ption + right arrow previous heading: shift + control + o
ption + h previous list: shift + control + o
ption + x previous graphic: shift + control + o
ption + g previous table: shift + control + o
ption + t...
... up an html hierarchical order: control + o
ption + left arrow learn more aria ...
Sloppy mode - MDN Web Docs Glossary: Definitions of Web-related terms
ecmascri
pt 5 and later let scri
pts o
pt in to a new strict mode, which alters the semantics of javascri
pt in several ways to improve its resiliency and which make it easier to understand what's going on when there are problems.
... the normal, non-strict mode of javascri
pt is sometimes referred to as sloppy mode.
... this isn't an official designation, but you are likely to come across it if you spend time doing serious javascri
pt code.
... learn more general knowledge "strict mode" in cha
pter 7 ("javascri
pt syntax") in the book speaking javascri
pt.
Syntax error - MDN Web Docs Glossary: Definitions of Web-related terms
an exce
ption caused by the incorrect use of a pre-defined syntax.
... for example, if you leave off a closing brace (}) when defining a javascri
pt function, you trigger a syntax error.
... browser development tools display javascri
pt and css syntax errors in the console.
... learn more general knowledge syntax error on wikipedia syntaxerror javascri
pt object ...
Truthy - MDN Web Docs Glossary: Definitions of Web-related terms
in javascri
pt, a truthy value is a value that is considered true when encountered in a boolean context.
... all values are truthy unless they are defined as falsy (i.e., exce
pt for false, 0, -0, 0n, "", null, undefined, and nan).
... javascri
pt uses type coercion in boolean contexts.
... examples of truthy values in javascri
pt (which will be coerced to true in boolean contexts, and thus execute the if block): if (true) if ({}) if ([]) if (42) if ("0") if ("false") if (new date()) if (-42) if (12n) if (3.14) if (-3.14) if (infinity) if (-infinity) specifications specification ecmascri
pt (ecma-262)the definition of 'toboolean abstract operation' in that specification.
Advanced styling effects - Learn web development
note: there is another item that can be set in the box-shadow value — another length value can be o
ptionally set just before the color value, which is a spread radius.
...take a look at the mdn page for filter for many other o
ptions you could try.
...some of the filter o
ptions available do very similar things to other css features, for example drop-shadow() works in a very similar way and gives a similar effect to box-shadow or text-shadow.
...there is no support as yet in edge, and safari only supports some of the blend mode o
ptions.
Fundamental CSS comprehension - Learn web development
the final step before you move on is to attem
pt the assessment for the module — this involves a number of related exercises that must be completed in order to create the final design — a business card/gamer card/social media profile.
... prerequisites: before attem
pting this assessment you should have already worked through all the articles in this module.
... hints and tips you don't need to edit the html in any way, exce
pt to apply the css to your html.
...your post should include: a descri
ptive title such as "assessment wanted for fundamental css comprehension".
Positioning - Learn web development
</p> now add the following rule to the bottom of your css: .positioned { position: static; background: yellow; } if you now save and refresh, you'll see no difference at all, exce
pt for the updated background color of the 2nd paragraph.
...this is very similar to static positioning, exce
pt that once the positioned element has taken its place in the normal layout flow, you can then modify its final position, including making it overlap other elements on the page.
...0 auto; position: relative; } p { background: aqua; border: 3px solid blue; padding: 10px; margin: 10px; } span { background: red; border: 1px solid black; } .positioned { position: absolute; background: yellow; top: 30px; left: 30px; } p:nth-of-type(1) { position: absolute; background: lime; top: 10px; right: 30px; z-index: 1; } note that z-index only acce
pts unitless index values; you can't specify that you want one element to be 23 pixels up the z-axis — it doesn't work like that.
...this works in exactly the same way as absolute positioning, with one key difference: whereas absolute positioning fixes an element in place relative to its nearest positioned ancestor (the initial containing block if there isn't one), fixed positioning usually fixes an element in place relative to the visible portion of the viewport, exce
pt if one of its ascendants is a fixed containing block due to its transform property being different from none.
What text editors are available? - Learn web development
that works great for writing notes to yourself, but when you're doing web development and writing in html, css, and javascri
pt, you can produce some pretty large, complex files.
...make sure in particular that your text editor supports highlighting for html, css, and javascri
pt.
...an ide provides many tools in one interface and it's a bit daunting for beginners, but always an o
ption if your text editor feels too limited.
... here are some popular ides: a
ptana studio eclipse komodo ide netbeans ide visual studio webstorm do i need support/help while using my text editor?
What is accessibility? - Learn web development
this article introduces the basic conce
pts behind web accessibility.
...in general, we must think about our product from the viewpoints of all our target customers, and ada
pt accordingly.
...you have to provide subtitles —or even better, a full text transcri
pt.
... visual impairment again, provide a text transcri
pt that a user can consult without needing to play the video, and an audio-descri
ption (an off-screen voice that describes what is happening in the video).
Example 2 - Learn web development
js html content <form class="no-widget"> <select name="myfruit"> <o
ption>cherry</o
ption> <o
ption>lemon</o
ption> <o
ption>banana</o
ption> <o
ption>strawberry</o
ption> <o
ption>apple</o
ption> </select> <div class="select"> <span class="value">cherry</span> <ul class="o
ptlist hidden"> <li class="o
ption">cherry</li> <li class="o
ption">lemon</li> <li class="o
ption">banana</li> <li class="o
ption">strawberry</li> <li class="o
ption">apple</li> </ul> </div> <form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* ...
...--------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .o
ptlist { position: absolute; top : 100%; left : 0; } .select .o
ptlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : -webk...
...tical-align: top; } .select:after { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .o
ptlist { z-index : 2; list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .o
ption { ...
... padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascri
pt content window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); result for js no js html content <form class="no-widget"> <select name="myfruit"> <o
ption>cherry</o
ption> <o
ption>lemon</o
ption> <o
ption>banana</o
ption> <o
ption>strawberry</o
ption> <o
ption>apple</o
ption> </select> <div class="select"> <span class="value">cherry</span> <ul class="o
ptlist hidden"> <li class="o
ption">cherry</li> <li class="o
ption">lemon</li> <li class="o
ption">banana</li> <li class="o
ption">strawberry</li> <li class="o
ption">apple</li> ...
Use HTML to solve common problems - Learn web development
standable how to add quotations and citations to web pages how to define terms with html hyperlinks one of the main reasons for html is making navigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a table of contents with html images & multimedia how to add images to a webpage how to add video content to a webpage scri
pting & styling html only sets up document structure.
... to solve presentation issues, use css, or use scri
pting to make your page interactive.
... how to use css within a webpage how to use javascri
pt within a webpage embedded content how to embed a webpage within another webpage how to add flash content within a webpage uncommon or advanced problems beyond the basics, html is very rich and offers advanced features for solving complex problems.
...it's one of the most complex html structures, and mastering it is not easy: how to create a data table how to make html tables accessible data representation how to represent numeric and code values with html — see superscri
pt and subscri
pt, and representing computer code.
Document and website structure - Learn web development
we use color and font size to draw sighted users' attention to the most useful parts of the content, like the navigation menu and related links, but what about visually impaired people for example, who might not find conce
pts like "pink" and "large font" very useful?
...tml> <head> <meta charset="utf-8"> <title>my page title</title> <link href="https://fonts.googleapis.com/css?family=open+sans+condensed:300|sonsie+one" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="style.css"> <!-- the below three lines are a fix to get html5 semantic elements working in old versions of internet explorer--> <!--[if lt ie 9]> <scri
pt src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></scri
pt> <![endif]--> </head> <body> <!-- here is our main header that is used across all the pages of our website --> <header> <h1>header</h1> </header> <nav> <ul> <li><a href="#">home</a></li> <li><a href="#">our team</a></li> <li><a href="#">projects</a></li...
...sometimes you might want to just group a set of elements together to affect them all as a single entity with some css or javascri
pt.
...the homepage will probably be in the center, and link to most if not all of the others; most of the pages in a small site should be available from the main navigation, although there are exce
ptions.
Marking up a letter - Learn web development
prerequisites: before attem
pting this assessment you should have already worked through getting started with html, what's in the head?
... in general, the letter should be marked up as an organization of headings and paragraphs, with the following exce
ption.
... the six sub/superscri
pts should be marked up appropriately — in the chemical formulae, and the numbers 103 and 104 (they should be 10 to the power of 3 and 4, respectively).
...your post should include: a descri
ptive title such as "assessment wanted for marking up a letter".
Structuring the web with HTML - Learn web development
it is recommended that you work through getting started with the web before attem
pting this topic, however, it isn't absolutely necessary; much of what is covered in the html basics article is also covered in our introduction to html module, albeit in a lot more detail.
... after learning html, you can then move on to learning about more advanced topics such as: css, and how to use it to style html (for example alter your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other visual effects.) javascri
pt, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them.
... introduction to html this module sets the stage, getting you used to important conce
pts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage.
...this module covers basic table markup, along with more complex features such as implementing ca
ptions and summaries.
Test your skills: Conditionals - Learn web development
note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascri
pt console, in the case of the downloadable version).
... pwdresult — begins uninitialized, but is later used to store a reponse that will be printed to the output panel, letting the user know whether their login attem
pt was succcessful.
...if not, it should assign a different string to pwdresult telling the user their login attem
pt was not successful.
...your post should include: a descri
ptive title such as "assessment wanted for conditionals 1 skill test".
Test your skills: Events - Learn web development
note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascri
pt console, in the case of the downloadable version).
... 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 javascri
pt.
... the html should not be changed; just the javascri
pt.
...your post should include: a descri
ptive title such as "assessment wanted for events 1 skill test".
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 javascri
pt and useful string methods articles.
... note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascri
pt console, in the case of the downloadable version).
...we want you to fix and update it, like so: change the casing to correct sentence case (all lowercase, exce
pt for upper case first letter).
...your post should include: a descri
ptive title such as "assessment wanted for strings 1 skill test".
Test your skills: JSON - Learn web development
note: in the example below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascri
pt console, in the case of the downloadable version).
... why are the para1.textcontent = motherinfo; and para2.textcontent = kitteninfo; lines inside the displaycatinfo() function, and not at the end of the scri
pt?
...in the live code editor above, both the javascri
pt code and the requested json file are on the same origin (the code sits on a github repo, and is embedded here in an <iframe>).
...your post should include: a descri
ptive title such as "assessment wanted for json skill test".
HTML performance features - Learn web development
complications can occur when, for example, the file size of a <video> embed is too large, or when a webpage is not o
ptimized for mobile devices.
... objective: to learn about the impact of html elements and attributes on web performance o
ptimization.
... elements & attributes impacting performance the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <scri
pt> rel attribute conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
... measuring performance multimedia: images multimedia: video javascri
pt performance best practices.
Measuring performance - Learn web development
this article introduces web perfomrance metrics that you can use to measure and o
ptimize your site's performance.
...these interfaces allows the accurate measurement of the time it takes for javascri
pt tasks to complete.
...they also indicate areas that can be improved to o
ptimize your web app.
... measuring performance multimedia: images multimedia: video javascri
pt performance best practices.
Tools and testing - Learn web development
once you've started to become comfortable programming with core web technologies (like html, css, and javascri
pt), and you start to get more experience, read more resources, and learn more tips and tricks, you'll start to come across all kind of tools, from javascri
pt frameworks, to testing and automation tools, and more besides.
... get started prerequisites you should really learn the basics of the core html, css, and javascri
pt languages first before attem
pting to use many the tools detailed here.
... for example, you'll need to know the fundamentals of these languages before you start debugging problems in complex web code, making effective use of javascri
pt frameworks, or writing tests and running them against your code using test runners.
... understanding client-side javascri
pt frameworks javascri
pt frameworks are an essential part of modern front-end web development, providing developers with tried and tested tools for building scalable, interactive web applications.
Chrome Worker Modules
you only need to do it once for each worker, from within the chrome worker itself: importscri
pts("resource://gre/modules/workers/require.js"); note: although you only need to do this once for each worker, it doesn't hurt if you do it more than once.
...core.declareffi(...) note that, for the moment, require() only acce
pts absolute uris.
...that is, the following will not show human-readable stacks: try { mymodule.foo(); } catch (ex) { log("exce
ption raised at " + ex.filename) log("stack: " + ex.stack); } rather, you should use properties modulename and modulestack, as follows: try { mymodule.foo(); } catch (ex) { log("exce
ption raised at " + ex.modulename) log("stack: " + ex.modulestack); } subtleties you shouldn’t mix both styles exports.foo = bar and module.exports = {foo: bar}.
...no attem
pt is made to fully isolate modules from each other.
omni.ja (formerly omni.jar)
this change was needed to prevent firefox from becoming corru
pted.
... several unzip tools and archives (exce
pt for the latest version of 7-zip) currently cannot read omni.ja, due to the o
ptimization that is applied to the file.
... omni.ja is also incompatible with zip files in the other direction; editing extracted files won't affect firefox, and repacking edited files may break firefox if you do not use the right o
ptions when packing the extracted files.
... /modules javascri
pt code modules.
Adding a new CSS property
(which set the property is in is given in the specification, which says "inherited: yes" or "inherited: no" in the property's definition.) also note that some of the style structs intentionally contain only properties set/reset by a particular common shorthand property; this improves the effectiveness of some of the performance and memory o
ptimizations done with the rule tree, and thus we should avoid adding a property not reset by that shorthand to such a struct.
... you'll need to use css_property_parse_function as described above; you can't use the other o
ptions for shorthands.
... this line describes the conce
ptual representation (but not syntax) of the computed value of the property.
... the data structures in gecko that store the computed value must correspond to this conce
pt, or inheritance won't work as described by the specification.
Testopia
despite bugzilla 5.0 has already been released a few months ago, we don't plan to release a fix for testopia immediately, because it's currently under heavy work to make testopia a fully self-contained extension, which means that all tr_*.cgi scri
pts which are currently in the bugzilla/ root directory are being moved into extensions/testopia/lib/.
...though all attem
pts have been made to provide continuing support for positional parameters, please be aware that some api calls may fail until you make this change.
... as always please backup your installation before attem
pting to install or upgrade.
... new reports: worst offender and case roll-up set priorities on indidual case-runs new clone o
ptions uses the latest extjs 3.0 library converts testopia into a true bugzilla extension numerous bug fixes integration points testopia integrates with bugzilla products, components, versions, and milestones to allow a single management interface for high level objects.
Building SpiderMonkey with UBSan
save the following bash scri
pt, fixing llvm_root to point to your installation.
.../bin/sh if [ -z $1 ] ; then echo "usage: $0 <dirname>" elif [ -d $1 ] ; then echo "directory $1 already exists" else autoconf2.13 autoconf213 mkdir $1 cd $1 llvm_root="$home/llvm" sanflag="-fsanitize=undefined -fno-sanitize=alignment,float-cast-overflow,float-divide-by-zero,v
ptr -dxmalloc=myxmalloc" \ cc="$llvm_root/build/release+asserts/bin/clang" \ cxx="$llvm_root/build/release+asserts/bin/clang++" \ cflags="$sanflag" \ cxxflags="$sanflag" \ moz_llvm_hacks=1 \ ../configure --enable-debug --disable-o
ptimize make -j 8 fi 3.
... use the scri
pt to compile spidermonkey.
...r than: alignment, which hits known bugs in spidermonkey, and is more implementation-defined (slow on x86 / crash on arm) than undefined behavior float-cast-overflow, which hits known bugs in spidermonkey, and isn't exploited by today's compilers float-divide-by-zero, which jesse doesn't think is actually undefined behavior (aside from the question of whether cpu overflow flags are set) v
ptr, a check that requires rtti, which is disabled by default in spidermonkey 4.
Creating a Login Manager storage module
sample javascri
pt implementation the following code snippet is a javascri
pt component that implements a dummy nsiloginmanagerstorage interface.
... see how_to_build_an_xpcom_component_in_javascri
pt for more details about javascri
pt components.
... const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); function sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescri
ption: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _xpcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging service, used for debugging.
...the category registration looks like this: nscom
ptr<nsicategorymanager> cat = do_getservice(ns_categorymanager_contractid); ns_ensure_state(cat); cat->addcategoryentry("login-manager-storage", "nsiloginmanagerstorage", kyourcontractid, pr_true, pr_true, nsnull); don't forget to unregister the category on unload.
Creating reftest-based unit tests
if a browser changes the de
pth of the indenting and the visual construct is tested against an invariant, the test would appear to fail.
... running reftest-based unit tests note: mach is a python2 scri
pt.
...run a particular set of reftests, pass the path as an argument: ./mach reftest path/from/sourcedir/reftest.list and to run a single reftest just pass the path to the test file (not the reference file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the scri
pt that removes it) will keep it open longer.
...sorry about this, but the released builds and the nightly builds are built with the "--disable-tests" o
ption and reftest will not work - see bug 369809.
Debugging Frame Reflow
element width maximum width frame status overflow area getting the log make sure that your build is a debug build (in short you need ac_add_o
ptions --enable-debug in your .mozconfig file).
...inline inline letter letter line line select select obj object page page place placeholder posinline positionedinline canvas canvas root root scroll scroll ca
ption tableca
ption cell tablecell bccell bctablecell col tablecol colg tablecolgroup tbl table tblo tableouter rowg tablerowgroup row tablerow textctl textinput text text ...
...other reflow debug o
ptions gecko_display_reflow_flag_pixel_errors setting this o
ption via set gecko_display_reflow_flag_pixel_errors = 1 enables a verification for each coordinate value that the coordinates are aligned at pixel boundaries.
...gecko_display_reflow_indent_undisplayed_frames setting this o
ption via set gecko_display_reflow_indent_undisplayed_frames = 1 will cause an advance of the indent even for frames which are blocked via the reflow rules file.
Adding APIs to the navigator object
simply add an entry to the "javascri
pt-navigator-property" category.
...you can read about creating and registering xpcom components in javascri
pt.
... programmatically adding an object to navigator var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); categorymanager.addcategoryentry("javascri
pt-navigator-property", "myapi", my_contract_id, false, true); this adds a new object, myapi, to the window.navigator object.
... using a manifest to add an object to navigator you can also add an object to the window.navigator object by using the chrome manifest of an add-on: component {ffffffff-ffff-ffff-ffff-ffffffffffff} mycomponent.js contract @mozilla.org/mycomponent;1 {ffffffff-ffff-ffff-ffff-ffffffffffff} category javascri
pt-navigator-property mycomponent @mozilla.org/mycomponent;1 generate a guid and replace the "ffff" sections in both the component and contract lines with your guid.
Gecko Logging
set moz_log="example_logger:3" in the windows command prom
pt (cmd.exe), don't use quotes: set moz_log=example_logger:3 if you want this on geckoview example, use the following adb command to launch process: adb shell am start -n org.mozilla.geckoview_example/.geckoviewactivity --es env0 "moz_log=example_logger:3" there are special module names to change logging behavior.
... note: this o
ption disables 'append' and forces 'timestamp'.
... set moz_log_file="log.txt" the rotate and append o
ptions described above only apply when logging to a file.
... check the env_logger docs for more details on logging o
ptions.
mozbrowsercontextmenu
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type descri
ption target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascri
pt object with the following properties: clientx the x value of the coordinate that was clicked inside the browser <iframe>'s viewport.
... items an array of further menu objects, which indicate the menu o
ptions available in a menu, if the context menu being accessed is a menu.
...queryselector("iframe"); browser.addeventlistener("mozbrowsercontextmenu", function(event) { console.log("asking for menu:" + json.stringify(event.details)); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprom
pt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsererror
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type descri
ption target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascri
pt object with the following properties: type a domstring representing the type of error that occurred.
... possible values are: fatal(crash) unknownprotocolfound filenotfound dnsnotfound connectionfailure netinterru
pt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corru
ptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowse...
...rlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprom
pt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsermetachange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type descri
ption target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascri
pt object with the following properties: name a domstring representing the <meta> name attribute value.
... lang o
ptional a domstring representing the <meta> name attribute value, if included.
...its name is " + event.details.name + ", and its content is " + event.details.content + "."); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprom
pt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
How Mozilla determines MIME Types
content-type "hints" mozilla has a conce
pt of "content-type hints".
...it does the following: checks the start of the file for "magic numbers"; this can currently detect pdf and postscri
pt.
...if one of these lookups succeed, this is where the application in the "open with" field comes from, and also where the descri
ption of the type comes from.
... if this also failed, the extras are searched again, and will supply the extension-list and a descri
ption of the mime type.
IPDL Best Practices
a good example of this problem is the amount of memory management bugs that we have had with using surfacedescri
ptor directly everywhere.
... implement (preferably reference counted) classes to wrap the shared data instead of letting several objects reference surfacedescri
ptors or their content directly.
...vised actor::actordestroy - non-ipdl cleanup manager::deallocpprotocol - deallocation one construct to avoid: class protocolparent { public: ~protocolparent() { send__delete__(this); } }; class protocolmanagerparent { public: pprotocolparent* allocpprotocol() { return new protocolparent(); } bool deallocpprotocol() { return true; } }; nsauto
ptr<pprotocolparent> parent = manager->sendpprotocolconstructor(); while this may look appealing as the ipdl logic is stuffed away in a sensible place, it breaks under error conditions.
... specifically, because allocpprotocol and deallocpprotocol are asymmetric, if ipdl ends up shutting down the protocol tree due to an error, the auto pointer will attem
pt to trigger protocol deletion a second time.
Internationalized Domain Names (IDN) Support in Mozilla Browsers
there are many languages whose writing scri
pts are not based on latin alphabet at all.
..."bq--" for race, but all exce
pt the standard ace prefix "xn--" are now disallowed in idn.
... most of the existing sites currently use the ascii-compatible encoding known as race or row-based ascii compatible encoding, which was not acce
pted as a standard by ietf.
... idn is a global trend and is likely to be ado
pted by a large number of sites making it easier for average internet users to find web sites.
Assert.jsm
the assert.jsm javascri
pt code module implements the commonjs unit testing specification version 1.1, which provides a basic, standardized interface for performing in-code logical assertions with o
ptional, customizable error reporting.
... to use it, you first need to import the code module into your javascri
pt scope: components.utils.import("resource://testing-common/assert.jsm"); the assert class offers methods for performing common logical assertions.
... this statement is equivalent to assert.equal(true, !!guard, message_o
pt);.
... to test strictly for the value true, use assert.strictequal(true, guard, message_o
pt);.
Widget Wrappers
attribute descri
ption id the widget's id type the type of widget (button, view, custom).
...nb: this property is writable, and will toggle all the widgets' nodes' disabled states label for api-provided widgets, the label of the widget toolti
ptext for api-provided widgets, the tooltip of the widget showinprivatebrowsing for api-provided widgets, whether the widget is visible in private browsing single wrapper properties all of a wrapper's properties are read-only unless otherwise indicated.
... attribute descri
ption id the widget's id type the type of widget (button, view, custom).
...he anchor for the panel menu if your widget is inside the panel menu, and to the node itself in all other cases overflowed boolean indicating whether the node is currently in the overflow panel of the toolbar isgroup false, will be true for the group widget label for api-provided widgets, convenience getter for the label attribute of the dom node toolti
ptext for api-provided widgets, convenience getter for the toolti
ptext attribute of the dom node disabled for api-provided widgets, convenience getter and setter for the disabled state of this single widget.
FxAccountsProfileClient.jsm
the fxaccountsprofileclient.jsm javascri
pt module provides a way to fetch firefox accounts profile information.
...components.utils.import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object o
ptions); method overview fetchprofile(); attributes serverurl url profiler server url.
...fxaccountsprofileclient fxaccountsprofileclient( object o
ptions 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 descri
ption message string error message ...
OSFile.jsm
javascri
pt module os.file contains primitives for manipulating files out of the main thread.
... os.file is a new api designed for efficient, off-main thread, manipulation of files by privileged javascri
pt code.
... this api is intended to replace, in time, most xpcom-based manipulation of files (nsifile, subsets of nsiioservice, etc.) by javascri
pt code.
... consequently, one of the key design choices of os.file is to provide operations that are low-level enough that they do not hide any i/o from the developer (which could cause the developer to perform more i/o than they think) and, since not all platforms have the same features, offer system-specific information that the developer can use to o
ptimize his algorithms for a platform.
Deferred
of var deferred = promise.defer(); dosomething(function cb(good) { if (good) deferred.resolve(); else deferred.reject(); }); return deferred.promise; would be return new promise(function(resolve, reject) { dosomething(function cb(good) { if (good) resolve(); else reject(); }); }); method overview void resolve([o
ptional] avalue); void reject([o
ptional] areason); properties attribute type descri
ption promise read only promise a newly created promise, initially in the pending state.
... void resolve( avalue ); parameters avalue o
ptional if this value is not a promise, including undefined, it becomes the fulfillment value of the associated promise.
... void reject( areason ); parameters areason o
ptional the rejection reason for the associated promise.
... although the reason can be undefined, it is generally an error object, like in exce
ption handling.
Examples
this state will propagate to newpomise, and components.utils.reporterror will report all the details of the exce
ption to the console.
...mise.then( function(asuccessreason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { return 'i didnt do a promise.resolve so this will not understand that mypromise is a promise'; } // creates this error: /* exce
ption: mypromise.then is not a function @scratchpad/5:8:1 wca_evalwithdebugger@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webconsole.js:1069:7 wca_onevaluatejs@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webconsole.js:734:9 dsc_onpacket@resource://gre/modules/commonjs/toolkit/loader.js -> r...
... settimeout(function () { deferred.resolve('rawr my success value'); }, atimeout); } catch (ex) { // generally, functions returning promises propagate exce
ptions through // the returned promise, though they may also choose to fail early.
...} we ado
pt the following strategy: if a promise is rejected at the time of its garbage-collection and if the promise is at the end of a promise chain (i.e.
Deferred
method overview void resolve([o
ptional] avalue); void reject([o
ptional] areason); properties attribute type descri
ption promise read only promise a newly created promise, initially in the pending state.
... void resolve( avalue ); parameters avalue o
ptional if this value is not a promise, including undefined, it becomes the fulfillment value of the associated promise.
... void reject( areason ); parameters areason o
ptional the rejection reason for the associated promise.
... although the reason can be undefined, it is generally an error object, like in exce
ption handling.
Services.jsm
the services.jsm javascri
pt code module offers a wide assortment of lazy getters that simplify the process of obtaining references to commonly used services.
... to use it, you first need to import the code module into your javascri
pt scope: const {services} = chromeutils.import("resource://gre/modules/services.jsm"); then you can obtain references to services by simply accessing them from the services object exported by the code module.
...tener service etld nsieffectivetldservice effectivetld service focus nsifocusmanager focus manager io nsiioservice nsiioservice2 i/o service locale nsilocaleservice locale service logins nsiloginmanager password manager service metro nsiwinmetroutils 2 mm nsimessagebroadcaster nsiframescri
ptloader global frame message manager3 obs nsiobserverservice observer service perms nsipermissionmanager permission manager service ppmm nsimessagebroadcaster nsiprocessscri
ptloader global parent process message manager3 prefs nsiprefbranch nsiprefbranch2 nsiprefservice preferences service prom
pt nsiprom
ptservice...
... prom
pt service scri
ptloader mozijssubscri
ptloader javascri
pt subscri
pt loader service scri
ptsecuritymanager nsiscri
ptsecuritymanager scri
pt security manager search nsibrowsersearchservice browser search service startup nsiappstartup application startup service storage mozistorageservice storage api service strings nsistringbundleservice string bundle service sysinfo nsipropertybag2 system info service telemetry nsitelemetry telemetry service tm nsithreadmanager thread manager service urifixup nsiurifixup uri fixup service urlformatter nsiurlformatter url formatter service vc nsiversioncomparator version compara...
Index
found 42 pages: # page tags and summary 1 localization at mozilla landing, localization, mozilla, translation, l10n localization (l10n) is the process of translating software user interfaces from one language to another and ada
pting it to suit a foreign culture.
... 5 index localization found 42 pages: 6 l10n checks internationalization, localization, localization:tools, tools l10n checks is a python scri
pt and library similar to compare-locales.
...the goal of the standard is to have an xml-based format to use when exchanging localization data between tools without the potential of data loss or corru
ption.
... 21 localizing extension descri
ptions add-ons, extensions, guide, internationalization, localization this article provides details on how to go about localizing the descri
ptions of mozilla add-ons, as well as for other metadata about your add-on.
Mozilla Content Localized in Your Language
acronyms do you translate widely acce
pted acronyms such as cd, dvd, mb?
... if translated, is there an equavilent acronym and widely acce
pted in the language?
... gender are there exce
ptions to standard gender conventions within your language?
...used to express certain conce
pts in your language?
QA phase
to create and configure this file, follow these instructions: until the fix for bug 1063880 lands on mozilla-aurora and mozilla-beta when building language packs against those two trees you should: remove ac_add_o
ptions --disable-compile-environment from .mozconfig in step 3 use ./mach build config after step 4 update the mozilla source code: $ cd mozilla-aurora $ hg pull -u enter the following command to create the .mozconfig file: $ nano -w .mozconfig enter the following lines in your .mozconfig file: mk_add_o
ptions moz_objdir=@topsrcdir@/../firefox-build ac_add_o
ptions --disable-comp...
...ile-environment ac_add_o
ptions --with-l10n-base=../l10n-central # path relative to moz_objdir ac_add_o
ptions --enable-application=[browser or mail] you will need to specify which application you're localizing in the fourth line (e.g., for firefox, that's browser, thunderbird would be mail).
...at this point you can choose between two build o
ptions.
...acce
pted payload.
Localization technical reviews
make sure that the the text content is wrapped with em
ptylines.
... leading comments are ok, but watch out for #filter em
ptylines #define ...
...#unfilter em
ptylines in toolkit/defines.inc, the native name of the language is specified, which is used as descri
ption for the built language packs.
... more intl.properties checkpoints, cont we also check the plural rule for the locale, that the general.useragent.locale is set to the locale code, that acce
pt-lang shows the locale code(s) (like ab, ab-cd,...) and is followed by en and en-us, and finally that intl.menuitems.insertseparatorbeforeaccesskeys = true, where "true" should be left untranslated.
Setting up the infrastructure
create a new branch for l10n (o
ptional if starting a new project).
... copy the shell scri
pts 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.
... by default the scri
pt looks for gettext calls in *thtml or *.php files, so you may need to adjust that to your code.
... create an em
pty filed named messages.po in the locale/lc_messages folder.
Fonts for Mozilla's MathML engine
on debian/ubuntu/mint and other debian-based distributions, use the following command: sudo a
pt-get install fonts-lmodern fonts-stix on fedora and other fedora-based distributions, use the following command (stix-math-fonts is often already installed): sudo dnf install texlive-lm-math stix-math-fonts on opensuse and other opensuse-based distributions, use the following command: sudo zypper install texlive-lm-math stix-fonts on other linux distributions, consider installing appropriate ...
... installation without administrator privilege if you need to install fonts on a system without adminstrator privilege, the easiest o
ption is to use math font the mathml-fonts add-on.
... note that using the add-on is not o
ptimal since it forces your gecko browser to load a css stylesheet on each page you visit as well as web math fonts on all pages with mathml content.
...ucida bright math minion math stix math tex gyre bonum math tex gyre pagella math tex gyre schola math tex gyre termes math xits math fira math (sans-serif typeface, under development) gfs neohellenic math (sans-serif typeface) using mathematical fonts on web pages starting with gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), it is now easy to set up the css style (and o
ptional woff fonts) to use on your web site.
Mozilla Port Blocking
background on 08/15/2001, cert issued a vulnerability note vu#476267 for a "cross-protocol" scri
pting attack, known as the html form protocol attack which allowed sending arbitrary data to most tcp ports.
...by default, mozilla now blocks access to specific ports which are used by vulnerable services in order to prevent security vulnerabilites due to "cross-protocol scri
pting".
...if a user attem
pts to access a uri on a blocked port, mozilla shows one of the following alerts to the user or in the error console.
... 515 printer 526 tempo 530 courier 531 chat 532 netnews 540 uucp 556 remotefs 563 nntp+ssl 587 submission 601 syslog 636 ldap+ssl 993 imap+ssl 995 pop3+ssl 2049 nfs 4045 lockd 6000 x11 protocol specific exce
ptions each protocol handler can override the global blocked ports to allow it's own protocol to function.
Mozilla Style System
for css style sheets, they correspond to css's conce
pt of rules.
...when scri
pt dynamically changes the data represented by a css style rule, we create a new nsistylerule object; keeping the old one around briefly helps to determine what changed and how we need to handle that change.
...however, the second of these rules is the key to many of the performance and memory-use o
ptimizations in the style system.
...the style context has a getter for each struct, and nsiframe, which represents the conce
pt of a css box (or rendering object), also has getters that forward to the frame's style context.
GC and CC logs
this logs the contents of the javascri
pt heap to a file named gc-edges-nnnn.log.
... live gc logging can be enabled with the pref javascri
pt.o
ptions.mem.log.
... to set the environment variable, find the buildbrowserenv method in the python file for the test suite you are interested in, and add something like this code to the file: browserenv["moz_cc_log_directory"] = os.environ["moz_upload_dir"] browserenv["moz_cc_log_shutdown"] = "1" analyzing gc and cc logs there are numerous scri
pts that analyze gc and cc logs on github.
... to find out why an object is being ke
pt alive, the relevant scri
pts are find_roots.py and parse_cc_graph.py (which is called by find_roots.py).
Reporting a Performance Problem
when it runs out of space in its buffer, it discards old entries so you may want to increase the buffer size if you find you are unable to ca
pture the profile quickly enough after you notice a performance problem.
...note that increasing the buffer size uses more memory and can make ca
pturing a profile take longer.
... using the keyboard shortcuts is often more convenient than using the mouse to interact with the ui: ctrl+shift+1 - start/stop the profiler ctrl+shift+2 - take a profile and launch the viewer to view it ca
pturing and sharing a profile while the profiler is recording, reproduce the performance problem.
... press ctrl+shift+2 or click on the profiler toolbar icon in the top right and select 'ca
pture'.
Performance
in particular, they can help you understand why a particular object is being ke
pt alive.
... profiling with zoom zoom is a profiler for linux done by the people who made shark measuring performance using the perfmeasurement.jsm code module using perfmeasurement.jsm to measure performance data in your javascri
pt code.
... adding a new telemetry probe information on how to add a new measurement to the telemetry performance-reporting system profiling javascri
pt with shark (obsolete - replaced by instruments) how to use the mac os x shark profiler to profile javascri
pt code in firefox 3.5 or later.
... related topics javascri
pt, xpcom, developing mozilla, extensions, addons ...
Phishing: a short definition
phishing is an attem
pt to collect sensitive information, such as usernames, passwords, and financial details by disguising as a trustworthy entity online.
...earlier responses by affected banks, and payment providers, was to attem
pt educating users to not click links in emails, along with requesting to verify email legitimacy through checking for relevant personal information.
... public key cry
ptography many services will soon support w3c web authentication, a powerful technology to evade phishing, based on public key cry
ptography.
...after verifying username and password, the user is prom
pted to open the otp app and enter the corresponding 6-digit code, representing a hashed version of the secret key and a nonce - potentially time-based.
NSPR Types
this cha
pter describes the most common nspr types.
... other cha
pters describe more specialized types when describing the functions that use them.
...conscientious use of these macros ensures portability of code to all the platforms supported by nspr and still provides o
ptimal behavior on those systems that treat long long values directly.
... pr
ptrdiff pru
ptrdiff boolean types type and constants for boolean values.
PRFileDesc
a file descri
ptor used to represent any open file, such as a normal file, an end point of a pipe, or a socket (end point of network communication).
... descri
ption the fields of this structure are significant only if you are implementing a layer on top of nspr, such as ssl.
... otherwise, you use functions such as pr_open and pr_newtcpsocket to obtain a file descri
ptor, which you should treat as an opaque structure.
... for more details about the use of prfiledesc and related structures, see file descri
ptor types.
NSS 3.28 release notes
tls 1.3 does not distinguish between an em
pty context and no context.
... this api is equivalent in function to ssl_exportkeyingmaterial, but it can only succeed if 0-rtt was attem
pted (on the client) or acce
pted (on the server).
... notable changes in nss 3.28 nss can no longer be compiled with support for additional elli
ptic curves (the nss_ecc_more_than_suite_b o
ption, bug 1253912).
... nss will now detect the presence of tokens that support additional elli
ptic curves and enable those curves for use in tls (bug 1303648).
NSS 3.54 release notes
use arm cry
ptography extension for sha256, when available.
... bugs fixed in nss 3.54 bug 1528113 - use arm cry
ptography extension for sha256.
... bug 1642871 - enable ssl_sendsessionticket after resum
ption.
... bug 1644774 - ssl gtests to use clearservercache when resetting self-encry
pt keys.
NSS Sample Code sample6
* * to encry
pt, you need the id of the key to use.
... * to decry
pt, you need the ciphertext and the id of the key that was used * to encry
pt * * before running this example, create the nss database * certutil -n -d .
... * (enter "test" when prom
pted for password) */ #include "nss.h" #include "pk11pub.h" /* the key id can be any sequence of bytes.
... * in a real app, this function should obtain the password using secure means * such as prom
pting an operator, or retrieving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; /* initialize nss */ pk11_setpasswordfunc(passwdcb); /* the nss db must be initialized read-write since we'll be creating * keys in it.
Initialize NSS database - sample 2
(pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encry
pt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n"); output = fopen("/dev/tty", "w"); if (output == null) { pr_fprintf(pr_stderr, "error opening output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input, o...
... * it creates an nss configuration directory with em
pty databases * and initializes the databases.
... */ int main(int argc, char **argv) { plo
ptstate *o
ptstate; plo
ptstatus status; secstatus rv; secstatus rvshutdown; char *slotname = "internal"; pk11slotinfo *slot = null; char *dbdir = null; char *plainpass = null; char *pwfile = null; char * progname = strrchr(argv[0], '/'); progname = progname ?
... progname + 1 : argv[0]; /* parse command line arguments */ o
ptstate = pl_createo
ptstate(argc, argv, "d:p:q:f:g:"); while ((status = pl_getnexto
pt(o
ptstate)) == pl_o
pt_ok) { switch (o
ptstate->o
ption) { case 'd': dbdir = strdup(o
ptstate->value); break; case 'p': plainpass = strdup(o
ptstate->value); break; case 'f': pwfile = strdup(o
ptstate->value); break; default: usage(progname); break; } } pl_destroyo
ptstate(o
ptstate); if (!dbdir) usage(progname); pr_init(pr_user_thread, pr_priority_normal, 0); /* create the database */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprin...
nss tech note3
this message attem
pts to answer that question, and to document nss's approach to validating certificates for certain purposes.
... the list of known seccertusages is short: certusagesslclient ........... an ssl client authentication cert certusagesslserver ........... an ordinary ssl server cert certusagesslserverwithstepup.. an ssl server cert that allows export clients to use strong cry
pto.
...certusageemailsigner ......... used to verify s/mime email signatures certusageemailrecipient ...... used to encry
pt s/mime emails.
... otherwise it is not (exce
pt that trust flags may override this, see discussion of trust flags farther below).
nss tech note6
the following applies to nss 3.11 : the low-level freebl cry
ptographic code has been separated from softoken on all platforms.
...the softoken and freebl binaries won't match any nss binaries that may have been submitted to nist for validation, and thus may not be verified as being the actual fips 140 validated cry
ptographic module .
... so you have two o
ptions.
... for example, on 32-bit solaris sparc for nss 3.11, say shlibsign -v -i libsoftokn3.so shlibsign -v -i libfreebl_32int64_3.so shlibsign -v -i libfreebl_32fpu_3.soshlibsign -v -i libfreebl_32int_3.so (you need to set ld_library_path appropriately and specify the correct pathnames of the libraries.) o
ption 1 is simpler and highly preferred.
PKCS 7 functions
function name/documentation source code nss versions sec_pkcs7addcertificate mxr 3.3 and later sec_pkcs7addrecipient mxr 3.2 and later sec_pkcs7addsigningtime mxr 3.2 and later sec_pkcs7containscertsorcrls mxr 3.4 and later sec_pkcs7contentisencry
pted mxr 3.4 and later sec_pkcs7contentissigned mxr 3.4 and later sec_pkcs7contenttype mxr 3.2 and later sec_pkcs7copycontentinfo mxr 3.4 and later sec_pkcs7createcertsonly mxr 3.3 and later sec_pkcs7createdata mxr 3.2 and later sec_p...
...kcs7createencry
pteddata mxr 3.2 and later sec_pkcs7createenvelopeddata mxr 3.2 and later sec_pkcs7createsigneddata mxr 3.2 and later sec_pkcs7decodeitem mxr 3.2 and later sec_pkcs7decoderabort mxr 3.9 and later sec_pkcs7decoderfinish mxr 3.2 and later sec_pkcs7decoderstart mxr 3.2 and later sec_pkcs7decoderupdate mxr 3.2 and later sec_pkcs7decry
ptcontents mxr 3.2 and later sec_pkcs7destroycontentinfo mxr 3.2 and later sec_pkcs7encode mxr 3.3 and later sec_pkcs7encodeitem mxr 3.
... 3.9 and later sec_pkcs7encoderfinish mxr 3.2 and later sec_pkcs7encoderstart mxr 3.2 and later sec_pkcs7encoderupdate mxr 3.2 and later sec_pkcs7getcertificatelist mxr 3.2 and later sec_pkcs7getcontent mxr 3.2 and later sec_pkcs7getencry
ptionalgorithm mxr 3.2 and later sec_pkcs7getsignercommonname mxr 3.4 and later sec_pkcs7getsigneremailaddress mxr 3.4 and later sec_pkcs7getsigningtime mxr 3.4 and later sec_pkcs7includecertchain mxr 3.2 and later sec_pkcs7iscontentem
pty mxr 3.2 and...
... later sec_pkcs7setcontent mxr 3.4 and later sec_pkcs7verifydetachedsignature mxr 3.4 and later sec_pkcs7verifysignature mxr 3.2 and later secmime_decry
ptionallowed mxr 3.4 and later ...
FC_GetSessionInfo
syntax ck_rv fc_getsessioninfo( ck_session_handle hsession, ck_session_info_
ptr pinfo ); parameters hsession [in] the open session handle.
... descri
ption fc_getsessioninfo obtains information about a session.
...if the nss cry
ptographic module is in the error state, fc_getsessioninfo returns ckr_device_error.
... otherwise, it fills in the ck_session_info structure with the following information: state: the state of the session, i.e., no role is assumed, the user role is assumed, or the cry
pto officer role is assumed flags: bit flags that define the type of session ckf_rw_session (0x00000002): true if the session is read/write; false if the session is read-only.
FC_InitToken
syntax ck_rv fc_inittoken( ck_slot_id slotid, ck_char_
ptr ppin, ck_ulong ulpinlen, ck_char_
ptr plabel ); parameters fc_inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password plabel points to the label of the token, which must be padded with spaces to 32 bytes and not be null-terminated descri
ption fc_inittoken() initializes a brand new token or re-initializes a token that was initialized before.
...(user certs are the certificates that have their associated private keys in the key database.) a user must be able to call fc_inittoken() without logging into the token (to assume the nss user role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encry
pted private key database and start over.
... note: the so password should be the em
pty string, i.e., ulpinlen argument should be 0.
...you won't be able to decry
pt the data, such as mozilla's stored passwords, that were encry
pted using any of those keys.
FC_SetOperationState
name fc_setoperationstate - restore the cry
ptographic operation state of a session.
... syntax ck_rv fc_setoperationstate( ck_session_handle hsession, ck_byte_
ptr poperationstate, ck_ulong uloperationstatelen, ck_object_handle hencry
ptionkey, ck_object_handle hauthenticationkey ); parameters hsession [in] handle of the open session.
...hencry
ptionkey [in] handle of the encry
ption or decry
ption key to be used in in a stored session or zero if no key is needed.
... descri
ption fc_setoperationstate restores the cry
ptographic operations state of a session from an array of bytes obtained with fc_getoperationstate.
NSPR functions
pr_secondstointerval pr_millisecondstointerval nspr i/o layering nspr file descri
ptors can be layered, corresponding to the layers in the network stack.
... pr_getuniqueidentity pr_createiolayerstub pr_getdefaultiomethods pr_getidentitieslayer pr_getlayersidentity pr_pushiolayer pr_popiolayer wrapping a native file descri
ptor if your current tcp socket code uses the standard bsd socket api, a lighter-weight method than creating your own nspr i/o layer is to simply import a native file descri
ptor into nspr.
... users call nspr socket i/o functions to read from, write to, and shut down an ssl connection, and to close an nspr file descri
ptor.
... pr_read pr_write pr_recv pr_send pr_getsocketo
ption pr_setsocketo
ption pr_shutdown pr_close ...
FIPS mode of operation
fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encry
ption functions these functions support triple des and aes in ecb and cbc modes.
... fc_encry
ptinit fc_encry
pt fc_encry
ptupdate fc_encry
ptfinal decry
ption functions these functions support triple des and aes in ecb and cbc modes.
... fc_decry
ptinit fc_decry
pt fc_decry
ptupdate fc_decry
ptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512.
... fc_verifyinit fc_verify fc_verifyupdate fc_verifyfinal fc_verifyrecoverinit fc_verifyrecover dual-function cry
ptographic functions fc_digestencry
ptupdate fc_decry
ptdigestupdate fc_signencry
ptupdate fc_decry
ptverifyupdate key management functions fc_generatekey: dsa domain parameters (pqg) fc_generatekeypair: dsa, rsa, and ecdsa.
TLS Cipher Suite Discovery
in order to communicate securely, an tls client and tls server must agree on the cry
ptographic algorithms and keys that they will both use on the secured connection.
... they must agree on these items: key establishment algorithm (such as rsa, dh, or ecdh) peer authentication algorithm (such as rsa, dsa, ecdsa) bulk data encry
ption algorithm (such as rc4, des, aes) and key size digest algorithm for message authentication checking (sha1, sha256) there are numerous available choices for each of those categories, and the number of possible combinations of all those choices is large.
...libssl provides enough information about each of the supported cipher suites that the application can construct a display of that information from which the user can choose which cipher suites his application will attem
pt to use.
...nt16 length; pruint16 ciphersuite; /* cipher suite name */ const char * ciphersuitename; /* server authentication info */ const char * authalgorithmname; sslauthtype authalgorithm; /* key exchange algorithm info */ const char * keatypename; sslkeatype keatype; /* symmetric encry
ption info */ const char * symciphername; sslcipheralgorithm symcipher; pruint16 symkeybits; pruint16 symkeyspace; pruint16 effectivekeybits; /* mac info */ const char * macalgorithmname; sslmacalgorithm macalgorithm; pruint16 macbits; pruintn isfips : 1; ...
NSS Tools certutil-tasks
nss security tools: certutil tasks newsgroup: mozilla.dev.tech.cry
pto task list better error reporting.
... mistakes with command-line o
ptions just print a usage message.
... remove keys "stranded" without a certificate (exce
pt for the imminent (????) encry
ption key for password files).
... (bugfix) null password is given to new key3.db; should prom
pt user for an initial password.
NSS Tools dbck-tasks
nss security tools: dbck tasks newsgroup: mozilla.dev.tech.cry
pto task list in analyze mode, there should be an o
ption to create a file containing a graph of the certificate database without any information about the user's certificates (no common names, email addresses, etc.).
... this file could be mailed to a mail alias to assist in finding the source of database corru
ption.
... the dbck tool should be able to repair a curru
pted database.
... there should be command-line o
ptions and, perhaps, an interactive mode to allow determine which certificates to keep.
JS::ToUint64
this article covers features introduced in spidermonkey 17 convert any javascri
pt value to an unsigned 64bit integer.
... syntax bool js::touint64(jscontext *cx, js::handlevalue v, uint64_t *out); name type descri
ption cx jscontext * the context in which to perform the conversion.
... descri
ption js::toint64 converts a javascri
pt value to an unsigned 64bit integer.
...on error or exce
ption, it returns false, and the value left in *out is undefined.
JS::Value
js::value is the type of javascri
pt values in the jsapi.
... a c++ variable of type js::value represents a value in javascri
pt: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined.
...the number mutators attem
pt to use int32_t representation for compatible input values, returning true when int32 could be used and false when double representation was required.
...the only exce
ption is that only a single nan value can be represented.
JSHasInstanceOp
syntax typedef bool (* jshasinstanceop)(jscontext *cx, js::handleobject obj, js::mutablehandlevalue vp, bool *bp); name type descri
ption cx jscontext * the js context in which the type check is occurring.
... descri
ption jshasinstanceop is called to check whether v is an instance of obj.
... return false on error or exce
ption, true on success with true in *bp if v is an instance of obj, false in *bp otherwise.
... jsclass hooks jsclass offers the following hook: the jsclass.hasinstance callback implements js_hasinstance and the javascri
pt instanceof keyword.
JSNewResolveOp
syntax typedef bool (* jsnewresolveop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandleobject objp); name type descri
ption cx jscontext * pointer to the js context in which the property access is taking place.
... descri
ption like jsresolveop, but flags provide contextual information about the property access.
... jsresolve_classname obsolete since javascri
pt 1.8.8 class name used when constructing.
... jsresolve_with obsolete since javascri
pt 1.8.8 the lookup is occurring for a name evaluated inside a with statement.
JSObjectOps.dropProperty
obsolete since javascri
pt 1.8.5this feature is obsolete.
... syntax typedef void (*jspropertyrefop)(jscontext *cx, jsobject *obj, jsproperty *prop); name type descri
ption cx jscontext * a context that was the cx argument to an earlier call to jsobjectops.lookupproperty that found a property.
... descri
ption the following contract governs jsobjectops callers and implementations: whenever jsobjectops.lookupproperty returns a jsproperty pointer, the property is locked.
... a single, built-in jsobjectops implementation is used for most spidermonkey objects that are exposed to scri
pts.
JSObjectOps.getProperty
obsolete since javascri
pt 1.8.5this feature is obsolete.
... syntax typedef jsbool (*jspropertyidop)( jscontext *cx, jsobject *obj, jsid id, jsval *vp); name type descri
ption cx jscontext * pointer to the js context in which the property access is happening.
...see the descri
ption section below.
... descri
ption get, set, or delete obj[id], returning js_false on error or exce
ption, js_true on success.
JSObjectOps.getRequiredSlot
obsolete since javascri
pt 1.8.5this feature is obsolete.
... syntax typedef jsval (*jsgetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot); typedef jsbool (*jssetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsval v); name type descri
ption cx jscontext * the js context in which we access the slot.
... descri
ption get and set a required slot, one that should already have been allocated.
... note: the slot parameter is a zero-based index into obj slots, unlike the index parameter to the js_getreservedslot and js_setreservedslot api entry points, which is a zero-based index into the jsclass_reserved_slots(clasp) reserved slots that come after the initial well-known slots: proto, parent, class, and o
ptionally, the private data slot.
JSObjectOps.lookupProperty
obsolete since javascri
pt 1.8.5this feature is obsolete.
... the jsobjectops.lookupproperty callback is called for every property access (exce
pt when a higher-level callback, such as jsobjectops.getproperty, is overloaded in a way that does not call lookupproperty).
... syntax typedef jsbool (*jslookuppropop)(jscontext *cx, jsobject *obj, jsid id, jsobject **objp, jsproperty **propp); name type descri
ption cx jscontext * pointer to the js context in which the property lookup is happening.
... descri
ption look for id in obj and its prototype chain, returning js_false on error or exce
ption, js_true on success.
JSTraceOp
syntax typedef void (* jstraceop)(jstracer *trc, jsobject *obj); name type descri
ption trc jstracer * the tracer visiting obj.
... descri
ption jstraceop is the function type for trace operation of the class called to enumerate all traceable things reachable from obj's private data structure.
...the only exce
ption for this rule is the case when the embedding needs a tight integration with gc.
... in that case the embedding can check if the traversal is a part of the marking phase through calling js_isgcmarkingtracer and apply a special code like em
ptying caches or marking its native structures.
JSVersion
the values of the jsversion enumerated type stand for particular versions of the javascri
pt run-time.
... descri
ption the jsversion enumerated type includes the following values.
... enumeration value meaning name jsversion_1_0obsolete since jsapi 24 100 javascri
pt 1.0 "1.0" jsversion_1_1obsolete since jsapi 24 110 javascri
pt 1.1 "1.1" jsversion_1_2obsolete since jsapi 24 120 javascri
pt 1.2 "1.2" jsversion_1_3obsolete since jsapi 24 130 javascri
pt 1.3 "1.3" jsversion_1_4obsolete since jsapi 24 140 javascri
pt 1.4 "1.4" jsversion_ecma_3 148 ecma 262 edition 3 "ecmav3" jsversion_1_5obsolete since jsapi 24 150 javascri
pt 1.5 "1.5" jsversion_1_6 160 javascri
pt 1.6 "1.6" jsversion_1_7 170 javascri
pt 1.7 "1.
...7" jsversion_1_8 180 javascri
pt 1.8 "1.8" jsversion_ecma_5 185 ecma 262 edition 5 "ecmav5" jsversion_default 0 latest javascri
pt version, but omitting web-incompatible extensions "default" jsversion_unknown -1 unknown javascri
pt version null jsversion_latest jsversion_ecma_5 latest javascri
pt version null see also mxr id search for jsversion js_getversion js_setversion js_stringtoversion js_versiontostring bug 824312 ...
JS_AddArgumentFormatter
syntax jsbool js_addargumentformatter(jscontext *cx, const char *format, jsargumentformatter formatter); void js_removeargumentformatter(jscontext *cx, const char *format); name type descri
ption cx jscontext * the context in which to install the formatter.
... descri
ption js_addargumentformatter establishes formatter as the conversion function for format strings beginning with format in the context cx.
...callback syntax jsbool (*jsargumentformatter)(jscontext *cx, const char *format, jsbool fromjs, jsval **vpp, va_list *app); name type descri
ption cx jscontext * the context in which the conversion is being performed.
... callback descri
ption the conversion function should return true on success, and return false after reporting an error or detecting an already-reported error.
JS_AlreadyHasOwnProperty
bj, const char16_t *name, size_t namelen, bool *foundp); boo js_alreadyhasownpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 boo js_alreadyhasownelement(jscontext *cx, js::handleobject obj, uint32_t index, bool *foundp); name type descri
ption cx jscontext * pointer to a js context.
... descri
ption these functions attem
pt to determine whether a property already exists on a specific jsobject without modifying the object.
...they are meant to be a transparent o
ptimization; this is the only api that breaks the abstraction.) for non-native objects, this falls back on a complete search.
...if the search fails with an error or exce
ption, this returns false.
JS_BufferIsCompilableUnit
syntax bool js_bufferiscompilableunit(jscontext *cx, js::handle<jsobject*> obj, const char *utf8, size_t length); name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
... utf8 const char * string containing the scri
pt to compile.
... descri
ption given a buffer, return false if the buffer might become a valid javascri
pt statement with the addition of more lines.
...see also mxr id search for js_bufferiscompilableunit js::evaluate js::compile js::compileoffthread js::compilefunction js_decompilescri
pt ...
JS_CompileFunction
creates a javascri
pt function from a text string.
... const char *name, unsigned int nargs, const char **argnames, const char *body, size_t length, const char *filename, unsigned int lineno); jsfunction * js_compileucfunction(jscontext *cx, jsobject *obj, const char *name, unsigned int nargs, const char **argnames, const jschar *body, size_t length, const char *filename, unsigned int lineno); name type descri
ption cx jscontext * the context in which to compile the function.
... descri
ption js_compilefunction compiles a function from a text string, bytes, and o
ptionally associates it with a js object, obj.
...on error or exce
ption, they return null.
JS_CompileUCFunctionForPrincipalsVersion
this article covers features introduced in spidermonkey 1.8.5 please provide a descri
ption for this function.
... syntax jsfunction * js_compileucfunctionforprincipalsversion(jscontext *cx, jsobject *obj, jsprincipals *principals, const char *name, unsigned int nargs, const char **argnames, const jschar *chars, size_t length, const char *filename, unsigned int lineno, jsversion version); name type descri
ption cx jscontext * the context.
... obj jsobject * principals jsprincipals * name const char * nargs unsigned int argnames const char ** chars const jschar * length size_t filename const char * lineno unsigned int version jsversion descri
ption please provide a descri
ption.
... see also please provide a descri
ption.
JS_ConstructObject
syntax jsobject * js_constructobject(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent); jsobject * js_constructobjectwitharguments(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent, unsigned int argc, jsval *argv); name type descri
ption cx jscontext * the context in which to create the new object.
...if this is null, an ordinary javascri
pt object is created.
... descri
ption js_constructobject creates a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to initialize the new object.
... neither of these functions is quite like the javascri
pt new keyword.
JS_DefineElement
syntax /* added in spidermonkey 38 (jsapi 32) */ bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlevalue value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlestring value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineelement(js...
...context *cx, js::handleobject obj, uint32_t index, int32_t value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, uint32_t value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, double value, unsigned attrs, jsnative getter = null
ptr, jsnative setter = null
ptr); /* obsolete since jsapi 32 */ js_defineelement(jscontext *cx, jsobject *obj, uint32_t index, jsval value, jspropertyop getter, jsstrictpropertyop setter, unsigned attrs)...
...; name type descri
ption cx jscontext * the context in which to create the new property.
...obsolete since jsapi 32 descri
ption js_defineelement defines a numeric property for a specified object, obj.
JS_DeleteElement
syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index, js::objectopresult &result); name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
... descri
ption js_deleteelement removes a specified element or numeric property, index, from an object, obj.
... for javascri
pt 1.2 and earlier, if failure occurs because you attem
pt to delete a permanent or read-only element, js_deleteelement reports the error before returning false.
... for javascri
pt 1.3 and later, the attem
pt is silently ignored.
JS_DeleteElement2
renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t index, bool *succeeded); name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
... descri
ption js_deleteelement2 removes a specified element or numeric property, index, from an object, obj.
... for javascri
pt 1.2 and earlier, if deletion fails because the property is permanent, js_deleteelement2 reports the error and returns false.
... for javascri
pt 1.3, the attem
pt is silently ignored.
JS_DumpNamedRoots
syntax void js_dumpnamedroots(jsruntime *rt, void (*dump)(const char *name, void *rp, void *data), void *data); name type descri
ption rt jsruntime * pointer to a jsruntime from which to dump named roots.
...the javascri
pt engine does not read from or write to this pointer at all.
... descri
ption each call to js_addnamedroot creates a record in a table of named roots maintained by the garbage collector.
...when js_dumpnamedroots calls it, it passes three arguments: argument type descri
ption name const char * the name of the named root.
JS_FS
name type descri
ption name const char * the javascri
pt name for the function.
... (or index, if jsprop_index is present in flags) symbol a member name of js::symbolcode the javascri
pt symbol for the function.
... selfhostedname const char * the function's name in self-hosted javascri
pt code.
... descri
ption use these macros to define an array of jsfunctionspecs to pass to js_definefunctions or js_initclass.
JS_GetCompartmentPrivate
this article covers features introduced in spidermonkey 1.8.5 please provide a descri
ption for this function.
... syntax void js_setcompartmentprivate(jscompartment *compartment, void *data); void * js_getcompartmentprivate(jscompartment *compartment); name type descri
ption compartment jscompartment * any compartment data void * (in js_setcompartmentprivate) pointer to application-defined data to be associated with the compartment.
... descri
ption each jscompartment has a field of type void * which the application may use for any purpose.
...the javascri
pt engine itself never uses it.
JS_GetFunctionArity
syntax uint16_t js_getfunctionarity(jsfunction *fun); name type descri
ption fun jsfunction * a javascri
pt function.
... descri
ption js_getfunctionarity returns the number of formal parameters of a function, fun.
...otherwise fun is implemented in javascri
pt, and the result is the number of identifiers in its formal parameter list (see ecma 262-3 §13).
... note that it is not an error per se to call a javascri
pt function with more or fewer actual arguments than its arity.
JS_GetNaNValue
syntax // added in spidermonkey 42 js::value js_getnanvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getnanvalue(jscontext *cx); name type descri
ption cx jscontext * a context.
... descri
ption js_getnanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan).
... nan is typically used in javascri
pt as the return value of a numeric operation when an argument is invalid or conversion fails.
...while the ieee standard defines many nan bit-patterns, they are indistinguishable in javascri
pt, so in effect there's only one nan.
JS_GetPrototype
syntax bool js_getprototype(jscontext *cx, js::handleobject obj, js::mutablehandleobject protop); name type descri
ption cx jscontext * pointer to a js context from which to derive runtime information.
... descri
ption js_getprototype retrieves the prototype of a specified object, obj.
...this is the equivalent of object.getprototypeof(obj) from javascri
pt.
... if js_getprototype returns false, that signals an exce
ption, which should be handled as usual.
JS_GetStringLength
return the length, in 16-bit code units, of a javascri
pt string.
... syntax size_t js_getstringlength(jsstring *str); name type descri
ption str jsstring * the string to examine.
... descri
ption js_getstringlength reports the length, in 16-bit code units, of the string str.
...see also mxr id search for js_getstringlength js_comparestrings js_convertvalue js_getem
ptystringvalue js_getstringbytes js_internstring js_newstringcopyn js_newstringcopyz js_valuetostring ...
JS_HasElement
determine whether a javascri
pt array has an element in the specified index.
... syntax bool js_haselement(jscontext *cx, js::handleobject obj, uint32_t index, bool *foundp); name type descri
ption cx jscontext * the context in which to perform the property lookup.
... descri
ption js_haselement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered index.
...if the search fails with an error or exce
ption, js_haselement returns false, and the value left in *foundp is undefined.
JS_HasOwnProperty
this article covers features introduced in spidermonkey 45 determine whether a javascri
pt object has a specified own property.
... syntax bool js_hasownproperty(jscontext* cx, handleobject obj, const char* name, bool* foundp) bool js_hasownpropertybyid(jscontext* cx, handleobject obj, handleid id, bool* foundp) name type descri
ption cx jscontext * a context.
... descri
ption js_hasownproperty searches an object, obj, for an own property with the specified name.
... it behaves like the javascri
pt expression object.hasownproperty(obj, name).
JS_HasProperty
determine whether a javascri
pt object has a specified property.
...ntext *cx, js::handleobject obj, const char *name, bool *foundp); bool js_hasucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, bool *vp); bool js_haspropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 name type descri
ption cx jscontext * a context.
... descri
ption js_hasproperty searches an object, obj, and its prototype chain, for a property with the specified name.
... it behaves like the javascri
pt expression name in obj.
JS_IsRunning
indicates whether or not a scri
pt or function is currently executing in a given context.
... syntax bool js_isrunning(jscontext *cx); name type descri
ption cx jscontext * the context to query.
... descri
ption js_isrunning determines if a scri
pt or function is currently executing in a specified jscontext, cx.
... if a scri
pt is executing, js_isrunning returns true.
JS_SetVersionForCompartment
this article covers features introduced in spidermonkey 31 configure a jscompartment to use a specific version of the javascri
pt language.
... syntax void js_setversionforcompartment(jscompartment *compartment, jsversion version); name type descri
ption compartment jscompartment * pointer to a js compartment.
... version jsversion version of javascri
pt to set compartment to.
... descri
ption js_setversionforcompartment attem
pts to set the version of javascri
pt to version for a specified compartment, compartment.
JS_StrictlyEqual
this article covers features introduced in spidermonkey 1.8.1 determine whether two javascri
pt values are equal in the sense of the === operator.
... syntax // added in spidermonkey 45 bool js_strictlyequal(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *equal); // obsolete since jsapi 39 bool js_strictlyequal(jscontext *cx, jsval v1, jsval v2, bool *equal); name type descri
ption cx jscontext * the context in which to perform the conversion.
... descri
ption js_strictlyequal determines if v1 is strictly equal to v2 under the javascri
pt === operator, as specified in ecma 262-3 §11.9.6.
... if the comparison attem
pt was successful, the method returns true and stores the result in *equal; otherwise it returns false.
JS_ValueToBoolean
replaced by js::toboolean convert any javascri
pt value to a boolean value.
... syntax jsbool js_valuetoboolean(jscontext *cx, jsval v, jsbool *bp); name type descri
ption cx jscontext * the context in which to perform the conversion.
... descri
ption js_valuetoboolean converts a specified javascri
pt value, v, to a boolean value.
...on error or exce
ption, it returns js_false, and the value left in *bp is undefined.
JS_ValueToFunction
syntax jsfunction * js_valuetofunction(jscontext *cx, js::handlevalue v); jsfunction * js_valuetoconstructor(jscontext *cx, js::handlevalue v); name type descri
ption cx jscontext * the context in which to perform the conversion.
... descri
ption js_valuetofunction converts a specified javascri
pt value, v, to a function.
...the javascri
pt engine attem
pts to convert it to a function.
...if conversion fails with an error or exce
ption, js_valuetofunction returns null.
JS_ValueToInt32
convert a javascri
pt value to a 32-bit signed integer.
... syntax jsbool js_valuetoint32(jscontext *cx, jsval v, int32 *ip); name type descri
ption cx jscontext * the context in which to perform the conversion.
... descri
ption js_valuetoint32 converts a specified js value, v, to a 32-bit signed integer (-2147483648 to 2147483647).
...on error or exce
ption, it returns js_false, and the value left in *ip is undefined.
JS_ValueToObject
converts any javascri
pt value to an object.
... syntax bool js_valuetoobject(jscontext *cx, js::handlevalue v, js::mutablehandleobject objp); name type descri
ption cx jscontext * the context in which to convert the value.
... descri
ption js_valuetoobject converts a specified javascri
pt value, v, to an object.
...if v is a native javascri
pt object, this calls the object's valueof method, if any.
jsid
a jsid is a javascri
pt identifier for a property or method of an object.
... also, there is an additional jsid value, jsid_void, which does not occur in js scri
pts but may be used to indicate the absence of a valid jsid.
... a void jsid is not a valid id and only arises as an exce
ptional api return value, such as in js_nextproperty.
... embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid exce
pt when explicitly noted in the api contract.
SpiderMonkey 52
the mozilla javascri
pt team is pleased to announce the release of spidermonkey 52.
... spidermonkey 52 is the javascri
pt engine that shipped in firefox 52.
...or file bugs at bugzilla.mozilla.org under product: core, component: javascri
pt engine.
... platform support migrating to spidermonkey 52 new javascri
pt language features new c++ apis deleted apis api changes known issues ...
The Publicity Stream API
accessing the api the publicity api can be enabled by including a javascri
pt library.
...[is this still doable?] the javascri
pt library should be included from: https://myapps.mozillalabs.com/jsapi/publicity.js all apis related to open web applications are accessed under the navigator.apps object.
...missing required properties) finally, the publicizeactivity() function will throw an exce
ption if required arguments are missing, or if unsupported arguments are present.
...if null or an em
pty list is passed, events for all apps are returned.
Creating XPCOM components
for example, the introduction includes a discussion of components and what they are, and the first cha
pter - in which you compile the basic code and register it with mozilla - prom
pts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general.
... xpcom services xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from scri
pt 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 re...
...aration macros weblock2.cpp string classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock getting called at startup registering for notifications getting access to the category manager providing access to weblock creating the weblock programming interface defining the weblock interface in xpidl the xpidl syntax scri
ptable 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 modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processi...
...bjects building the weblock ui user interface package list client code overview xul the xul document the locking ui site adding ui weblock.xul overlaying new user interface into mozilla weblockoverlay.xul other resources weblock.css image resources packaging weblock component installation overview archiving resources the weblock installation scri
pt the weblock trigger scri
pt distributing your component appendix a - setting up the gecko sdk downloading and setting the sdk building a microsoft visual cpp project creating a new project adding the gecko sdk to the project settings building a windows project a makefile for unix appendix b - resources weblock resources gecko resources xpcom resources general developmen...
XPCOM hashtable guide
data type hashtable class none (for a hash set) nsthashtable simple types (numbers, booleans, etc) nsdatahashtable structs or classes (nsstring, custom defined structs or classes that are not reference-counted) nsclasshashtable reference-counted concrete classes nsref
ptrhashtable interface pointers nsinterfacehashtable each of these classes is a template with two parameters.
... key type hashkey class strings nsstringhashkey/nscstringhashkey integers nsuint32hashkey/nsuint64hashkey pointers ns
ptrhashkey<t> owned interface pointers nsisupportshashkey reference-counted concrete classes nsref
ptrhashkey there are a number of more esoteric hashkey classes in nshashkeys.h, and you can always roll your own if none of these fit your needs (make sure you're not duplicating an existing hashkey class though!) once you've determined what hashtable and hashkey classes you need, you can put it all together.
... a few examples: a hashtable that maps utf-8 origin names to a dom window - nsinterfacehashtable<nscstringhashkey, nsidomwindow> a hashtable that maps 32 bit integers to floats - nsdatahashtable<nsuint32hashkey, float> a hashtable that maps nsisupports pointers to reference counted cacheentrys - nsref
ptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<ns
ptrhashkey<jscontext>, contextinfo> a hashset of strings - nsthashtable<nsstringhashkey> hashtable api the hashtable classes all expose the same basic api.
... the hashtables that hold references to pointers (nsref
ptrhashtable and nsinterfacehashtable) also have getweak methods that return non-addrefed pointers.
XPCOM guide
avoiding leaks in javascri
pt xpcom componentsprogrammers writing and reviewing javascri
pt code in mozilla should understand how code using xpcom in javascri
pt can leak so that they can avoid leaks.
... this document attem
pts to help them do so, first by explaining the underlying conce
pts, and second by describing a number of common javascri
pt patterns that cause leaks.creating xpcom componentsthis guide is about gecko, and about creating xpcom components for gecko-based applications.how to build an xpcom component in javascri
ptif you are looking for add-on sdk solution for xpcom javascri
pt components then check out platform/xpcom module first.inheriting from implementation classesgiven that idl interfaces map to abstract classes in c++, a common problem when dealing with idl is when you have an idl inheritance hierarchy, and a corresponding c++ implementation hierarchy, you run into multiple inheritance.
...the problem would not exist with java's interfaces).making cross-thread calls using runnablesin the mozilla platform, most activities such as layout, dom operations, content javascri
pt, and chrome javascri
pt run on the main thread.
... approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.receiving startup notificationssometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.xpcom array guidemozilla has many array classes because each array is o
ptimized for a particular usage pattern.
Interfacing with the XPCOM cycle collector
this is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a descri
ption of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
... if the collector finds a group of objects that all refer back to one another, and establishes that the objects' reference counts are all accounted for by internal pointers within the group, it considers that group cyclical garbage, which it then attem
pts to free.
...in general, assuming you are modifying class nsfoo with two nscom
ptr edges mbar and mbaz, the process can be distilled to a few simple modifications: include the header nscyclecollectionparticipant.h in both nsfoo.h and nsfoo.cpp.
... //if your class is a wrapper cache: //ns_impl_cycle_collection_unlink_preserved_wrapper tmp->msomeobj = null
ptr; ns_impl_cycle_collection_unlink_end in the destructor, you should call mozilla::dropjsobjects(this); in your traverse method you need to list members involved in the cycle collector, i-e no js objects: ns_impl_cycle_collection_traverse_begin(nsfoo) ...
Components.utils.createObjectIn
components.utils.createobjectin creates a new javascri
pt object in the scope of the specified object's compartment.
... this function is made available as a global in sandboxes which have the wantexporthelpers o
ption set in the sandbox() constructor.
... syntax var newobject = components.utils.createobjectin(obj, o
ptions); parameters obj an object indicating the compartment in which the new object should be created; the new object will be created in the scope of this object's compartment.
... o
ptions an object containing a single o
ption defineas, which determines the name of the object in the target compartment.
Components.utils.evalInSandbox
the evalinsandbox() function enables you to evaluate javascri
pt code inside a sandbox you've previously created using the components.utils.sandbox constructor.
...esult = components.utils.evalinsandbox("x = y + 2; double(x) + 3", mysandbox); console.log(result); // 17 console.log(mysandbox.x); // 7 operations on objects you insert into this sandbox global scope do not carry privileges into the sandbox: mysandbox.foo = components; // this will give a "permission denied" error components.utils.evalinsandbox("foo.classes", mysandbox); o
ptional arguments you can o
ptionally specify the js version, filename, and line number of the code being evaluated.
... for instance: var x = components.utils.evalinsandbox( "let x = 1;", sandbox, "1.8", // "latest" is recognized as a special case "http://foo.com/mycode.js", 25 ); the above will execute code using javascri
pt 1.8.
... any exce
ptions raised by the evaluated code will show as originating from the above url.
Components.utils.schedulePreciseGC
this method lets scri
pts schedule a garbage collection cycle.
... the garbage collection cycle will occur sometime in the future, when no javascri
pt code is executing.
... this is useful particularly when testing for memory leaks, because normal garbage collection is conservative when javascri
pt code is running to ensure that in-use memory isn't inadvertently collected.
...ted in once the scheduled garbage collection has been completed: components.utils.scheduleprecisegc( function() { // this code is executed when the garbage collection has completed } ); since the garbage collection doesn't occur until some time in the future (unlike, for example, components.utils.forcegc(), which causes garbage collection immediately but isn't able to collect all javascri
pt-related memory), the callback lets you know when that's been finished.
Components.utils.unload
components.utils.unload was introduced in firefox 7 and is used to unload javascri
pt code modules.
...if the javascri
pt code module has not yet been imported then this method will do nothing.
...syntax components.utils.unload( url ); parameters url the "resource://" url of the scri
pt to unload.
... this must be the same url that was used to load the scri
pt.
Architecture basics
xpconnect is what lets javascri
pt talk with mozilla guts, the xpcom system.
... you can imagine it like a bridge between javascri
pt code, and mozilla guts.
... xpcshell is a command line interface to mozilla javascri
pt.
... it's an interactive interpreter -- it gives you a shell that talks straight to mozilla, via javascri
pt's xpconnect bridge into it.
XPConnect
xpconnect is a bridge between javascri
pt and xpcom.
... with xpconnect, you can use xpcom components from javascri
pt code, and interact with javascri
pt objects from within xpcom components.
... documentation architecture basics xpconnect, javascri
pt, xpcom, xul...
...ers what sorts of wrappers xpconnect generates and uses xpconnect security membranes tools xpcshell join the xpcom community choose your preferred method for joining the discussion: mailing list newsgroup rss feed irc: #developers (learn more)tools: javascri
pt component wizard, visual c++ component wizard, visual c++ component wizard for visual studio 2010 ...
NS_ConvertASCIItoUTF16
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...substringtuple&) - source parameters nssubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
NS ConvertASCIItoUTF16 external
class declaration method overview constructors get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty 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 ...
...get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar ado
pt void ado
pt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length,...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
NS_ConvertUTF16toUTF8
nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...ubstringtuple&) - source parameters nscsubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint...
...parameters char** data getmutabledata pruint32 getmutabledata(char**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
NS ConvertUTF16toUTF8 external
class declaration method overview constructors get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
NS_ConvertUTF8toUTF16
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...substringtuple&) - source parameters nssubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
NS ConvertUTF8toUTF16 external
class declaration method overview constructors get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty 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 ...
...get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar ado
pt void ado
pt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length,...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
NS_LossyConvertUTF16toASCII
nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...ubstringtuple&) - source parameters nscsubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint...
...parameters char** data getmutabledata pruint32 getmutabledata(char**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
NS LossyConvertUTF16toASCII external
class declaration method overview constructors get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
PromiseFlatCString (External)
class declaration method overview get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
PromiseFlatString (External)
class declaration method overview get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty 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 ...
...get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar ado
pt void ado
pt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length,...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
nsACString (External)
"ns_lossyconvertutf16toascii_external"> <area alt="" coords="803,294,925,342" href="http://developer.mozilla.org/en/nsliteralcstring_(external)" shape="rect" title="nsliteralcstring_(external)"></map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== ...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
... parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata operator= nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters ...
nsAString (External)
developer.mozilla.org/en/ns_convertutf8toutf16_external" shape="rect" title="ns_convertutf8toutf16_external"> <area alt="" coords="757,294,869,342" href="http://developer.mozilla.org/en/nsliteralstring_(external)" shape="rect" title="nsliteralstring_(external)"> </map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger data me...
...source endreading prunichar* endreading() const - source charat prunichar charat(pruint32) const - source parameters 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 o
ptionally set the length of a string all in one operation.
...parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar a...
...ssignliteral void assignliteral(const char*) - source parameters char* astr operator= nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable append void append(prunichar) - source parameters pru...
nsAutoString
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...substringtuple&) - source parameters nssubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsAutoString (External)
class declaration method overview get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty 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 ...
...get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar ado
pt void ado
pt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length,...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
nsCAutoString (External)
class declaration method overview get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
nsCString
nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...ubstringtuple&) - source parameters nscsubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint...
...parameters char** data getmutabledata pruint32 getmutabledata(char**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsCStringContainer (External)
class declaration method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= opera...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
...nd pruint32 newsize char beginwriting(pruint32) - source parameters pruint32 alen endwriting char endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring astring void assign(const char*, pruint32)...
...urce parameters char achar assignliteral void assignliteral(const char*) - source parameters char adata operator= nsacstring operator=(const nsacstring&) - source parameters nsacstring astring nsacstring operator=(const char*) - source parameters char a
ptr nsacstring operator=(char) - source parameters char achar replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char data pruint32 length void replace(pruint32, pruint32, char) - source parameters pr...
nsCString external
class declaration method overview constructors get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
nsDependentCString external
class declaration method overview constructors rebind get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
nsDependentCSubstring
names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isem
pty 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= ado
pt replace repla...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...- source operator= nsacstring_internal& operator=(char) - source parameters char c nsacstring_internal& operator=(const char*) - source parameters char* data nsacstring_internal& operator=(const nsacstring_internal&) - source parameters nsacstring_internal& str nsacstring_internal& operator=(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple ado
pt void ado
pt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint...
...parameters char** data getmutabledata pruint32 getmutabledata(char**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsDependentCSubstring external
class declaration method overview constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfi...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
... parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata operator= nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters ...
nsDependentString
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...substringtuple&) - source parameters nssubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsDependentString external
class declaration dependent strings method overview constructors rebind get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowe...
...get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar ado
pt void ado
pt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length,...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
nsDependentSubstring
names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isem
pty 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= ado
pt replace repla...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
... operator= nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsDependentSubstring external
class declaration substrings method overview constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...newsize prunichar beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring astring void assign(const prunichar*, pruint...
... parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char astr operator= nsastring operator=(const nsastring&) - source parameters nsastring astring nsastring operator=(const prunichar*) - source parameters prunichar a
ptr nsastring operator=(prunichar) - source parameters prunichar achar replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar data pruint32 length void replace(pruint32, pruint32, prunichar) - source ...
nsLiteralCString (External)
class declaration method overview rebind get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
nsLiteralString (External)
class declaration method overview rebind get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
...r* get() const - source operator= nscstring_external& operator=(const nscstring_external&) - source parameters nscstring_external& astring nsacstring& operator=(const nsacstring&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* a
ptr nsacstring& operator=(char) - source parameters char achar ado
pt void ado
pt(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 stri...
...(pruint32) const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and o
ptionally set the length of a string all in one operation.
... pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsacstring&) - source parameters nsacstring& astring void assign(const char*, pruint32...
nsPromiseFlatCString
nset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... char*& beginwriting(char*&) - source parameters char*& iter endwriting char* endwriting() - source nswritingiterator<char>& endwriting(nswritingiterator<char>&) - source parameters nswritingiterator<char>& iter char*& endwriting(char*&) - source parameters char*& iter data char* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat char charat(pruint32) const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruin...
...ubstringtuple&) - source parameters nscsubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint...
...parameters char** data getmutabledata pruint32 getmutabledata(char**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsPromiseFlatString
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...substringtuple&) - source parameters nssubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsString
findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isem
pty 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 ado
pt replace replaceascii ap...
... endwriting prunichar* endwriting() - source nswritingiterator<short unsigned int>& endwriting(nswritingiterator<short unsigned int>&) - source parameters nswritingiterator<short unsigned int>& iter prunichar*& endwriting(prunichar*&) - source parameters prunichar*& iter data prunichar* data() const - source accessors length pruint32 length() const - source isem
pty prbool isem
pty() const - source isvoid prbool isvoid() const - source isterminated prbool isterminated() const - source charat prunichar charat(pruint32) const - source parameters pruint32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source ...
...substringtuple&) - source parameters nssubstringtuple& <anonymous> assignascii void assignascii(const char*, pruint32) - source parameters char* data pruint32 length void assignascii(const char*) - source parameters char* data assignliteral(const char void assignliteral(const char (&)[n]) - source assignliteral(char void assignliteral(char (&)[n]) - source ado
pt void ado
pt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length ...
...parameters prunichar** data getmutabledata pruint32 getmutabledata(prunichar**, pruint32) - source get a pointer to the string's internal buffer, o
ptionally resizing the buffer first.
nsStringContainer (External)
class declaration method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
...rameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr operator= nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source ...
nsString external
class declaration basic strings method overview constructors get operator= ado
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isem
pty 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 ...
...get() const - source operator= nsstring_external& operator=(const nsstring_external&) - source parameters nsstring_external& astring nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* a
ptr nsastring& operator=(prunichar) - source parameters prunichar achar ado
pt void ado
pt(const prunichar*, pruint32) - source parameters prunichar* adata pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length,...
...ource parameters 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 o
ptionally set the length of a string all in one operation.
...wsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isem
pty prbool isem
pty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruin...
IAccessibleImage
other-licenses/ia2/accessibleimage.idlnot scri
ptable this interface represents images and icons.
...some examples are: the accessible name and descri
ption() are not enough to fully describe the image, for example when the accessible descri
ption() is used to define the behavior of an actionable image and the image itself conveys semantically significant information.
... method overview [propget] hresult descri
ption([out] bstr descri
ption ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods descri
ption() returns the localized descri
ption of the image.
... [propget] hresult descri
ption( [out] bstr descri
ption ); parameters descri
ption the localized descri
ption of the image.
imgICache
image/public/imgicache.idlscri
ptable please add a summary to this article.
...if false, evict everything exce
pt chrome images.
... findentryproperties() find properties used to get properties such as 'type' and 'content-disposition' 'type' is a nsisupportscstring containing the images' mime type such as 'image/png' 'content-disposition' will be a nsisupportscstring containing the header if you call this before any data has been loaded from a uri, it will succeed, but come back em
pty.
... exce
ptions thrown ns_ok if a uri was removed from the cache.
mozIStorageVacuumParticipant
/storage/public/mozistoragevacuumparticipant.idlscri
ptable components can implement this interface to provide information to allow a database to be periodically vacuumed by the storage service.
...method overview boolean onbeginvacuum(); void onendvacuum(in boolean asucceeded); attributes attribute type descri
ption databaseconnection mozistorageconnection a connection to the database file to be vacuumed.
...if the attem
pt to restore the journal node fails, it will remain truncate.
...you may wish to return false, for example, if you're in the middle of an operation that you don't want to (or can't) interru
pt.
nsIAbCard
properties aren't stored anymore on the card, exce
pt for a handful of them.
...ports method overview astring getcardvalue(in string name) void setcardvalue(in string attrname, in astring value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[o
ptional] in nsistringbundle abundle) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type descri
ption firstname astring lastname astring phoneticfirstname astring phoneticlastname astring displayname astring nickname astring prima...
... astring generatename(in long agenerateformat,[o
ptional] in nsistringbundle abundle) parameters agenerateformat the format to present the name in: 0 generated name is displayname 1 lastfirst, formatted following lastfirstformat property in addressbook.properties.
... abundle an o
ptional parameter that is a pointer to a string bundle that holds: addressbook.properties.
nsIAccessibleImage
accessible/public/nsiaccessibleimage.idlscri
ptable this interface allows in-process accessibility clients to retrieve information about an image.
...this method is the same as nsiaccessible.getbounds() exce
pting coordinate origin parameter.
... exce
ptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.
... exce
ptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.
nsIApplicationCacheChannel
netwerk/base/public/nsiapplicationcachechannel.idlscri
ptable this interface is implemented by communication channels that support application caches.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsiapplicationcachecontainer last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void markofflinecacheentryasforeign(); attributes attribute type descri
ption chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly provided and none is available from the notification callbacks.
...exce
ptions thrown ns_error_already_opened if set after calling asyncopen() on the channel.
...exce
ptions thrown ns_error_already_opened if set after calling asyncopen() on the channel.
nsIApplicationCacheService
netwerk/base/public/nsiapplicationcacheservice.idlscri
ptable this interface manages the set of application cache groups that manage offline resources for web applications.
...overview void cacheopportunistically(in nsiapplicationcache cache, in acstring key); nsiapplicationcache chooseapplicationcache(in acstring key); nsiapplicationcache createapplicationcache(in acstring group); void deactivategroup(in acstring group); nsiapplicationcache getactivecache(in acstring group); nsiapplicationcache getapplicationcache(in acstring clientid); void getgroups([o
ptional] out unsigned long count, [array, size_is(count), retval] out string groupids); methods cacheopportunistically() flags the specified key as one that should be cached opportunistically.
...createapplicationcache() creates a new, em
pty application cache for the specified cache group.
...void getgroups( out unsigned long count, o
ptional [array, size_is(count), retval] out string groupids ); parameters count o
ptional the count of the application cache groups.
nsIApplicationUpdateService
toolkit/mozapps/update/nsiupdateservice.idlscri
ptable this interface describes a global application service that handles performing background update checks.
...3 / seamonkey 2.1) method overview void adddownloadlistener(in nsirequestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type descri
ption backgroundchecker nsiupdatechecker the update checker being used for background update checking.
...void adddownloadlistener( in nsirequestobserver listener ); parameters listener an object implementing nsirequestobserver and o
ptionally nsiprogresseventsink that will be notified of state and progress information as the update is downloaded.
...see also nsiupdate nsiupdatechecklistener nsiupdatechecker nsiupdatepatch nsiupdatemanager nsiupdateprom
pt nsiupdatetimermanager ...
nsIAsyncInputStream
xpcom/io/nsiasyncinputstream.idlscri
ptable please add a summary to this article.
...method overview void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value descri
ption wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underlying stream).
...aflags this parameter specifies o
ptional flags passed in to configure the behavior of this method.
...the error code returned when an attem
pt is made to write to a "broken" pipe corresponds to the status code passed in when the input end of the pipe was closed, which greatly simplifies working with pipes in some cases.
nsIAsyncOutputStream
xpcom/io/nsiasyncoutputstream.idlscri
ptable please add a summary to this article.
...method overview void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value descri
ption wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underlying stream).
...aflags this parameter specifies o
ptional flags passed in to configure the behavior of this method.
...the error code returned when an attem
pt is made to read to a "closed" pipe corresponds to the status code passed in when the output end of the pipe was closed, which greatly simplifies working with pipes in some cases.
nsIBidiKeyboard
widget/public/nsibidikeyboard.idlscri
ptable this interface lets the application detect bidirectional writer users, and do some magic for them.
...ght-to-left directions (that is users who use arabic, iranian (persian), or israel (hebrew) keyboard layout, beside an us (english) layout.) inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview boolean islangrtl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type descri
ption havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed.
...exce
ptions thrown ns_error_failure if no right-to-left keyboards are installed.
... exce
ptions thrown ns_error_failure if no right-to-left keyboards are installed.
nsIBinaryInputStream
xpcom/io/nsibinaryinputstream.idlscri
ptable this interface allows consum
ption of primitive data types from a "binary stream" containing untagged, big-endian binary data, that is as produced by an implementation of nsibinaryoutputstream.
... warning: this method is available from javascri
pt; however javascri
pt does not support 64-bit integers.
... exce
ptions thrown ns_error_failure if it can't read alength bytes.
... exce
ptions thrown ns_error_failure if it can't read alength bytes.
nsICacheListener
netwerk/cache/nsicachelistener.idlscri
ptable this interface is a cache listener.
... inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void oncacheentryavailable(in nsicacheentrydescri
ptor descri
ptor, in nscacheaccessmode accessgranted, in nsresult status); void oncacheentrydoomed(in nsresult status); methods oncacheentryavailable() this method is called when the requested access (or appropriate subset) is acquired.
...void oncacheentryavailable( in nsicacheentrydescri
ptor descri
ptor, in nscacheaccessmode accessgranted, in nsresult status ); parameters descri
ptor the cache entry descri
ptor.
... see also nsicache nsicachesession nsicacheentrydescri
ptor ...
nsICacheService
netwerk/cache/public/nsicacheservice.idlscri
ptable handles visiting and evicting entries operations along with the creating of cache sessions and creation of temporary client ids operations for offline caching.
...reambased); acstring createtemporaryclientid(in nscachestoragepolicy storagepolicy); obsolete since gecko 1.9.2 void evictentries(in nscachestoragepolicy storagepolicy); void init(); obsolete since gecko 1.8 void shutdown(); obsolete since gecko 1.8 void visitentries(in nsicachevisitor visitor); attributes attribute type descri
ption cacheiotarget nsieventtarget the event target for cache i/o operation notifications.
... exce
ptions thrown ns_error_not_implemented this method is deprecated.
... exce
ptions thrown missing exce
ption missing descri
ption shutdown() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) shutdown() the cache service.
nsICommandLineRunner
toolkit/components/commandlines/public/nsicommandlinerunner.idlscri
ptable please add a summary to this article.
... 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 nschar
ptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type descri
ption hel
ptext autf8string process and combine the help text provided by each command-line handler.
...void init( in long argc, in nschar
ptrarray argv, in nsifile workingdir, in unsigned long state ); parameters argc the number of arguments being passed.
...exce
ptions thrown ns_error_abort thrown when the handler aborts.
nsIContentViewManager
content/base/public/nsiframeloader.idlscri
ptable manages the content views contained in a browser 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to obtain a reference to the view manager for a document, you can queryinterface() the nsiframeloader object to nsicontentviewmanager.
... method overview void getcontentviewsin(in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, [o
ptional] out unsigned long alength, [retval, array, size_is(alength)] out nsicontentview aresult); attributes attribute type descri
ption rootcontentview nsicontentview the root content view.
... void getcontentviewsin( in float axpx, in float aypx, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, out unsigned long alength, o
ptional [retval, array, size_is(alength)] out nsicontentview aresult ); parameters axpx the x coordinate of the anchor point of the rectangle, in css pixels.
... alength o
ptional if specified, on return this parameter indicates the number of nsicontentview objects returned in the aresult array.
nsICookieStorage
modules/plugin/base/public/nsicookiestorage.idlnot scri
ptable please add a summary to this article.
... last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookieurl, in void
ptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoid
ptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store.
... void getcookie( in string acookieurl, in void
ptr acookiebuffer, in pruint32ref acookiesize ); parameters acookieurl url string to look up cookie with..
... void setcookie( in string acookieurl, in constvoid
ptr acookiebuffer, in unsigned long acookiesize ); parameters acookieurl url string to look up cookie with..
nsIDOMFontFace
layout/inspector/public/nsidomfontface.idlscri
ptable describes a single font face.
... attribute type descri
ption fromfontgroup boolean indicates whether or not the font was located in a font group.
... attribute type descri
ption cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on).
... attribute type descri
ption format domstring the font format.
nsIDOMHTMLTimeRanges
dom/interfaces/html/nsidomhtmltimeranges.idlscri
ptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type descri
ption length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
...exce
ptions thrown index_size_err the specified index is not valid.
...exce
ptions thrown index_size_err the specified index is not valid.
nsIDOMOfflineResourceList
dom/interfaces/offline/nsidomofflineresourcelist.idlscri
ptable please add a summary to this article.
... in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type descri
ption mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
... constants application cache state constants constant value descri
ption uncached 0 the object isn't associated with an application cache.
... note: versioned application caches are not yet supported; this method will throw an exce
ption.
nsIDOMSimpleGestureEvent
dom/interfaces/events/nsidomsimplegestureevent.idlscri
ptable this interface describes a mouse or trackpad gesture event.
...g, 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); attributes attribute type descri
ption delta double the delta value indicating how far the gesture moved.
... constants direction constants constant value descri
ption direction_up 1 upward swipe.
... rotation constants constant value descri
ption rotation_counterclockwise 1 counter-clockwise rotation.
nsIDOMUserDataHandler
dom/interfaces/core/nsidomuserdatahandler.idlscri
ptable the callback function for the setuserdata method.
... 1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value descri
ption node_cloned 1 the node was cloned.
... node_deleted 3 unimplemented node_renamed 4 unimplemented node_ado
pted 5 the node was ado
pted into a new document.
... methods handle() this method is a callback which will be called if a node with user data is being cloned, imported or ado
pted.
nsIDOMXPathResult
dom/interfaces/xpath/nsidomxpathresult.idlscri
ptable this interface describes an xpath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method overview nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type descri
ption booleanvalue boolean if resulttype is boolean_type, the boolean value.
... resulttype unsigned short the type of result; can be any of the type constants exce
pt any_type.
... constants type constants constant value descri
ption any_type 0 used when evaluating an xpath expression; the evaluator will return the most appropriate type.
...see also introduction to using xpath in javascri
pt document object model (dom) level 3 xpath specification nsidomxpathevaluator document.evaluate nsidomxpathexce
ption ...
nsIDirIndex
netwerk/streamconv/public/nsidirindex.idlscri
ptable a class holding information about a directory index.
... inherits from: nsisupports last changed in gecko 1.7 attributes attribute type descri
ption contenttype string the content type; may be null if it is unknown.
... descri
ption wstring a descri
ption for the filename, which should be displayed by a viewer.
... constants constant value descri
ption type_unknown 0 the type is unknown.
nsIDirectoryEnumerator
xpcom/io/nsidirectoryenumerator.idlscri
ptable this interface provides a means for enumerating the contents of a directory.
... it is similar to nsisimpleenumerator exce
pt the retrieved entries are qi'ed to nsifile, and there is a mechanism for closing the directory when the enumeration is complete.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void close(); attributes attribute type descri
ption nextfile nsifile the next file in the sequence.
...exce
ptions thrown ns_ok if the call succeeded and the directory was closed.
nsIDownload
toolkit/components/downloads/public/nsidownload.idlscri
ptable this interface describes a download object.
... attributes attribute type descri
ption amounttransferred long long the number of bytes downloaded so far.
... displayname astring a user-readable descri
ption of the transfer.
...o
ptional percentcomplete long the percentage of the file transfer that has been completed, or -1 if the file's size is unknown.
nsIDragDropHandler
content/base/public/nsidragdrophandler.idlscri
ptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void detach(); void hooku
pto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop.
...hooku
pto() attaches drag handlers to a specified receiver, setting up callbacks to let built-in behaviors be overridden.
... void hooku
pto( in nsidomeventtarget attachpoint, in nsiwebnavigation navigator ); parameters attachpoint the receiver to which to attach drag handlers.
nsIFeed
toolkit/components/feeds/public/nsifeed.idlscri
ptable this interface represents a single atom or rss (really simple syndication) news feed.
... 1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type descri
ption cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed.
... subtitle nsifeedtextconstruct returns a subtitle for the feed, based on its descri
ption, subtitle, and appropriate extensions.
... constants constant value descri
ption type_feed 0 a standard text-based feed.
nsIFeedEntry
toolkit/components/feeds/public/nsifeedentry.idlscri
ptable this interface describes a single entry in an rss or atom news feed, providing attributes allowing access to the entry's data.
... 1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type descri
ption content nsifeedtextconstruct the full text of the entry's content.
...this date is parsable by both javascri
pt (via date.parse()) and mail code.
...this is generated automatically using the entry's descri
ption, subtitle, summary, content, and appropriate extensions.
nsIFrameLoaderOwner
content/base/public/nsiframeloader.idlscri
ptable represents the owner of an nsiframeloader.
... 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 [noscri
pt, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type descri
ption frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
...[noscri
pt, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); parameters none.
... exce
ptions thrown ns_error_dom_security_err if the swap is not allowed on security grounds.
nsIHttpActivityObserver
netwerk/protocol/http/nsihttpactivityobserver.idlscri
ptable this interface provides a way for http transport activities to be reported to observers.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void observeactivity(in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata); attributes attribute type descri
ption isactive boolean true when the interface is active and should observe http activity, otherwise false.
... constants activity type constants constant value descri
ption activity_type_socket_transport 0x0001 socket transport activity has occurred.
... activity subtype constants constant value descri
ption activity_subtype_request_header 0x5001 the http request is about to be queued for sending.
nsIMemoryMultiReporterCallback
xpcom/base/nsimemoryreporter.idlscri
ptable implement this interface to handle callbacks from nsimemorymultireporter instances.
... 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void callback(in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string descri
ption, in nsisupports closure); methods callback() called to provide information from a multi-reporter.
...void callback( in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string descri
ption, in nsisupports closure ); parameters process the value of the process attribute for the memory reporter.
... descri
ption the value of the descri
ption attribute.
nsIMessageBroadcaster
methods void broadcastasyncmessage([o
ptional] in astring messagename, [o
ptional] in jsval obj, [o
ptional] 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 descri
ption messagename string the name of the message.
... o
ptional.
...parameters name type descri
ption aindex number the index of the subordinate message manager to retrieve.
nsIMimeHeaders
nsimimeheaders mailnews/mime/public/nsimimeheaders.idlscri
ptable ???
... add brief descri
ption of interface ???
...omponents.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 descri
ption allheaders string read only.
... methods extractheader() string extractheader( [const] in string headername, in boolean getallofthem ); parameters headername missing descri
ption getallofthem missing descri
ption return value missing descri
ption exce
ptions thrown missing exce
ption missing descri
ption initialize() void initialize( [const] in string allheaders, in long allheaderssize ); parameters allheaders insert the complete message content allheaderssize length of the passed in content exce
ptions thrown missing exce
ption missing descri
ption remarks see also ...
nsIMsgCustomColumnHandler
mailnews/base/public/nsimsgcustomcolumnhandler.idlscri
ptable please add a summary to this article.
...the interface inherits from nsitreeview, however when you're implementing a custom handler in javascri
pt its not necessary to implement all of nsitreeview's methods.
... you must implement: nsitreeview.iseditable() nsitreeview.getcellproperties() nsitreeview.getimagesrc() nsitreeview.getcelltext() nsitreeview.cyclecell() nsimsgcustomcolumnhandler.getsortstringforrow() nsimsgcustomcolumnhandler.getsortlongforrow() nsimsgcustomcolumnhandler.isstring() and o
ptionally: nsitreeview.getrowproperties() from c++ you must implement all of nsitreeview and nsimsgcustomcolumnhandler.
... example implementation an example javascri
pt implementation that does nothing: var columnhandler = { iseditable: function(arow, acol) {return false;}, cyclecell: function(arow, acol) { }, getcelltext: function(arow, acol) { }, getsortstringforrow: function(ahdr) { return ""; }, isstring: function() {return true;}, getcellproperties: function(arow, acol, aprops) { }, getrowproperties: function(arow, aprops) { }, getimagesrc: function(arow, acol) {return null;}, getsortlongforrow: function(ahdr) {return 0;} } to attach it use the nsimsgdbview.addcolumnhandler() method (recall gdbview is the global nsimsgdbview in thunderbird): gdbview.addcolumnhandler("newcolumn", columnhandler); after which it can be retrieved using the nsimsgdbview.getc...
nsIMsgRuleAction
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter.idl [scri
ptable, uuid(190a2a18-d245-473a-a402-9f0814598c7f)] interface nsimsgruleaction : nsisupports { attribute nsmsgruleactiontype type; // target priority..
... throws an exce
ption if the action is not priority attribute nsmsgpriorityvalue priority; // target folder..
... throws an exce
ption if the action is not move to folder attribute acstring targetfolderuri; // target label.
... throws an exce
ption if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exce
ption if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsIMsgWindow
mailnews/base/public/nsimsgwindow.idlscri
ptable please add a summary to this article.
...method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type descri
ption windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane.
... notificationcallbacks nsiinterfacerequestor these are currently used to set notification callbacks on protocol channels to handle things like bad cert exce
ptions.
... prom
ptdialog nsiprom
pt readonly: this is the equivalent of calling getinterface on the rootdocshell object.
nsINavHistoryResult
toolkit/components/places/nsinavhistoryservice.idlscri
ptable describes the result of a history or bookmark query.
...method overview void addobserver(in nsinavhistoryresultobserver aobserver, in boolean aownsweak); void removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type descri
ption root nsinavhistorycontainerresultnode the root of the results.
...this value must be one of nsinavhistoryqueryo
ptions.sort_by_*.
... changing this value updates the corresponding o
ptions for the result so that reusing the current o
ptions and queries will always return results based on the current view.
nsINavHistoryResultTreeViewer
toolkit/components/places/public/nsinavhistoryservice.idlscri
ptable this interface provides a predefined view ada
ptor for interfacing places query results with a tree.
...method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type descri
ption collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
...the tree ada
ptor will also qi to nsitreeview, and this will be the same as nsitreeview.rowcount.
...obsolete since gecko 1.9 constants constant value descri
ption index_invisible 0xffffffff returned by treeindexfornode() when the requested node isn't visible (such as when its parent is collapsed).
nsIXULSortService
content/xul/templates/public/nsixulsortservice.idlscri
ptable a service used to sort the contents of a xul widget.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void insertcontainernode(in nsirdfcompositedatasource db, in nsrdfsortstate sortstate
ptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify); native code only!
... obsolete since gecko 1.9 void sort(in nsidomnode anode, in astring asortkey, in astring asorthints); constants constant value descri
ption sort_comparecase 0x0001 sort_integer 0x0100 methods native code only!insertcontainernode obsolete since gecko 1.9 (firefox 3)this feature is obsolete.
...void insertcontainernode( in nsirdfcompositedatasource db, in nsrdfsortstate sortstate
ptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify ); parameters db sortstate
ptr root trueparent container node anotify sort() sort the contents of the widget containing anode using asortkey as the comparison key, and asorthints as how to sort.
nsIXULTemplateResult
content/xul/templates/public/nsixultemplateresult.idlscri
ptable a single result generated from a template query.
...the result may o
ptionally be identified by an rdf resource.
...method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type descri
ption id astring id of the result.
... isem
pty boolean true if the result represents an em
pty container.
nsIXULWindow
xpfe/appshell/nsixulwindow.idlscri
ptable please add a summary to this article.
...lagsarefrozen(); void center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); nsidocshelltreeitem getcontentshellbyid(in wstring id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type descri
ption chromeflags pruint32 chromeflags are from nsiwebbrowserchrome.
...on some platforms, windows with a higher zlevel will be ke
pt above windows with a lower zlevel.
... constants constant value descri
ption lowestz 0 loweredz 4 the z level of an independent window opened with the "alwayslowered" chrome flag.
nsIXmlRpcClient
extensions/xml-rpc/idl/nsixmlrpcclient.idlscri
ptable please add a summary to this article.
...me, 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 descri
ption serverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlrpcfault the most recent xml-rpc fault from returned from this server.
... constants constant type descri
ption int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods init() set server url.
...via nsixpconnect::getpendingexce
ption()->data a nsixmlrpcfault object can be retreieved with more information on the fault.
Using the Gecko SDK
a frozen gecko api is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exce
ption to the rule).
...(note: nspr is the one exce
ption to this rule.
...for example, the nscom
ptr class is defined in the xpcom glue library.
... linking (link line, version scri
pt to only expose nsgetmodule, etc.) ...
already_AddRefed
« xpcom api reference already_addrefed in association with nscom
ptr allows you to assign in a pointer without addrefing it.
...in fact, it is preferred to use already_addrefed in this case over returning a raw pointer or nscom
ptr (see the nscom
ptr user manual).
...already_addrefed<nsifoo> getfoo() { nsifoo* foo = mfoo; ns_if_addref(foo); return foo; } // or already_addrefed<nsifoo> getfoo() { nscom
ptr<nsifoo> foo = mfoo; // ...
...nscom
ptr<nsifoo> foo = getfoo(); see also nscom
ptr, getteraddrefs(), dont_addref().
Autoconfiguration in Thunderbird
the configuration file descri
ption and definition the original project page on the mozilla wiki for background, design, implementation and project details this document describes how autoconfiguration in thunderbird works, and what to do to allow mail servers to be autoconfigured.
... configuration server at isp isps have the o
ption to provide their configuration information themselves directly to users, by setting up a web server at autoconfig.<domain>, which simply returns a static xml file with the configuration, as described below.
... guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encry
pted passwords (cram-md5).
... domain hoster if you are an isp that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers acce
pt and serve the mail for example.com -, you should set up an autoconfig server.
Building a Thunderbird extension 1: introduction
it shares many of the technologies used by mozilla firefox, including javascri
pt, the gecko layout engine, the xul xml user interface language and the xpcom cross-platform component object model.
...the tutorial has the following pages: introduction (this page) the extension filesystem (setting up your local system) install manifest (the install.rdf file that contains meta-information about the extension) chrome manifest (list of packages and overlays) xul (the xml user interface language that is used to modify the thunderbird user interface) adding javascri
pt (explains how to add some simple javascri
pt to your thunderbird extension) installing locally (enabling the extension on your local thunderbird instance) packaging (making a distribution package that contains the extension) distributing (from your own site or from http://addons.mozilla.org/) this tutorial is compatible with thunderbird versions 2,3 and 5.
...however, most developers use an editing program o
ptimized for writing code (also known as an integrated development environment).
... there are also a number of extension and applications that are useful for testing and debugging thunderbird extensions, such as javascri
pt consoles and xpcom inspectors.
Creating a Custom Column
ld now contain something similar to this: <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colreplyto" persist="hidden ordinal width" currentview="unthreaded" flex="2" label="reply-to" toolti
ptext="click to sort by the reply-to header" /> </treecols> </tree> <!-- include our javascri
pt file --> <scri
pt type="text/javascri
pt" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it!
...rest assured that these functions will be called - so implement them, even with em
pty function.
... from nsitreeview: getcellproperties(row, col, props): o
ptionally modify the props array getrowproperties(row, props): o
ptionally modify the props array getimagesrc(row, col): return a string (or null) getcelltext(row, col): return a string representing the actual text to display in the column from nsimsgcustomcolumnhandler: getsortstringforrow(hdr): return the string value that the column will be sorted by getsortlongforrow(hdr): return the long value that the column will be sorted by isstring(): return true / false warning!
...getcelltext() is the text that is displayed to the user while getsort*forrow() is what is used internally when sorting by your column a simple implementation objects in javascri
pt are just "advanced" variables, so an implementation of the nsimsgcustomcolumnhandler interface looks like: var columnhandler = { getcelltext: function(row, col) { //get the message's header so that we can extract the reply to field var hdr = gdbview.getmsghdrat(row); return hdr.getstringproperty("replyto"); }, getsortstringforrow: function(hdr) {return hdr.getstringproperty("replyto");}, isstring: function() {ret...
Theme Packaging
install.rdf your install.rdf manifest will look something like this: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <descri
ption about="urn:mozilla:install-manifest"> <em:type>4</em:type> more properties </descri
ption> </rdf> required install.rdf properties your install.rdf file must have the following properties.
... see the install.rdf reference for more information: em:id em:version em:type em:targetapplication em:name em:internalname o
ptional install.rdf properties em:descri
ption em:creator em:contributor em:homepageurl em:updateurl note that if your theme will be made available on the https://addons.mozilla.org website, it may not include an updateurl.
... sample install.rdf file <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <descri
ption about="urn:mozilla:install-manifest"> <em:id>{18b64b56-d42f-428d-a88c-baa413bc413f}</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this extension can install into, with minimum and maximum supported versions.
... --> <em:targetapplication> <descri
ption> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>0.8</em:minversion> <em:maxversion>0.9</em:maxversion> </descri
ption> </em:targetapplication> <!-- front end metadata --> <em:name>new theme 1</em:name> <em:descri
ption>a test theme for thunderbird</em:descri
ption> <em:creator>ben goodger</em:creator> <em:contributor>john doe</em:contributor> <em:homepageurl>http://www.bengoodger.com/</em:homepageurl> <!-- front end integration hooks (used by theme manager)--> <em:internalname>newtheme1</em:internalname> </descri
ption> </rdf> the following are some common target application guids that you can use in your targetapplication properties: thunderbird {355...
Toolkit version format
see older version formats below for descri
ption of the older version format used in firefox/thunderbird 1.0.
...each of the parts is o
ptional.
...an em
pty or missing version part is equivalent to 0.
... older version formats firefox and thunderbird 1.0 used a simpler version format, namely major[.minor[.release[.build]]][+] where [..] denotes an o
ptional component, and major, minor, release, and build are all non-negative integers.
Library
declare() declares an api from the native library, allowing it to be used from javascri
pt.
... cdata declare( name[, abi, returntype argtype1, ...] ); parameters name the name of the symbol exported by the native library that is to be declared as usable from javascri
pt abi the abi used by the exported function; this will be ctypes.default_abi for most libraries, exce
pt for windows libraries, which will be ctypes.winapi_abi or ctypes.stdcall_abi.
... exce
ptions thrown ctypes ctype functiontype abi typeerror the return type was specified as an array.
...this would be done like this: var objc = ctypes.open(ctypes.libraryname('objc')); objc.declare('_nsconcreteglobalblock', ctypes.void
ptr_t); see also ...
Memory - Plugins
« previousnext » this cha
pter describes the plug-in api functions that allocate and free memory as needed by the plug-in.
...in addition, the plug-in usually has the o
ption of using its own memory functions.
...since npn_memalloc automatically frees cached information if necessary to fulfill a request for memory, calls to npn_memalloc may succeed where direct calls to new
ptr fail.
... void npn_memfree (void *
ptr); the
ptr parameter represents a block of memory previously allocated using npn_memalloc.
Use a source map - Firefox Developer Tools
the javascri
pt sources executed by the browser are often transformed in some way from the original sources created by a developer.
... javascri
pt running in a page is often machine-generated, as when compiled from a language like coffeescri
pt or typescri
pt.
...this page loads a source called "main.js" that was originally written in coffeescri
pt and compiled to javascri
pt.
... the compiled source contains a comment like this, that points to a source map: //# sourcemappingurl=main.js.map in the debugger's source list pane, the original coffeescri
pt source now appears as "main.coffee", and we can debug it just like any other source.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
the layout view grid section when grids are included on a page, the css pane's layout view includes a "grid" section containing a number of o
ptions for viewing those grids.
... grid o
ptions the grid section of the layout view looks like this: you'll see a number of o
ptions contained within: overlay grid: contains a checkbox for each grid present on the page, along with various o
ptions.
... extend lines infinitely: by default, grid lines/tracks are only shown inside the element with display: grid set on it; when toggling this o
ption on, the grid lines extend to the edge of the viewport along each axis.
... when you check the "extend lines infinitely" o
ption, the grid lines extend to the edge of the viewport along each axis.
Cache.delete() - Web APIs
syntax cache.delete(request, {o
ptions}).then(function(found) { // your cache entry has been deleted if found }); parameters request the request you are looking to delete.
... o
ptions o
ptional an object whose properties control how matching is done in the delete operation.
... the available o
ptions are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
...note that this o
ption is ignored by cache.delete().
Cache.keys() - Web APIs
syntax cache.keys(request, {o
ptions}).then(function(keys) { // do something with your array of requests }); parameters request o
ptional the request want to return, if a specific key is desired.
... o
ptions o
ptional an object whose properties control how matching is done in the keys operation.
... the available o
ptions are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
...note that this o
ption is ignored by cache.keys().
Cache.matchAll() - Web APIs
syntax cache.matchall(request, {o
ptions}).then(function(response) { // do something with the response array }); parameters request o
ptional the request for which you are attem
pting to find responses in the cache.
... o
ptions o
ptional an o
ptions object allowing you to set specific control o
ptions for the matching performed.
... the available o
ptions are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url.
... note: cache.match() is basically identical to cache.matchall(), exce
pt that rather than resolving with an array of all matching responses, it resolves with the first matching response only (that is, response[0]).
CanvasRenderingContext2D.arcTo() - Web APIs
html <canvas id="canvas"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // tangential lines ctx.beginpath(); ctx.strokestyle = 'gray'; ctx.moveto(200, 20); ctx.lineto(200, 130); ctx.lineto(50, 20); ctx.stroke(); // arc ctx.beginpath(); ctx.strokestyle = 'black'; ctx.linewidth = 5; ctx.moveto(200, 20); ctx.arcto(200,130, 50,20, 40); ctx.stroke(); // start point ctx.beginpath(); ...
... html <canvas id="canvas"></canvas> javascri
pt the arc begins at the point specified by moveto(): (230, 20).
... html <canvas id="canvas"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(180, 90); ctx.arcto(180,130, 110,130, 130); ctx.lineto(110, 130); ctx.stroke(); result live demo more sophisticated demo of the method.
... html <div> <label for="radius">radius: </label> <input name="radius" type="range" id="radius" min=0 max=100 value=50> <label for="radius" id="radius-output">50</label> </div> <canvas id="canvas"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const controlout = document.getelementbyid('radius-output'); const control = document.getelementbyid('radius'); control.oninput = () => { controlout.textcontent = r = control.value; }; const mouse = { x: 0, y: 0 }; let r = 100; // radius const p0 = { x: 0, y: 50 }; const p1 = { x: 100, y: 100 }; const p2 = { x: 150, y: 50 }; const p3 = { x: 200, y: 100 }; const labelpoint = function (p...
CanvasRenderingContext2D.createPattern() - Web APIs
it can be any of the following: htmlimageelement (<img>) svgimageelement (<image>) htmlvideoelement (<video>, by using the ca
pture of the video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indicating how to repeat the pattern's image.
... possible values are: "repeat" (both directions) "repeat-x" (horizontal only) "repeat-y" (vertical only) "no-repeat" (neither direction) if repetition is specified as an em
pty string ("") or null (but not undefined), a value of "repeat" will be used.
... the original image looks like this: html <canvas id="canvas" width="300" height="300"></canvas> javascri
pt var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var img = new image(); img.src = 'https://udn.realityripple.com/samples/04/aaeaf9aac4.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 300, 300); }; creating a pattern from a canvas in this example we create a pattern from the c...
... javascri
pt // create a pattern, offscreen const patterncanvas = document.createelement('canvas'); const patterncontext = patterncanvas.getcontext('2d'); // give the pattern a width and height of 50 patterncanvas.width = 50; patterncanvas.height = 50; // give the pattern a background color and draw an arc patterncontext.fillstyle = '#fec'; patterncontext.fillrect(0, 0, patterncanvas.width, patterncanvas.height); patterncontext.arc(0, 0, 50, 0, .5 * math.pi); patterncontext.stroke(); // create our primary canvas and fill it with the pattern const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const pattern = ctx.createpattern(pat...
CanvasRenderingContext2D.fillText() - Web APIs
an o
ptional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size.
... maxwidth o
ptional the maximum number of pixels wide the text may be once rendered.
... <canvas id="canvas" width="400" height="150"></canvas> javascri
pt the javascri
pt code for this example follows.
... html <canvas id="canvas" width="400" height="150"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '50px serif'; ctx.filltext('hello world', 50, 90, 140); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.filltext' in that specification.
CanvasRenderingContext2D.filter - Web APIs
it is similar to the css filter property and acce
pts the same values.
... syntax ctx.filter = "<filter-function1> [<filter-function2>] [<filter-functionn>]"; ctx.filter = "none"; values the filter property acce
pts a value of "none" or one or more of the following filter functions in a domstring.
... html <canvas id="canvas"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.filter = 'blur(4px)'; ctx.font = '48px serif'; ctx.filltext('hello world', 50, 100); result applying multiple filters you can combine as many filters as you like.
... html <canvas id="canvas"></canvas> <div style="display:none;"> <img id="source" src="https://udn.realityripple.com/samples/90/a34a525ace.jpg"> </div> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const image = document.getelementbyid('source'); image.addeventlistener('load', e => { ctx.filter = 'contrast(1.4) sepia(1) drop-shadow(9px 9px 2px #e81)'; ctx.drawimage(image, 10, 10, 180, 120); }); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.filter' in that specification.
CanvasRenderingContext2D.setLineDash() - Web APIs
note: to return to using solid lines, set the line dash list to an em
pty array.
...if the array is em
pty, the line dash list is cleared and line strokes return to being solid.
... html <canvas id="canvas"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // dashed line ctx.beginpath(); ctx.setlinedash([5, 15]); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); // solid line ctx.beginpath(); ctx.setlinedash([]); ctx.moveto(0, 100); ctx.lineto(300, 100); ctx.stroke(); result some common patterns this example illustrates a variety of common line dash patterns.
... html <canvas id="canvas"></canvas> javascri
pt the drawdashedline() function created below makes the drawing of multiple dashed lines simple.
CanvasRenderingContext2D.strokeText() - Web APIs
an o
ptional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size.
... maxwidth o
ptional the maximum width the text may be once rendered.
... <canvas id="canvas" width="400" height="150"></canvas> javascri
pt the javascri
pt code for this example follows.
... html <canvas id="canvas" width="400" height="150"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '50px serif'; ctx.stroketext('hello world', 50, 90, 140); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.stroketext' in that specification.
CanvasRenderingContext2D.textBaseline - Web APIs
syntax ctx.textbaseline = "top" || "hanging" || "middle" || "alphabetic" || "ideographic" || "bottom"; o
ptions possible values: "top" the text baseline is the top of the em square.
...(used by tibetan and other indic scri
pts.) "middle" the text baseline is the middle of the em square.
...(used by chinese, japanese, and korean scri
pts.) "bottom" the text baseline is the bottom of the bounding box.
... html <canvas id="canvas" width="550" height="500"></canvas> javascri
pt const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const baselines = ['top', 'hanging', 'middle', 'alphabetic', 'ideographic', 'bottom']; ctx.font = '36px serif'; ctx.strokestyle = 'red'; baselines.foreach(function (baseline, index) { ctx.textbaseline = baseline; const y = 75 + index * 75; ctx.beginpath(); ctx.moveto(0, y + 0.5); ctx.lineto(550, y + 0.5); ctx.stroke(); ctx.filltext('abcdefghijklmnop (' + baseline + ')...
Manipulating video using canvas - Web APIs
this tutorial demonstrates how to perform chroma-keying (also known as the "green screen effect") using javascri
pt code.
...t; border :1px solid #444444; padding:10px; margin: 10px; background:#3b3b3b; } </style> </head> <body> <div> <video id="video" src="media/video.mp4" controls="true" crossorigin="anonymous"/> </div> <div> <canvas id="c1" width="160" height="96"></canvas> <canvas id="c2" width="160" height="96"></canvas> </div> <scri
pt type="text/javascri
pt" src="processor.js"></scri
pt> </body> </html> the key bits to take away from this are: this document establishes two canvas elements, with the ids c1 and c2.
... the javascri
pt code is imported from a scri
pt named processor.js.
... the javascri
pt code the javascri
pt code in processor.js consists of three methods.
Canvas tutorial - Web APIs
<canvas> is an html element which can be used to draw graphics via scri
pting (usually javascri
pt).
... before you start using the <canvas> element is not very difficult, but you do need a basic understanding of html and javascri
pt.
...in order to draw graphics on the canvas we use a javascri
pt context object, which creates graphics on the fly.
... in this tutorial basic usage drawing shapes applying styles and colors drawing text using images transformations compositing and clipping basic animations advanced animations pixel manipulation hit regions and accessibility o
ptimizing the canvas finale ...
ChannelMergerNode() - Web APIs
syntax var mynode = new channelmergernode(context, o
ptions); parameters context a baseaudiocontext representing the audio context you want the node to be associated with.
... o
ptions o
ptional a channelmergero
ptions dictionary object defining the properties you want the channelmergernode to have (also inherits parameters from the audionodeo
ptions dictionary): numberofinputs: a number defining the number of inputs the channelmergernode should have.
... exce
ptions invalidstateerror an o
ption such as channelcount or channelcountmode has been given an invalid value.
... example var ac = new audiocontext(); var o
ptions = { numberofinputs : 2 } var mymerger = new channelmergernode(ac, o
ptions); specifications specification status comment web audio apithe definition of 'channelmergernode' in that specification.
Using channel messaging - Web APIs
the channel messaging api allows two separate scri
pts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, or two documents via a sharedworker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
...for this initial port transfering this message could be an em
pty string but in this example it is set to 'init'.
... receiving the port and message in the iframe over in the iframe, we have the following javascri
pt: var list = document.queryselector('ul'); var port2; // listen for the initial port transfer message window.addeventlistener('message', initport); // setup the transferred port function initport(e) { port2 = e.ports[0]; port2.onmessage = onmessage; } // handle messages received on port2 function onmessage(e) { var listitem = document.createelement('li'); listitem.textcontent = e.data;...
... // handle messages received on port1 function onmessage(e) { output.innerhtml = e.data; input.value = ''; } when a message is received back from the iframe confirming that the original message was received successfully, this simply outputs the confirmation to a paragraph and em
pties the text input ready for the next message to be sent.
Clipboard.read() - Web APIs
example after using navigator.permissions.query() to find out if we have (or if the user will be prom
pted to allow) "clipboard-read" access, this example fetches the data currently on the clipboard.
... navigator.permissions.query({name: "clipboard-read"}).then(result => { // if permission to read the clipboard is granted or if the user will // be prom
pted to allow it, we proceed.
... if (result.state == "granted" || result.state == "prom
pt") { navigator.clipboard.read().then(data => { for (let i=0; i<data.items.length; i++) { if (data.items[i].type != "image/png") { alert("clipboard contains non-image data.
... unable to access it."); } else { const blob = data.items[i].gettype("image/png"); imgelem.src = url.createobjecturl(blob); } } }); } }); note: at this time, while firefox does implement read(), it does not recognize the "clipboard-read" permission, so attem
pting to use the permissions api to manage access to the api will not work.
CloseEvent() - Web APIs
closeeventinit o
ptional is a closeeventinit dictionary, having the following fields: "wasclean", o
ptional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not.
... "code", o
ptional and defaulting to 0, of type unsigned short, that is the connection close code sent by the server.
... "reason", o
ptional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection.
... the closeeventinit dictionary also acce
pts fields from the eventinit dictionary.
console.assert() - Web APIs
objn a list of javascri
pt objects to output.
... msg a javascri
pt string containing zero or more substitution strings.
...substn javascri
pt objects with which to replace substitution strings within msg.
... examples the following code example demonstrates the use of a javascri
pt object following the assertion: const errormsg = 'the # is not even'; for (let number = 2; number <= 5; number += 1) { console.log('the # is ' + number); console.assert(number % 2 === 0, {number: number, errormsg: errormsg}); // or, using es2015 object property shorthand: // console.assert(number % 2 === 0, {number, errormsg}); } // output: // the # is 2 // the # is 3 // assertion failed: {number: 3, errormsg: "the # is not even"} // the # is 4 // the # is 5 // assertion failed: {number: 5, errormsg: "the # is not even"} note that, while a string containing a substitution string works as a parameter for console.log in node ...
console.debug() - Web APIs
objn a list of javascri
pt objects to output.
... msg a javascri
pt string containing zero or more substitution strings, which are replaced with subst1 through substn in consecutive order.
...substn javascri
pt objects with which to replace substitution strings within msg.
...see using string substitutions in console for a descri
ption of how substitutions work.
Console.error() - Web APIs
syntax console.error(obj1 [, obj2, ..., objn]); console.error(msg [, subst1, ..., substn]); console.exce
ption(obj1 [, obj2, ..., objn]); console.exce
ption(msg [, subst1, ..., substn]); note: console.exce
ption() is an alias for console.error(); they are functionally identical.
...objn a list of javascri
pt objects to output.
... msg a javascri
pt string containing zero or more substitution strings.
...substn javascri
pt objects with which to replace substitution strings within msg.
console.log() - Web APIs
the message may be a single string (with o
ptional substitution values), or it may be any one or more javascri
pt objects.
...objn a list of javascri
pt objects to output.
... msg a javascri
pt string containing zero or more substitution strings.
...substn javascri
pt objects with which to replace substitution strings within msg.
CustomElementRegistry.define() - Web APIs
syntax customelements.define(name, constructor, o
ptions); parameters name name for the new custom element.
... o
ptions o
ptional object that controls how the element is defined.
... one o
ption is currently supported: extends: string specifying the name of a built-in element to extend.
... exce
ptions exce
ption descri
ption notsupportederror the customelementregistry already contains an entry with the same name or the same constructor (or is otherwise already defined), or extends is specified and it is a valid custom element name, or extends is specified but the element it is trying to extend is an unknown element.
CustomEvent - Web APIs
(mozilla-specific.) event.returnvalue a historical property introduced by internet explorer and eventually ado
pted into the dom specification in order to ensure existing sites continue to work.
... event.istrusted read only indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a scri
pt (using an event creation method, like event.initevent).
...this includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the ca
pture phase, for instance).
...(prevents the event from bubbling.) event.preventca
pture() obsolete since gecko 24 obsolete; use event.stoppropagation instead.
DOMHighResTimeStamp - Web APIs
the starting time can be either a specific time determined by the scri
pt for a site or app, or the time origin.
...it's calculated like this: if the scri
pt's global object is a window, the time origin is determined as follows: if the current document is the first one loaded in the window, the time origin is the time at which the browser context was created.
... if during the process of unloading the previous document which was loaded in the window, a confirmation dialog was displayed to let the user confirm whether or not to leave the previous page, the time origin is the time at which the user confirmed that navigating to the new page was acce
ptable.
... if the scri
pt's global object is a workerglobalscope (that is, the scri
pt is running as a web worker), the time origin is the moment at which the worker was created.
DataTransfer.items - Web APIs
the list includes one item for each item in the operation and if the operation had no items, the list is em
pty.
...if the drag operation had no data, the list is em
pty.
... <!doctype html> <html lang=en> <title>examples of datatransfer.{types,items} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </style> <scri
pt> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom v...
...items[" + i + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </scri
pt> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </ul> <div id="target" ondrop="drop_handler(event);" ondragover="dragove...
DataTransferItem.webkitGetAsEntry() - Web APIs
#dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed red; border-radius: 10px; } #boxtitle { display: table-cell; vertical-align: middle; text-align: center; color: black; font: bold 2em "arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "arial", sans-serif; } javascri
pt content first, let's look at the recursive scanfiles() function.
... note that to read all files in a directory, readentries needs to be called repeatedly until it returns an em
pty array.
...first, the list is em
ptied by setting listing.innerhtml to be em
pty.
... that leaves us with an em
pty ul to begin inserting directory entries into.
DataTransferItemList.clear() - Web APIs
the datatransferitemlist method clear() removes all datatransferitem objects from the drag data items list, leaving the list em
pty.
... the drag data store in which this list is ke
pt is only writable while handling the dragstart event.
...no exce
ption is thrown.
...gable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascri
pt function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>...
Detecting device orientation - Web APIs
there are two javascri
pt events that handle orientation information.
...sensors that are commonly capable of detecting devicemotionevent include sensors in la
ptops to protect moving storage devices.
... window.addeventlistener("deviceorientation", handleorientation, true); after registering your event listener (in this case, a javascri
pt function called handleorientation()), your listener function periodically gets called with updated orientation data.
... processing motion events motion events are handled the same way as the orientation events exce
pt that they have their own event's name: devicemotion window.addeventlistener("devicemotion", handlemotion, true); what's really changed are the information provided within the devicemotionevent object passed as a parameter of the handlemotion function.
Document: DOMContentLoaded event - Web APIs
synchronous javascri
pt pauses parsing of the dom.
... if you want the dom to get parsed as fast as possible after the user has requested the page, you can make your javascri
pt asynchronous and o
ptimize loading of stylesheets.
... examples basic usage document.addeventlistener('domcontentloaded', (event) => { console.log('dom fully loaded and parsed'); }); delaying domcontentloaded <scri
pt> document.addeventlistener('domcontentloaded', (event) => { console.log('dom fully loaded and parsed'); }); for( let i = 0; i < 1000000000; i++) {} // this synchronous scri
pt is going to delay parsing of the dom, // so the domcontentloaded event is going to launch later.
... </scri
pt> checking whether loading is already complete domcontentloaded may fire before your scri
pt has a chance to run, so it is wise to check before adding a listener.
Document.createElementNS() - Web APIs
syntax var element = document.createelementns(namespaceuri, qualifiedname[, o
ptions]); parameters namespaceuri a string that specifies the namespace uri to associate with the element.
... o
ptionso
ptional an o
ptional elementcreationo
ptions object containing a single property named is, whose value is the tag name for a custom element previously defined using customelements.define().
...although this is not an extremely useful xul document, it does demonstrate the use of elements from two different namespaces within a single document: <?xml version="1.0"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" title="||working with elements||" onload="init()"> <scri
pt type="application/javascri
pt"><![cdata[ let container; let newdiv; let txtnode; function init(){ container = document.getelementbyid("containerbox"); newdiv = document.createelementns("http://www.w3.org/1999/xhtml", "div"); txtnode = document.createtextnode("this is text that was constructed dynamically with createelementns and createtextnode then inserted into the document using ap...
...pendchild."); newdiv.appendchild(txtnode); container.appendchild(newdiv); } ]]></scri
pt> <vbox id="containerbox" flex="1"> <html:div> the scri
pt on this page will add dynamic content below: </html:div> </vbox> </page> the example given above uses inline scri
pt which is not recommended in xhtml documents.
Document.evaluate() - Web APIs
further o
ptimization can be achieved by careful use of the context parameter.
...if the "." was left out (leaving //h2) the query would start from the root node (html) which would be more wasteful.) see introduction to using xpath in javascri
pt for more information.
... these are supported values for the resulttype parameter of the evaluate method: result type value descri
ption any_type 0 whatever type naturally results from the given expression.
...after modifying a node, attem
pting to iterate through the results will result in an error.
Document.registerElement() - Web APIs
syntax var constructor = document.registerelement(tag-name, o
ptions); parameters tag-name the name of the custom element.
... o
ptionso
ptional an object with properties prototype to base the custom element on, and extends, an existing tag to extend.
... both of these are o
ptional.
...the mytag variable holds a constructor that you can use to create a my-tag element in the document as follows: document.body.appendchild(new mytag()); this inserts an em
pty my-tag element that will be visible if you use the browser's developer tools.
Events and the DOM - Web APIs
introduction this cha
pter describes the dom event model.
... also see example 5: event propagation in the examples cha
pter for a more detailed example of how events move through the dom.
...for cross-browser compatibility, use one of the many javascri
pt libraries available.
... html attribute <button onclick="alert('hello world!')"> the javascri
pt code in the attribute is passed the event object via the event parameter.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
st of blocks: <block>⏎⇥</block> <block>◦◦hello◦◦</block> <block>⏎◦◦◦</block> <block>◦◦world!◦◦</block> <block>◦◦⏎</block> this is then simplified further by applying the processing rules for whitespace in inline formatting contexts to these blocks: <block></block> <block>hello</block> <block></block> <block>world!</block> <block></block> the 3 em
pty blocks we now have are not going to occupy any space in the final layout, because they don’t contain anything, so we’ll end up with only 2 blocks taking up space in the page.
...n the list items: li { display: inline-block; width: 2rem; height: 2rem; margin-right: -0.25rem; } you can also solve this problem by putting your list items all on the same line in the source, which causes the whitespace nodes to not be created in the first place: <li></li><li></li><li></li><li></li><li></li> dom traversal and whitespace when trying to do dom manipulation in javascri
pt, you can also encounter problems because of whitespace nodes.
... as another example, if you have a certain subset of elements that you want to do something to based on whether they are em
pty (have no child nodes) or not, you could check whether each element is em
pty using something like node.haschildnodes(), but again, if any target elements contain text nodes, you could end up with false results.
... whitespace helper functions the javascri
pt code below defines several functions that make it easier to deal with whitespace in the dom: /** * throughout, whitespace is defined as one of the characters * "\t" tab \u0009 * "\n" lf \u000a * "\r" cr \u000d * " " spc \u0020 * * this does not use javascri
pt's "\s" because that includes non-breaking * spaces (and also some other characters).
EcKeyGenParams - Web APIs
the eckeygenparams dictionary of the web cry
pto api represents the object that should be passed as the algorithm parameter into subtlecry
pto.generatekey(), when generating any elli
ptic-curve-based key pair: that is, when the algorithm is identified as either of ecdsa or ecdh.
... namedcurve a domstring representing the name of the elli
ptic curve to use.
... this may be any of the following names for nist-approved curves: p-256 p-384 p-521 examples see the examples for subtlecry
pto.generatekey().
... specifications specification status comment web cry
ptography apithe definition of 'subtlecry
pto.eckeygenparams' in that specification.
EcKeyImportParams - Web APIs
the eckeyimportparams dictionary of the web cry
pto api represents the object that should be passed as the algorithm parameter into subtlecry
pto.importkey() or subtlecry
pto.unwrapkey(), when generating any elli
ptic-curve-based key pair: that is, when the algorithm is identified as either of ecdsa or ecdh.
... namedcurve a domstring representing the name of the elli
ptic curve to use.
... this may be any of the following names for nist-approved curves: p-256 p-384 p-521 examples see the examples for subtlecry
pto.importkey().
... specifications specification status comment web cry
ptography apithe definition of 'subtlecry
pto.eckeyimportparams' in that specification.
EcdhKeyDeriveParams - Web APIs
the ecdhkeyderiveparams dictionary of the web cry
pto api represents the object that should be passed as the algorithm parameter into subtlecry
pto.derivekey(), when using the ecdh algorithm.
... public a cry
ptokey object representing the public key of the other entity.
... examples see the examples for subtlecry
pto.derivekey().
... specifications specification status comment web cry
ptography apithe definition of 'subtlecry
pto.ecdhkeyderiveparams' in that specification.
Element.outerHTML - Web APIs
exce
ptions syntaxerror an attem
pt was made to set outerhtml using an html string which is not valid.
... nomodificationallowederror an attem
pt was made to set outerhtml on an element which is a direct child of a document, such as document.documentelement.
... examples getting the value of an element's outerhtml property: html <div id="d"> <p>content</p> <p>further elaborated</p> </div> javascri
pt var d = document.getelementbyid("d"); console.log(d.outerhtml); // the string '<div id="d"><p>content</p><p>further elaborated</p></div>' // is written to the console window replacing a node by setting the outerhtml property: html <div id="container"> <div id="d">this is a div.</div> </div> javascri
pt var container = document.getelementbyid("container"); var d = document.getelementbyid("d"); console.log(container.firstchild.nodename); // logs "div" d.outerhtml = "<p>this paragraph replaced the original div.</p>"; console.log(container.firstchild.nodename); // logs "p" // the #d div is no longer part of the document tree, // the n...
...many browsers will also throw an exce
ption.
Element.scroll() - Web APIs
syntax element.scroll(x-coord, y-coord) element.scroll(o
ptions) parameters calling with coordinates x-coord the pixel along the horizontal axis of the element that you want displayed in the upper left.
... calling with o
ptions o
ptions a scrolltoo
ptions dictionary.
... examples // put the 1000th vertical pixel at the top of the element element.scroll(0, 1000); using o
ptions: element.scroll({ top: 100, left: 100, behavior: 'smooth' }); specification specification status comment css object model (cssom) view modulethe definition of 'element.scroll()' in that specification.
... 45chrome android full support 45firefox android full support 36opera android full support 32safari ios no support nosamsung internet android full support 5.0scrolltoo
ptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full support 32safari no support ...
Element.scrollTo() - Web APIs
syntax element.scrollto(x-coord, y-coord) element.scrollto(o
ptions) parameters x-coord is the pixel along the horizontal axis of the element that you want displayed in the upper left.
... - or - o
ptions is a scrolltoo
ptions dictionary.
... examples element.scrollto(0, 1000); using o
ptions: element.scrollto({ top: 100, left: 100, behavior: 'smooth' }); specifications specification status comment css object model (cssom) view modulethe definition of 'element.scrollto()' in that specification.
... 45chrome android full support 45firefox android full support 36opera android full support 32safari ios no support nosamsung internet android full support 5.0scrolltoo
ptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full support 32safari no support ...
Comparison of Event Targets - Web APIs
as the event ca
pturing and bubbling occurs, this value changes.
...ng (may contain anonymous targets)</td> </tr> </thead> <tr> <td id="target"></td> <td id="currenttarget"></td> <td id="relatedtarget"></td> <td id="explicitoriginaltarget"></td> <td id="originaltarget"></td> </tr> </table> <p>clicking on the text will show the difference between explicitoriginaltarget, originaltarget, and target</p> <scri
pt> function handleclicks(e) { document.getelementbyid('target').innerhtml = e.target; document.getelementbyid('currenttarget').innerhtml = e.currenttarget; document.getelementbyid('relatedtarget').innerhtml = e.relatedtarget; document.getelementbyid('explicitoriginaltarget').innerhtml = e.explicitoriginaltarget; document.getelementbyid('originaltarget').i...
...nnerhtml = e.originaltarget; } function handlemouseover(e) { document.getelementbyid('target').innerhtml = e.target; document.getelementbyid('relatedtarget').innerhtml = e.relatedtarget; } document.addeventlistener('click', handleclicks, false); document.addeventlistener('mouseover', handlemouseover, false); </scri
pt> </body> </html> use of target and relatedtarget the relatedtarget property for the mouseover event holds the node that the mouse was previously over.
... event type event.target event.relatedtarget mouseover the eventtarget which the pointing device entered the eventtarget which the pointing device exited mouseout the eventtarget which the pointing device exited the eventtarget which the pointing device entered todo: also needs descri
ptions for dragenter and dragexit events.
EventTarget.dispatchEvent() - Web APIs
the normal event processing rules (including the ca
pturing and o
ptional bubbling phase) also apply to events dispatched manually with dispatchevent().
... the dispatchevent() method throws unspecified_event_type_err if the event's type was not specified by initializing the event before the method was called, or if the event's type is null or an em
pty string.
... exce
ptions exce
ptions thrown by event handlers are reported as uncaught exce
ptions.
... the event handlers run on a nested callstack; they block the caller until they complete, but exce
ptions do not propagate to the caller.
FileError - Web APIs
best practices most people don't read the page on errors and exce
ptions unless they're stumped.
... error callbacks are not o
ptional for your sanity although error callbacks are o
ptional, you should include them in the arguments of the methods for the sake of the sanity of your users.
... attribute attribute type descri
ption code unsigned short the most appropriate error code for the condition.
... constant value descri
ption encoding_err 5 the url is malformed.
FileReader - Web APIs
to read files by pathname in javascri
pt, standard ajax solutions should be used to do server-side file reading, with cors permission if reading cross-domain.
... properties filereader.error read only a domexce
ption representing the error that occurred while reading the file.
...this is one of the following: em
pty 0 no data has been loaded yet.
...an o
ptional encoding name can be specified.
FileSystemDirectoryEntry - Web APIs
basic conce
pts you can create a new directory by calling getdirectory().
...port yesgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexce
ption rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox android ...
... full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexce
ption rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yesgetfile experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's input ...
...parameter is a domexce
ption rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexce
ption rather than a fileerror object.opera android no support nosafari ios full support 11...
FileSystemEntry.moveTo() - Web APIs
you can only overwrite a directory if it's em
pty.
... newname o
ptional if this parameter is provided, the entry is renamed to have this string as its new file or directory name.
... successcallback o
ptional a function which is called when the move operation is succesfully completed.
... errorcallback o
ptional an o
ptional callback which is executed if an error occurs while moving the items.
FileSystemFlags.exclusive - Web APIs
the exclusive property on the filesystemflags dictionary is used in tandem with the create property to determine whether or not it's acce
ptable to require that the file not already exist when the reference to it is created by calling filesystemdirectoryentry.getfile() or filesystemdirectoryentry.getdirectory().
... o
ption values file/directory condition result create exclusive false n/a[1] path exists and matches the desired type (depending on whether the function called is getfile() or getdirectory() the successcallback is called with a filesystemfileentry if getfile() was called or a filesystemdirectoryentry if getdirectory() was called.
...this o
ption has no effect.ie no support noopera no support nosafari no support nowebview android full support yesprefixed full support yesprefixed prefixed implemented with the vendo...
...this o
ption has no effect.opera android no support nosafari ios no support nosamsung internet android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitlegend ...
FileHandle API - Web APIs
var idbreq = indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); buildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two arguments: a name and an o
ptional type.
... both of these are just descri
ptive and are not used by the database.
...that said, as the name does not match any real filename it can be an em
pty string, for example, and it doesn't even have to be unique.
...any attem
pt to perform a write action on a readonly lockedfile object will fail.
Using FormData Objects - Web APIs
uild 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]); // javascri
pt file-like object var content = '<a id="a"><b id="b">hey!</b></a>'; // the body of the new file...
...blobs represent data that isn't necessarily in a javascri
pt-native format.
... you can also append a file or blob directly to the formdata object, like this: data.append("myfile", myblob, "filename.txt"); when using the append() method it is possible to use the third o
ptional parameter to pass a filename inside the content-disposition header that is sent to the server.
... typically this is used as shown in our simple formdata event demo — in the javascri
pt we reference a form: const formelem = document.queryselector('form'); in our submit event handler we use preventdefault to stop the default form submission, then invoke a formdata constructor to trigger the formdata event: formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata even...
GlobalEventHandlers - Web APIs
properties this interface doesn't include any properties exce
pt for the event handlers listed below.
... globaleventhandlers.onem
ptied is an eventhandler representing the code to be called when the em
ptied event is raised.
... globaleventhandlers.ongotpointerca
pture is an eventhandler representing the code to be called when the gotpointerca
pture event type is raised.
... globaleventhandlers.onloadend is an eventhandler representing the code to be called when the loadend event is raised (when progress has stopped on the loading of a resource.) globaleventhandlers.onloadstart is an eventhandler representing the code to be called when the loadstart event is raised (when progress has begun on the loading of a resource.) globaleventhandlers.onlostpointerca
pture is an eventhandler representing the code to be called when the lostpointerca
pture event type is raised.
HTMLCanvasElement.getContext() - Web APIs
contextattributes you can use several context attributes when creating your rendering context, for example: const gl = canvas.getcontext('webgl', { antialias: false, de
pth: false }); 2d context attributes: alpha: boolean that indicates if the canvas contains an alpha channel.
...this o
ption is only available, if the flag gfx.canvas.willreadfrequently.enable is set to true (which, by default, is only the case for b2g/firefox os).
... de
pth: boolean that indicates that the drawing buffer has a de
pth buffer of at least 16 bits.
... "high-performance": prioritizes rendering performance over power consum
ption.
HTMLCanvasElement.toDataURL() - Web APIs
syntax canvas.todataurl(type, encodero
ptions); parameters type o
ptional a domstring indicating the image format.
... encodero
ptions o
ptional a number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp.
... exce
ptions securityerror the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded.
...color in this example): html <img class="grayscale" src="mypicture.png" alt="descri
ption of my picture" /> javascri
pt window.addeventlistener('load', removecolors); function showcolorimg() { this.style.display = 'none'; this.nextsibling.style.display = 'inline'; } function showgrayimg() { this.previoussibling.style.display = 'inline'; this.style.display = 'none'; } function removecolors() { var aimages = document.getelementsbyclassname('grayscale'), nimgslen =...
HTMLDialogElement.showModal() - Web APIs
exce
ptions if the dialog is already open (i.e.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <o
ption></o
ption> <o
ption>brine shrimp</o
ption> <o
ption>red panda</o
ption> <o
ption>spider monkey</o
ption> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu>...
... <scri
pt> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </sc...
...ri
pt> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement - Web APIs
an o
ptional domstring may be passed as an argument, updating the returnvalue of the the dialog.
... <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <o
ption></o
ption> <o
ption>brine shrimp</o
ption> <o
ption>red panda</o
ption> <o
ption>spider monkey</o
ption> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu>...
... <scri
pt> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </sc...
...ri
pt> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLInputElement.setSelectionRange() - Web APIs
o
ptionally, in newer browser versions, you can specify the direction in which selection should be considered to have occurred.
...chrome, starting from version 33, throws an exce
ption while accessing those properties and method on the rest of input types.
... selectiondirection o
ptional a string indicating the direction in which the selection is considered to have been performed.
... html <input type="text" id="text-box" size="20" value="mozilla"> <button onclick="selecttext()">select text</button> javascri
pt function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setselectionrange(2, 5); } result specifications specification status comment html living standardthe definition of 'htmlinputelement.setselectionrange()' in that specification.
HTMLInputElement.stepDown() - Web APIs
if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exce
ption is thrown.
...throws an invalid_state_err exce
ption: if the method is not applicable to for the current type value, if the element has no step value, if the value cannot be converted to a number, if the resulting value is above the max or below the min.
... syntax element.stepdown( [ stepdecrement ] ); parameters stepdecrement the o
ptional stepdecrement paremeter is a numeric value.
...ml <p> <label>enter a number between 0 and 400 that is divisible by 5: <input type="number" step="5" id="thenumber" min="0" max="400"> </label> </p> <p> <label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="decrementer" min="-2" max="15"> </label> </p> <input type="button" value="decrement" id="thebutton"> javascri
pt /* make the button call the function */ let button = document.getelementbyid('thebutton'); button.addeventlistener('click', function() { stepondown();} ); function stepondown() { let input = document.getelementbyid('thenumber'); let val = document.getelementbyid('decrementer').value; if (val) { /* increment with a parameter */ input.stepdown(val); } else { /* or without a par...
HTMLElement.focus() - Web APIs
syntax element.focus(o
ptions); // object parameter parameters o
ptions o
ptional an o
ptional object providing o
ptions to control aspects of the focusing process.
... this object may contain the following property: preventscroll o
ptional a boolean value indicating whether or not the browser should scroll the document to bring the newly-focused element into view.
... examples focus on a text field javascri
pt focusmethod = function getfocus() { document.getelementbyid("mytextfield").focus(); } html <input type="text" id="mytextfield" value="text field."> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the text field!</button> result focus on a button javascri
pt focusmethod = function getfocus() { document.getelementbyid("mybutton").focus(); } html <button type="button" id="mybutton">click me!</button> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the button!</button> result...
... focus with focuso
ption javascri
pt focusscrollmethod = function getfocus() { document.getelementbyid("mybutton").focus({preventscroll:false}); } focusnoscrollmethod = function getfocuswithoutscrolling() { document.getelementbyid("mybutton").focus({preventscroll:true}); } html <button type="button" onclick="focusscrollmethod()">click me to focus on the button!</button> <button type="button" onclick="focusnoscrollmethod()">click me to focus on the button without scrolling!</button> <div id="container" style="height: 1000px; width: 1000px;"> <button type="button" id="mybutton" style="margin-top: 500px;">click me!</button> </div> result specification specification status comment html living standardthe definition of 'focus' in...
HTMLOutputElement - Web APIs
htmloutputelement.defaultvalue a domstring representing the default value of the element, initially the em
pty string.
...this is the em
pty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints.
...if the element is not rendered, then the user agent may report the error for the running scri
pt instead of notifying the user.
...if this message is not the em
pty string, then the element is suffering from a custom validity error, and does not validate.
HTMLSelectElement.item() - Web APIs
the htmlselectelement.item() method returns the element corresponding to the htmlo
ptionelement whose position in the o
ptions list corresponds to the index given in the parameter, or null if there are none.
... in javascri
pt, using the array bracket syntax with an unsigned long, like selectelt[index] is equivalent to selectelt.nameditem(index).
... return value item is a htmlo
ptionelement.
... examples html <form> <select id="myformcontrol" type="textarea"> <o
ption id="o1">o
pt 1</o
ption> <o
ption id="o2">o
pt 2</o
ption> </select> </form> javascri
pt // returns the htmlo
ptionelement representing #o2 elem1 = document.forms[0]['myformcontrol'][1]; specifications specification status comment html living standardthe definition of 'htmlselectelement.item()' in that specification.
HTMLSelectElement.namedItem() - Web APIs
the htmlselectelement.nameditem() method returns the htmlo
ptionelement corresponding to the htmlo
ptionelement whose name or id match the specified name, or null if no o
ption matches.
... in javascri
pt, using the array bracket syntax with a string, like selectelt["value"] is equivalent to selectelt.nameditem("value").
... return value item is a htmlo
ptionelement.
... example html <form> <select id="myformcontrol"> <o
ption id="o1">o
pt 1</o
ption> <o
ption id="o2">o
pt 2</o
ption> </select> </form> javascri
pt elem1 = document.forms[0]['myformcontrol']['o1']; // returns the htmlo
ptionelement representing #o1 specifications specification status comment html living standardthe definition of 'htmlselectelement.nameditem()' in that specification.
HTMLTableCellElement - Web APIs
the em
pty string ("") the header cell has no predefined scope; the user agent will establish the scope based on contextual clues.
...this property was o
ptional and was not very well supported.
... htmltablecellelement.choff a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scri
pts; or at the left for right-to-left scri
pts) of the character defined by htmltablecellelement.ch.
... this property was o
ptional and was not very well supported.
KeyframeEffect.setKeyframes() - Web APIs
if set to null, the keyframes are replaced with a sequence of em
pty keyframes.
...any easing value specified on the o
ptions argument, however, applies across a single iteration of the animation — for the entire duration.
... two exce
ptional css properties are: float, which must be written as cssfloat since "float" is a reserved word in javascri
pt.
... exce
ptions exce
ption explanation typeerror one or more of the frames were not of the correct type of object, the keyframes were not loosely sorted by offset, or a keyframe existed with an offset of less than 0 or more than 1.
MSSiteModeEvent - Web APIs
dom information inheritance hierarchy event mssitemodeevent methods method descri
ption initevent initializes a new generic event that the createevent method created.
... properties property descri
ption actionurl gets the url of a jump list item that is removed.
... *this property is not supported for windows store apps using javascri
pt.
...*this property is not supported for windows store apps using javascri
pt.
MediaDeviceInfo.deviceId - Web APIs
specifications specification status comment media ca
pture and streamsthe definition of 'deviceid' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdeviceidchrome full support 55notes full support 55notes notes for earlier versions, this interface is available through the ada
pter.js polyfilledge full support 12firefox full support 39ie no support noopera no support nonotes no support nonotes notes this property can be used in opera by using the ada...
...
pter.js polyfill.safari no support nowebview android full support 55notes full support 55notes notes for earlier versions, this interface is available through the ada
pter.js polyfillchrome android full support 55notes full support 55notes notes for earlier versions, this interface is available through the ada
pter.js polyfillfirefox android full support 39opera android no support nonotes no support nonotes notes this property can be use...
...d in opera by using the ada
pter.js polyfill.safari ios no support nosamsung internet android full support 6.0notes full support 6.0notes notes for earlier versions, this interface is available through the ada
pter.js polyfilllegend full support full support no support no supportsee implementation notes.see implementation notes.
MediaDeviceInfo.kind - Web APIs
specifications specification status comment media ca
pture and streamsthe definition of 'kind' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkindchrome full support 55notes full support 55notes notes for earlier versions, this interface is available through the ada
pter.js polyfilledge full support 12firefox full support 39ie no support noopera no support nonotes no support nonotes notes this property can be used in opera by using the ada...
...
pter.js polyfill.safari no support nowebview android full support 55notes full support 55notes notes for earlier versions, this interface is available through the ada
pter.js polyfillchrome android full support 55notes full support 55notes notes for earlier versions, this interface is available through the ada
pter.js polyfillfirefox android full support 39opera android no support nonotes no support nonotes notes this property can be use...
...d in opera by using the ada
pter.js polyfill.safari ios no support nosamsung internet android full support 6.0notes full support 6.0notes notes for earlier versions, this interface is available through the ada
pter.js polyfilllegend full support full support no support no supportsee implementation notes.see implementation notes.
MediaDevices.ondevicechange - Web APIs
syntax mediadevices.ondevicechange = eventhandler; value a function you provide which acce
pts as input a event object describing the devicechange event that occurred.
...black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } h2 { margin-bottom: 4px; } .left { float:left; width: 48%; margin-right: 2% } .right { float:right; width: 48%; margin-left: 2% } .devicelist { border: 1px solid black; list-style-type: none; margin-top: 2px; padding: 6px; } javascri
pt content other code below is other code which, while needed to make this example work, isn'tt related directly to ondevicechange, so we won't go into any detail.
...this uses destructuring assignment (a new feature of ecmascri
pt 6) to assign the values of the first three items in the array returned by string.match() to the variables kind, type, and direction.
... result specifications specification status comment media ca
pture and streamsthe definition of 'ondevicechange' in that specification.
MediaDevices - Web APIs
see capabilities and constraints in media ca
pture and streams api (media stream) to learn more about constraints and how to use them.
... getdisplaymedia() prom
pts the user to select a display or portion of a display (such as a window) to ca
pture as a mediastream for sharing or recording purposes.
... getusermedia() with the user's permission through a prom
pt, turns on a camera and/or a microphone on the system and provides a mediastream containing a video track and/or an audio track with the input.
...hone, you need to allow the page access to your devices in ' + 'order for the demo to work.'); } errormsg('getusermedia error: ' + error.name, error); }); function errormsg(msg, error) { errorelement.innerhtml += '<p>' + msg + '</p>'; if (typeof error !== 'undefined') { console.error(error); } } specifications specification status comment media ca
pture and streamsthe definition of 'mediadevices' in that specification.
MediaError.message - Web APIs
the read-only property mediaerror.message returns a domstring which contains a human-readable string offering specific diagnostic details related to the error described by the mediaerror object, or an em
pty string ("") if no diagnostic information can be determined or provided.
...this is not simply a generic descri
ption of the mediaerror.code property's value, but instead goes deeper into the specifics of this particular error and its circumstances.
... if no specific details are available, this string is em
pty.
... the error's code attribute is checked to determine a generic error message to display, and, if message is not em
pty, it's appended to provide additional details.
MediaKeys - Web APIs
the mediakeys interface of encry
ptedmediaextensions api represents a set of keys that an associated htmlmediaelement can use for decry
ption of media data during playback.
... methods mediakeys.createsession() returns a new mediakeysession object, which represents a context for message exchange with a content decry
ption module (cdm).
... mediakeys.setservercertificate() returns a promise to a server certificate to be used to encry
pt messages to the license server.
... examples //tbd specifications specification status comment encry
pted media extensionsthe definition of 'mediakeys' in that specification.
MediaRecorder.requestData() - Web APIs
the mediarecorder.requestdata() method (part of the mediarecorder api) is used to raise a dataavailable event containing a blob object of the ca
ptured media as it was when the method was called.
... raise a dataavailable event containing a blob of the currently ca
ptured data (the blob is available under the event's data attribute.) create a new blob and place subsequently ca
ptured data into it.
... syntax mediarecorder.requestdata() errors an invalidstate error is raised if the requestdata() method is called while the mediarecorder object’s mediarecorder.state is not "recording" — the media cannot be ca
ptured if recording is not occurring.
... ca
pturemedia.onclick = function() { mediarecorder.requestdata(); // makes snapshot available of data so far // ondataavailable fires, then ca
pturing continues // in new blob } ...
MediaSession.setPositionState() - Web APIs
syntax navigator.mediasession.setpositionstate(statedict); parameters statedict o
ptional an object conforming to the mediapositionstate dictionary, providing updated information about the playback position and speed of the document's ongoing media.
... if the object is em
pty, the existing playback state information is cleared.
... exce
ptions typeerror this error can occur in an array of circumstances: the specified mediapositionstate object's duration is missing, negative, or null.
... example in this example, a player for a non-standard media file format, written in javascri
pt, uses setinterval() to establish a callback which fires once per second to refresh the position information by calling setpositionstate().
MediaSource.endOfStream() - Web APIs
syntax mediasource.endofstream(endofstreamerror); parameters endofstreamerror o
ptional a domstring representing an error to throw when the end of the stream is reached.
...when you make an xmlhttprequest call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descri
ptive message in the ui, and maybe retry the network request immediately or wait until the network is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured.
... this can be used to indicate that a parsing error has occured while fetching media data; maybe the data is corru
pt, or is encoded using a codec that the browser doesn't know how to decode.
... return value undefined exce
ptions exce
ption explanation invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e.
MediaStream.onaddtrack - Web APIs
this event is fired when the browser adds a track to the stream (such as when a rtcpeerconnection is renegotiated or a stream being ca
ptured using htmlmediaelement.ca
pturestream() gets a new set of tracks because the media element being ca
ptured loaded a new source.
... the addtrack event does not get fired when javascri
pt code explicitly adds tracks to the stream (by calling addtrack()).
... syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you provide that acce
pts as input a mediastreamtrackevent object representing the addtrack event which has occurred.
... stream.onaddtrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = event.track.kind + ": " + event.track.label; tracklist.appendchild(label); }; specifications specification status comment media ca
pture and streamsthe definition of 'mediastream.onaddtrack' in that specification.
MediaStream.onremovetrack - Web APIs
this event is fired when the browser removes a track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being ca
ptured using htmlmediaelement.ca
pturestream() gets a new set of tracks because the media element being ca
ptured loaded a new source.
... the removetrack event does not get fired when javascri
pt code explicitly removes tracks from the stream (by calling removetrack()).
... syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you provide that acce
pts as input a mediastreamtrackevent object representing the removetrack event which has occurred.
... stream.onremovetrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = "removed: " + event.track.kind + ": " + event.track.label; tracklist.appendchild(label); }; specifications specification status comment media ca
pture and streamsthe definition of 'mediastream.onremovetrack' in that specification.
MediaStreamAudioSourceNode() - Web APIs
syntax audiosourcenode = new mediastreamaudiosourcenode(context, o
ptions); parameters context an audiocontext representing the audio context you want the node to be associated with.
... o
ptions a mediastreamaudiosourceo
ptions object defining the properties you want the mediastreamaudiosourcenode to have: mediastream a required property which specifies the mediastream from which to obtain audio for the node.
... exce
ptions invalidstateerror the specified mediastream doesn't have any audio tracks.
...ne variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // getusermedia block - grab stream // put it into a mediastreamaudiosourcenode if (navigator.mediadevices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints: audio and video for this app { audio: true, video: false }).then(function(stream) { var o
ptions = { mediastream : stream } var source = new mediastreamaudiosourcenode(audioctx, o
ptions); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status ...
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the ca
ptured video.
... let displaymediao
ptions = { cursor: "always" }; example: cursor visible during motion with fallback in this example, the cursor property is configured to request that the cursor be visible when in motion, falling back to always being visible if the user agent doesn't support in-motion only cursor rendering.
... let displaymediao
ptions = { cursor: ["motion", "always"] }; example: require that the cursor not be visible this constraints object explicitly requires that the cursor not be rendered into the video track.
... let displaymediao
ptions = { cursor: { exact: "none" } }; specifications specification status comment screen ca
pturethe definition of 'mediatrackconstraints.cursor' in that specification.
MediaTrackConstraints.latency - Web APIs
syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the acce
ptable or required value(s) for an audio track's latency, with values specified in seconds.
...in most cases, low latency is desirable for performance and user experience purposes, but when power consum
ption is a concern, or delays are otherwise acce
ptable, higher latency might be acce
ptable.
... if this property's value is a number, the user agent will attem
pt to obtain media whose latency tends to be as close as possible to this number given the capabilities of the hardware and the other constraints specified.
... specifications specification status comment media ca
pture and streamsthe definition of 'latency' in that specification.
MediaTrackSupportedConstraints.logicalSurface - Web APIs
example this method sets up the constraints object specifying the o
ptions for the call to getdisplaymedia().
... it adds the logicalsurface constraint (requesting that only logical display surfaces—those which may not be entirely visible onscreen—be included among the o
ptions available to the user) only if it is known to be supported by the browser.
... ca
pturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
... async function ca
pture() { let supportedconstraints = navigator.mediadevices.getsupportedconstraints(); let displaymediao
ptions = { video: { }, audio: false; }; if (supportedconstraints.logicalsurface) { displaymediao
ptions.video.logicalsurface = "monitor"; } try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediao
ptions); } catch(err) { /* handle the error */ } } specifications specification status comment screen ca
pturethe definition of 'mediatracksupportedconstraints.logicalsurface' in that specification.
Using the Media Capabilities API - Web APIs
support for getting real-time feedback about the playback of media, so your code can make informed decisions about ada
pting the stream's quality or other settings to manage the user's perceived media performance and quality.
...en( console.log('it worked') ).catch(error => console.log('it failed: ' + error) ); media capabilities live example css li { margin : 1em; } html <form> <p>select your video configuration and find out if this browser supports the codec, and whether decoding will be smooth and power efficient:</p> <ul> <li> <label for="codec">select a codec</label> <select id="codec"> <o
ption>video/webm; codecs=vp8</o
ption> <o
ption>video/webm; codecs=vp9</o
ption> <o
ption>video/mp4; codecs=avc1</o
ption> <o
ption>video/mp4; codecs=avc1.420034</o
ption> <o
ption>video/ogg; codecs=theora</o
ption> <o
ption>invalid</o
ption> </select> </li> <li> <label for="size">select a size</label> <select id="size"> <o
ption>7680x4320</o
ption> <o
pti...
...on>3840x2160</o
ption> <o
ption>2560x1440</o
ption> <o
ption>1920x1080</o
ption> <o
ption>1280x720</o
ption> <o
ption selected>800x600</o
ption> <o
ption>640x480</o
ption> <o
ption>320x240</o
ption> <o
ption value=" x ">none</o
ption> </select> </li> <li> <label for="framerate">select a framerate</label> <select id="framerate"> <o
ption>60</o
ption> <o
ption>50</o
ption> <o
ption>30</o
ption> <o
ption>24</o
ption> <o
ption selected>15</o
ption> </select> </li> <li> <label for="bitrate">select a bitrate</label> <select id="bitrate"> <o
ption>4000</o
ption> <o
ption>2500</o
ption> <o
ption>800</o
ption> </select> </li> </ul> <p><input type="button" value="test this video configuration" id="tr...
...yit"></p> </form> <ul id="results"></ul> javascri
pt let mc = { videoconfiguration : new object(), tryit: function () { mc.createconfiguration(); mc.testit(); }, createconfiguration: function () { var size = document.getelementbyid('size').value.split('x'); mc.videoconfiguration = { type: 'file', video: { contenttype: document.getelementbyid('codec').value, width: size[0], height: size[1], bitrate: document.getelementbyid('bitrate').value, framerate: document.getelementbyid('framerate').value, } } }, testit: function () { let content = ''; navigator.mediacapabilities.decodinginfo(mc.videoconfiguration).then(result => { var li = document.createelement('li'), mcv = mc.videoconfigu...
Media Capabilities API - Web APIs
the media capabilities api allows developers to determine decoding and encoding abilities of the device, exposing information such as whether media is supported and whether playback should be smooth and power efficient, with real time feedback about playback to better enable ada
ptive streaming, and access to display property information.
...'' : 'not ') + 'power efficient.') }) .catch(() => { console.log("decodinginfo error: " + contenttype) }); } media capabilities api conce
pts and usage there are a myriad of video and audio codecs.
... media capabilities information enables websites to enable ada
ptative streaming to alter the quality of content based on actual user-perceived quality, and react to a pick of cpu/gpu usage in real time.
...the information can be used to serve o
ptimal media streams to the user and determine if playback should be smooth and power efficient .
MessageEvent.MessageEvent() - Web APIs
this can be one of xxx init o
ptional a dictionary object that can contain the following properties: data: the data you want contained in the messageevent.
...this defaults to an em
pty string ("") if not specified.
...this defaults to an em
pty string ("") if not specified.
...this defaults to an em
pty array ([]) if not specified.
MessageEvent - Web APIs
examples in our basic shared worker example (run shared worker), we have two html pages, each of which uses some javascri
pt to perform a simple calculation.
... the different scri
pts are using the same worker file to perform the calculation — they can both access it, even if their pages are running inside different windows.
...both scri
pts contain this: var myworker = new sharedworker('worker.js'); both scri
pts then access the worker through a messageport object created using the sharedworker.port property.
... if the onmessage event is attached using addeventlistener, the port is manually started using its start() method: myworker.port.start(); when the port is started, both scri
pts post messages to the worker and handle messages sent from it using port.postmessage() and port.onmessage, respectively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed abov...
MimeType - Web APIs
mimetype.descri
ption returns a descri
ption of the associated plugin or an em
pty string if there is none.
... mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an em
pty string if an extension is not valid for the particular module.
... for example, a browser's content decry
ption module may appear in the plugin list but support more file extensions than can be anticipated.
... it might therefore return an em
pty string.
msPlayToSource - Web APIs
syntax
ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio, video, and img elements to a remote device.
... example <video id="videoplayer" src="http://www.contoso.com/clip.mp4" controls autoplay /> <scri
pt type="text/javascri
pt"> // step 1: obtain playtomanager object for app’s current view.
... var
ptm = windows.media.playto.playtomanager.getforcurrentview(); // step 2: register for the sourcerequested event (user swipes devices charm).
...
ptm.addeventlistener("sourcerequested", function(e) { // step 3: specify the media to be streamed (to filter devices).
MutationObserver.MutationObserver() - Web APIs
syntax const observer = new mutationobserver(callback) parameters callback a function which will be called on each dom change that qualifies given the observed node or subtree and o
ptions.
... const targetnode = document.queryselector("#someelement"); const observero
ptions = { childlist: true, attributes: true, // omit (or set to false) to observe only changes to the parent node subtree: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observero
ptions); the desired subtree is located by finding an element with the id someelement.
... a set of o
ptions for the observer is also established in the observero
ptions record.
...we begin observing the dom nodes of interest by calling observe(), specifying the target node and the o
ptions object.
MutationObserverInit.attributeOldValue - Web APIs
the mutationobserverinit dictionary's o
ptional attributeoldvalue property is used to specify whether or not to record the prior value of the altered attribute in mutationrecord objects denoting attribute value changes.
... syntax var o
ptions = { attributeoldvalue: true | false } value a boolean value indicating whether or not the prior value of a changed attribute should be included in the mutationobserver.oldvalue property when reporting attribute value changes.
... when using attributeoldvalue, setting the attributes o
ption to true is o
ptional.
... when observe() is called, the specified o
ptions are attributes and attributeoldvalue, which means that changes to attribute values will be reported, and each mutation record will include the oldvalue property specifying the attribute's previous value.
MutationObserverInit.attributes - Web APIs
the mutationobserverinit dictionary's o
ptional attributes property is used to specify whether or not to watch for attribute value changes on the node or nodes being observed.
... syntax var o
ptions = { attributes: true | false } value a boolean value indicating whether or not to report through the callback any changes to the values of attributes on the node or nodes being monitored.
... you can expand the capabilities of attribute mutation monitoring using other o
ptions: attributefilter lets you specify specific attribute names to monitor instead of monitoring all attributes.
... when observe() is called, the specified o
ptions are attributes and attributeoldvalue, which means that changes to attribute values will be reported, and each mutation record will include the oldvalue property specifying the attribute's previous value.
Web-based protocol handlers - Web APIs
when a browser executes this code, it should display a prom
pt to the user, asking permission to allow the web application to register as a handler for the protocol.
... firefox displays a prom
pt in the notification bar area: note:the url template supplied when registering must be of the same domain as the webpage attem
pting to perform the registration or the registration will fail.
... example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - register</title> <scri
pt type="text/javascri
pt"> navigator.registerprotocolhandler("web+burger", "http://www.google.co.uk/?uri=%s", "burger handler"); </scri
pt> </head> <body> <h1>web protocol handler sample</h1> <p>this web page will install a web protocol handler for the <code>web+burger:</code> protocol.</p> </body> </html> activating now...
...firefox will, by default, prom
pt the user before handing off the action.
Navigator.registerProtocolHandler() - Web APIs
this will be displayed to the user, such as prom
pting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings.
...it is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still acce
pt the title (but not use it).
... exce
ptions securityerror the user agent blocked the registration.
... this scri
pt must be run from the same origin as the handler url (so any page at https://burgers.example.com), and the handler url must be http or https.
Node.cloneNode() - Web APIs
deep o
ptional* if true, then node and its whole subtree—including text that may be in child text nodes—is also copied.
... deep has no effect on em
pty elements (such as the <img> and <input> elements).
... *note: in the dom4 specification (since gecko 13.0 (firefox 13 / thunderbird 13 / seamonkey 2.10)), the o
ptional deep argument defaults to true.
...although deep it still o
ptional, it now defaults to false.
Node.nextSibling - Web APIs
see whitespace in the dom and w3c dom 3 faq: why are some text nodes em
pty?
... example <div id="div-1">here is div-1</div> <div id="div-2">here is div-2</div> <scri
pt> var el = document.getelementbyid('div-1').nextsibling, i = 1; console.group('siblings of div-1:'); while (el) { console.log(i, '.
... ', el.nodename); el = el.nextsibling; i++; } console.groupend(); </scri
pt> /************************************************** the console displays the following: siblings of div-1 1.
...scri
pt **************************************************/ in the above example, #text nodes are inserted in the dom where whitespace occurs between tags (i.e.
NodeIterator.filter - Web APIs
the nodeiterator.filter read-only method returns a nodefilter object, that is an object implement an acce
ptnode(node) method, used to screen nodes.
... when creating the nodeiterator, the filter object is passed in as the third parameter, and the object method acce
ptnode(node) is called on every single node to determine whether or not to acce
pt it.
... this function should return the constant nodefilter.filter_acce
pt for cases when the node should be acce
pted and nodefilter.filter_reject for cases when the node should be rejected.
... syntax nodefilter = nodeiterator.filter; example const nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acce
ptnode: function(node) { return nodefilter.filter_acce
pt; } }, false ); nodefilter = nodeiterator.filter; specifications specification status comment domthe definition of 'nodeiterator.filter' in that specification.
NodeList.prototype.forEach() - Web APIs
it acce
pts 3 parameters: currentvalue the current element being processed in somenodelist.
... currentindex o
ptional the index of the currentvalue being processed in somenodelist.
... listobj o
ptional the somenodelist that foreach() is being applied to.
... thisarg o
ptional value to use as this when executing callback.
Notification.dir - Web APIs
the dir read-only property of the notification interface indicates the text direction of the notification, as specified in the dir o
ption of the notification() constructor.
...possible values are: auto: ado
pts the browser's language setting behaviour (the default.) ltr: left to right.
... examples the following snippet fires a notification; a simple o
ptions object is created, then the notification is fired using the notification() constructor.
... var o
ptions = { body: 'do you like my body?', dir: 'rtl' } var n = new notification('test notification',o
ptions); console.log(n.dir) // should return 'rtl' specifications specification status comment notifications apithe definition of 'dir' in that specification.
OscillatorNode.OscillatorNode() - Web APIs
the oscillatornode() constructor of the web audio api creates a new oscillatornode object which is an audionode that represents a periodic waveform, like a sine wave, o
ptionally setting the node's properties' values to match values in a specified object.
... if the default values of the properties are acce
ptable, you can o
ptionally use the audiocontext.createoscillator() factory method instead.
... syntax var oscillatornode = new oscillatornode(context, o
ptions) parameters inherits parameters from the audionodeo
ptions dictionary.
... o
ptions o
ptional an object whose properties specify the initial values for the oscillator node's properties.
PaymentAddress - Web APIs
the exact size and content varies by country or location and can include, for example, a street name, house number, apartment number, rural delivery route, descri
ptive instructions, or post office box number.
... note: properties for which values were not specified contain em
pty strings.
... examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping o
ptions), and an o
ptional object containing further o
ptions.
... const supportedinstruments = [ { supportedmethods: "basic-card", }, ]; const details = { total: { label: "donation", amount: { currency: "usd", value: "65.00" } }, displayitems: [ { label: "original donation amount", amount: { currency: "usd", value: "65.00" }, }, ], shippingo
ptions: [ { id: "standard", label: "standard shipping", amount: { currency: "usd", value: "0.00" }, selected: true, }, ], }; const o
ptions = { requestshipping: true }; async function dopaymentrequest() { const request = new paymentrequest(supportedinstruments, details, o
ptions); // add event listeners here.
PaymentValidationErrors - Web APIs
properties error o
ptional a general descri
ption of a payment error from which the user may attem
pt to recover by retrying the payment, possibly after correcting mistakes in the payment information.
... payer o
ptional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation.
... paymentmethod o
ptional any payment method specific errors which may have occurred.
... shippingaddress o
ptional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation.
Payment Request API - Web APIs
payment request conce
pts and usage many problems related to online shopping-cart abandonment can be traced to checkout forms, which can be difficult and time consuming to fill out and often require multiple steps to complete.
...the browser can automatically suggest which card to use based on past usage patterns or restrictions from the merchant (e.g, "we only acce
pt visa or mastercard"), or allow the user to say which is their default/favorite card.
... dictionaries addresserrors a dictionary containing strings providing descri
ptive explanations of any errors in any paymentaddress entries which have errors.
... payererrors a dictionary containing strings providing descri
ptive explanations of any errors in related to paymentresponse's email, phone, and name attributes.
PerformanceObserver.observe() - Web APIs
syntax observer.observe(o
ptions); parameters o
ptions a performanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one performance entry type to observe.
... may not be used together with the "type" or "buffered" o
ptions.
... may not be used together with the entrytypes o
ption.
... must be used only with the "type" o
ption.
PerformanceTiming - Web APIs
the performancetiming interface is a legacy interface ke
pt for backwards compatibility and contains properties that offer performance timing information for various events which occur during the loading and use of the current page.
... performancetiming.navigationstart read only when the prom
pt for unload terminates on the previous document in the same browsing context.
... performancetiming.domcontentloadedeventstart read only right before the parser sent the domcontentloaded event, that is right after all the scri
pts that need to be executed right after parsing have been executed.
... performancetiming.domcontentloadedeventend read only right after all the scri
pts that need to be executed as soon as possible, in order or not, have been executed.
Permissions.revoke() - Web APIs
the permissions.revoke() method of the permissions interface reverts a currently set permission back to its default state, which is usually prom
pt.
... var revokepromise = navigator.permissions.revoke(descri
ptor); parameters descri
ptor an object based on the permissiondescri
ptor dictionary that sets o
ptions for the operation consisting of a comma-separated list of name-value pairs.
... the available o
ptions are: name: the name of the api whose permissions you want to query.
... exce
ptions typeerror retrieving the permissiondescri
ptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g.
PluginArray - Web APIs
the pluginarray is not a javascri
pt array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods.
... pluginarray.refresh refreshes all plugins on the current page, o
ptionally reloading documents.
... var pluginslength = navigator.plugins.length; document.body.innerhtml = pluginslength + " plugin(s)<br>" + '<table id="plugintable"><thead>' +'<tr><th>name</th><th>filename</th><th>descri
ption</th><th>version</th></tr>' +'</thead><tbody></tbody></table>'; var table = document.getelementbyid('plugintable'); for(var i = 0; i < pluginslength; i++) { let newrow = table.insertrow(); newrow.insertcell().textcontent = navigator.plugins[i].name; newrow.insertcell().textcontent = navigator.plugins[i].filename; newrow.insertcell().textcontent = navigator.plugins[i].descri
ption; newrow.insertcell().textcontent = navigator.plugins[i].version?navigator.plugins[i].version:""; } the following...
... var pluginslength = navigator.plugins.length; document.write( pluginslength.tostring() + " plugin(s)<br>" + "name | filename | descri
ption<br>" ); for(var i = 0; i < pluginslength; i++) { document.write( navigator.plugins[i].name + " | " + navigator.plugins[i].filename + " | " + navigator.plugins[i].descri
ption + " | " + navigator.plugins[i].version + "<br>" ); } specifications specification status comment html living standardthe definition of 'pluginarray' in that specification.
PromiseRejectionEvent() - Web APIs
the promiserejectionevent() constructor returns a newly created promiserejectionevent, which represents events fired when a javascri
pt promise is rejected.
... there are two types of promiserejectionevent: unhandledrejection is sent by the javascri
pt runtime when a promise is rejected but the rejection goes unhandled.
... syntax promiserejectionevent = promiserejectionevent(type, o
ptions); parameters the promiserejectionevent() constructor also inherits parameters from event().
... o
ptions an object specifying details about the rejection which occurred: promise the promise that was rejected.
PromiseRejectionEvent - Web APIs
the promiserejectionevent interface represents events which are sent to the global scri
pt context when javascri
pt promises are rejected.
... promiserejectionevent.promise read only the javascri
pt promise that was rejected.
... events rejectionhandled fired when a javascri
pt promise is rejected, and after the rejection is handled by the promise's rejection handling code.
... unhandledrejection fired when a javascri
pt promise is rejected but there is no rejection handler to deal with the rejection.
PublicKeyCredential.getClientExtensionResults() - Web APIs
during the creation or fetching of a publickeycredential (respectively via navigator.credentials.create() and navigator.credentials.get()), it is possible to have "custom" processing by the client for different extensions which are respectively given by publickeycredentialcreationo
ptions.extensions and publickeycredentialrequesto
ptions.extensions.
... note: extensions are o
ptional and different browsers may recognize different extensions.
... all extensions are o
ptional for the client to process them: if a browser does not know of a given extension, that will not cause any failure.
...as of march 2019, only appid (used during creation with publickeycredentialrequesto
ptions.extensions) is supported by chrome and edge.
Web Push API Notifications best practices - Web APIs
after a few failed attem
pts to get your attention, they send you an email, and your email app produces a push notification that successfully alerts you, even though your mail web app is not open.
...every push notification should be useful and time-sensitive, and the user should always be asked for permission before sending the first one, and be offered an easy way to o
pt out of getting more in the future.
...your notifications should be assistive, not disru
ptive.
...you can build trust by having a well-designed website that provides good content that shows respect for the user, and a clear value to acce
pting push notifications.
RTCConfiguration.certificates - Web APIs
the rtcconfiguration dictionary's o
ptional certificates property is an array of rtccertificate objects providing the security certificates available for use when authenticating duing the connection process.
... descri
ption if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeerconnection.
... although a given dtls connection only uses a single certificate, providing multiple o
ptions in the certificates list may improve the odds of establishing a connection by increasing the chances a mutually-compatible encry
ption algorithm and key size may be found.
... this attribute supports providing multiple certificates because even though a given dtls connection uses only one certificate, providing multiple certificates allows support for multiple encry
ption algorithms.
RTCDTMFSender.insertDTMF() - Web APIs
specifying an em
pty string as the tones parameter clears the tone buffer, aborting any currently queued tones.
... duration o
ptional the amount of time, in milliseconds, that each dtmf tone should last.
... intertonegap o
ptional the length of time, in milliseconds, to wait between tones.
... return value undefined exce
ptions invalidstateerror the dtmf tones couldn't be sent because the track has been stopped, or is in a read-only or inactive state.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
syntax var event = new rtcdtmftonechangeevent(type, o
ptions); parameters type a domstring containing the name of the event.
... o
ptions a dictionary of type rtcdtmftonechangeeventinit, which may contain one or more of the following fields: tone a domstring containing a single dtmf tone character which has just begun to play, or an em
pty string ("") to indicate that the previous tone has stopped playing.
... return value a newly-created rtcdtmftonechangeevent, configured as specified in the provided o
ptions.
... all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exce
ption.
RTCDataChannel.readyState - Web APIs
constant descri
ption "connecting" the user agent (browser) is in the process of creating the underlying data transport; that is, whatever network level connection is used to link the two peers together is in the process of being set up.
... "closed" the underlying data transport has closed, or the attem
pt to make the connection failed.
...achannel = peerconnection.createdatachannel("file transfer"); var sendqueue = []; function sendmessage(msg) { switch(datachannel.readystate) { case "connecting": console.log("connection not open; queueing: " + msg); sendqueue.push(msg); break; case "open": sendqueue.foreach((msg) => datachannel.send(msg)); break; case "closing": console.log("attem
pted to send message while closing: " + msg); break; case "closed": console.log("error!
... attem
pt to send while connection closed."); break; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.readystate' in that specification.
RTCPeerConnection: icecandidate event - Web APIs
an icecandidate event is sent to an rtcpeerconnection when an rtcicecandidate has been identified and added to the local peer by a call to rtcpeerconnection.setlocaldescri
ption().
... bubbles no cancelable no interface rtcpeerconnectioniceevent event handler property rtcpeerconnection.onicecandidate descri
ption there are three reasons why the icecandidate event is fired on an rtcpeerconnection.
...that this has occurred is indicated by an icecandidate event whose candidate string is em
pty ("").
...as you see in the code in the previous section, every candidate is sent to the other peer, including any that might have an em
pty candidate string.
RTCPeerConnection: negotiationneeded event - Web APIs
see signaling transaction flow in signaling and video calling for a descri
ption of the signaling process that begins with a negotiationneeded event.
... pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescri
ption(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescri
ption })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescri
ption(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer.
... the other peer should recognize this message and follow up by creating its own rtcpeerconnection, setting the remote descri
ption with setremotedescri
ption(), and then creating an answer to send back to the offering peer.
... you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescri
ption(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescri
ption })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling.
RTCRtpContributingSource - Web APIs
properties audiolevel o
ptional a double-precision floating-point value between 0 and 1 specifying the audio level contained in the last rtp packet played from this source.
... rt
ptimestamp o
ptional the rtp timestamp of the media played out at the time indicated by timestamp.
... source o
ptional a 32-bit unsigned integer value specifying the csrc identifier of the contributing source.
... timestamp o
ptional a domhighrestimestamp indicating the most recent time at which a frame originating from this source was delivered to the receiver's mediastreamtrack specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpcontributingsource' in that specification.
ReadableStream.pipeThrough() - Web APIs
syntax var transformedstream = readablestream.pipethrough(transformstream[, o
ptions]); parameters transformstream a transformstream (or an object with the structure {writable, readable}) consisting of a readable stream and a writable stream working together to transform some data from one form to another.
... o
ptions o
ptional the o
ptions that should be used when piping to the writable stream.
... available o
ptions are: preventclose: if this is set to true, the source readablestream closing will no longer cause the destination writablestream to be closed.
... exce
ptions typeerror the writable and/or readable property of transformstream are undefined.
ReadableStream.pipeTo() - Web APIs
syntax var promise = readablestream.pipeto(destination[, o
ptions]); parameters destination a writablestream that acts as the final destination for the readablestream.
... o
ptions o
ptional the o
ptions that should be used when piping to the writable stream.
... available o
ptions are: preventclose: if this is set to true, the source readablestream closing will no longer cause the destination writablestream to be closed.
... exce
ptions typeerror the writablestream and/or readablestream objects are not a writable stream/readable stream, or one or both of the streams are locked.
ReportingObserver() - Web APIs
syntax new reportingobserver(callback[, o
ptions]); parameters callback a callback function that runs when the observer starts to collect reports (i.e.
... o
ptions o
ptional an reportingobservero
ptions object allowing you to set the o
ptions for creating the object.
... the available o
ptions are: types: an array of strings representing the types of report to be collected by this observer.
... examples let o
ptions = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, o
ptions); specifications specification status comment reporting apithe definition of 'reportingobserver()' in that specification.
Request.mode - Web APIs
if any serviceworkers interce
pt these requests, they may not add or override any headers exce
pt for those that are simple headers.
... in addition, javascri
pt may not access any properties of the resulting response.
... however, for requests created other than by the request.request constructor, no-cors is typically used as the mode; for example, for embedded resources where the request is initiated from markup, unless the crossorigin attribute is present, the request is in most cases made using the no-cors mode — that is, for the <link> or <scri
pt> elements (exce
pt when used with modules), or <img>, <audio>, <video>, <object>, <embed>, or <iframe> elements.
... example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the scri
pt), then save the request mode in a variable: var myrequest = new request('flowers.jpg'); var mymode = myrequest.mode; // returns "cors" by default specifications specification status comment fetchthe definition of 'mode' in that specification.
Response.type - Web APIs
it can be one of the following: basic: normal, same origin response, with all headers exposed exce
pt “set-cookie” and “set-cookie2″.
...the response’s status is 0, headers are em
pty and immutable.
...the response's status is 0, headers are em
pty, body is null and trailer is em
pty.
... note: an "error" response never really gets exposed to scri
pt: such a response to a fetch() would reject the promise.
SVGFETurbulenceElement - Web APIs
idth="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="371" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeturbulenceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants turbulence types name value descri
ption svg_turbulence_type_unknown 0 the type is not one of predefined types.
... it is invalid to attem
pt to define a new value of this type or to attem
pt to switch an existing value to this type.
... stitch o
ptions name value descri
ption svg_stitchtype_unknown 0 the type is not one of predefined types.
... it is invalid to attem
pt to define a new value of this type or to attem
pt to switch an existing value to this type.
SVGRenderingIntent - Web APIs
the svgrenderingintent interface defines the enumerated list of possible values for rendering-intent attributes or descri
ptors.
... constants name value descri
ption rendering_intent_unknown 0 the type is not one of predefined types.
... it is invalid to attem
pt to define a new value of this type or to attem
pt to switch an existing value to this type.
... rendering_intent_perce
ptual 2 corresponds to the value perce
ptual.
SVGSVGElement - Web APIs
svgsvgelement.contentscri
pttype an svganimatedlength corresponding to the contentscri
pttype attribute of the given <svg> element.
...if getcurrenttime() is called before the document timeline has begun (for example, by scri
pt running in a <scri
pt> element before the document's svgload event is dispatched), then 0 is returned.
...if setcurrenttime() is called before the document timeline has begun (for example, by scri
pt running in a <scri
pt> element before the document's svgload event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.
...the values from the parameter matrix are copied, the matrix parameter is not ado
pted as svgtransform::matrix.
SVGTextPathElement - Web APIs
y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-79" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method types name value descri
ption textpath_methodtype_unknown 0 the type is not one of predefined types.
... it is invalid to attem
pt to define a new value of this type or to attem
pt to switch an existing value to this type.
... spacing types name value descri
ption textpath_spacingtype_unknown 0 the type is not one of predefined types.
... it is invalid to attem
pt to define a new value of this type or to attem
pt to switch an existing value to this type.
Selection.modify() - Web APIs
example this example demonstrates the various granularity o
ptions for modifying a selection.
... click somewhere inside the example (o
ptionally selecting some text), and then click the button to expand the selection.
...nam libero tempore, cum soluta nobis est eligendi o
ptio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis volu
ptas assumenda est, omnis dolor repellendus.</p> <label for="granularity">granularity:</label> <select id="granularity"> <o
ption value="character">character</o
ption> <o
ption value="word">word</o
ption> <o
ption value="sentence">sentence</o
ption> <o
ption value="line">line</o
ption> <o
ption value="paragraph">paragraph</o
ption> <o
ption value="lineboundary">line boundary</o
ption> <o
ption value="sentenceboundary">sentence boundary</o
ption> <o
ption value="paragraphbounda...
...ry">paragraph boundary</o
ption> <o
ption value="documentboundary">document boundary</o
ption> </select> <br><br> <button>extend selection</button> javascri
pt let select = document.queryselector('select'); let button = document.queryselector('button'); button.addeventlistener('click', modify); function modify() { let selection = window.getselection(); selection.modify('extend', 'forward', select.value); } result specifications this method is not part of any specification.
ServiceWorkerRegistration.getNotifications() - Web APIs
syntax serviceworkerregistration.getnotifications(o
ptions) .then(function(notificationslist) { ...
... }); parameters o
ptions o
ptional an object containing o
ptions to filter the notifications returned.
... the available o
ptions are: tag: a domstring representing a notification tag.
... example navigator.serviceworker.register('sw.js'); var o
ptions = { tag : 'user_alerts' }; navigator.serviceworker.ready.then(function(registration) { registration.getnotifications(o
ptions).then(function(notifications) { // do something with your notifications }) }); specifications specification status comment notifications apithe definition of 'serviceworkerregistration.getnotifications()' in that specification.
ServiceWorkerRegistration.showNotification() - Web APIs
syntax serviceworkerregistration.shownotification(title, [o
ptions]); parameters title the title that must be shown within the notification o
ptions o
ptional an object that allows configuring the notification.
...if o
ptions’s renotify is true and o
ptions’s tag is the em
pty string a typeerror will be thrown.
...if o
ptions’s silent is true and o
ptions’s vibrate is present a typeerror exce
ption will be thrown.
... tag: an id for a given notification that allows you to find, replace, or remove the notification using a scri
pt if necessary.
TextTrack - Web APIs
thus, for displayed cues such as ca
ptions or subtitles, the active cues are currently being displayed.
...if it doesn't have an id, then this value is an em
pty string ("").
... texttrack.label read only a human-readable domstring which contains the text track's label, if one is present; otherwise, this is an em
pty string (""), in which case a custom label may need to be generated by your code using other attributes of the track, if the track's label needs to be exposed to the user.
...for example, this can be "en-us" for united states english or "
pt-br" for brazilian portuguese.
TrackEvent() - Web APIs
eventinfo o
ptional an o
ptional dictionary providing additional information configuring the new event; it can contain the following fields in any combination: track o
ptional the track to which the event refers; this is null by default, but should be set to a videotrack, audiotrack, or texttrack as appropriate given the type of track.
... bubbles o
ptional a boolean indicating whether the event bubbles or not.
... cancelable o
ptional a boolean indicating whether or not the event can be canceled.
... composed o
ptional a boolean indicating whether or not the event will trigger listeners outside of a shadow root; see event.composed for more details.
TransitionEvent() - Web APIs
propertyname o
ptional is a domstring containing the value of the property-name css property associated with the transition.
... elapsedtime o
ptional is float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused.
... pseudoelement o
ptional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
... if the animation doesn't run on a pseudo-element but on the element, an em
pty string: "".
URL() - Web APIs
if the given base url or the resulting url are not valid urls, the javascri
pt typeerror exce
ption is thrown.
... base o
ptional a usvstring representing the base url to use in case url is a relative url.
... exce
ptions exce
ption explanation typeerror url (in the case of absolute urls) or base + url (in the case of relative urls) is not a valid url.
... new url('/docs', a); // => 'https://developer.mozilla.org/docs' new url('/docs', "https://developer.mozilla.org/fr-fr/toto"); // => 'https://developer.mozilla.org/docs' new url('/docs', ''); // raises a typeerror exce
ption as '' is not a valid url new url('/docs'); // raises a typeerror exce
ption as '/docs' is not a valid url new url('http://www.example.com', ); // => 'http://www.example.com/' new url('http://www.example.com', b); // => 'http://www.example.com/' new url("//foo.com", "https://example.com") // => 'https://foo.com' (see r...
USBEndpoint - Web APIs
properties usbendpoint.endpointnumber returns this endpoint's "endpoint number" which is a value from 1 to 15 extracted from the bendpointaddress field of the endpoint descri
ptor defining this endpoint.
...data sent through a bulk endpoint is guaranteed to be delivered or generate an error but may be preem
pted by other data traffic.
... "interru
pt" - provides reliable data transfer for small payloads.
... data sent through an interru
pt endpoint is guaranteed to be delivered or generate an error and is also given dedicated bus time for transmission.
UserDataHandler - Web APIs
summary when associating user data with a key on a node, node.setuserdata() can also acce
pt, in its third argument, a handler which will be called when the object is cloned, imported, deleted, renamed, or ado
pted.
... per the specification, exce
ptions should not be thrown in a userdatahandler.
... methods handle (operation, key, data, src, dst) (no return value) this method is a callback which will be called if a node is being cloned, imported, renamed and as well, if deleted or ado
pted.
... constants constant value operation node_cloned 1 node.clonenode() node_imported 2 document.importnode() node_deleted unimplemented (see bug 550400) 3 node_renamed unimplemented 4 node.renamenode() node_ado
pted 5 document.ado
ptnode() (node_renamed is currently not supported since node.renamenode() is not supported.) specification dom level 3 core: userdatahandler ...
ValidityState.typeMismatch - Web APIs
if the value of the email input is not an em
pty 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.
...a valid url includes a protocol, o
ptionally with an ip address, or an o
ptional subdomain, domain, and top level domain combination.
... if the value of the url input is not an em
pty string, a single valid url, or one or more comma separated urls if the multiple attribute is present, there is a typemismatch.
...if the email is required but is em
pty, the valuemissing will be true.
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
offset a glint
ptr specifying an offset in bytes of the first component in the vertex attribute array.
... descri
ption very similar to webglrenderingcontext.vertexattribpointer().
...bone indices, interpreted as integer gl.vertexattribipointer(2, 4, gl.unsigned_byte, 20, 16); gl.enablevertexattribarray(2); //connect to attributes from the vertex shader gl.bindattriblocation(shaderprogram, 0, "position"); gl.bindattriblocation(shaderprogram, 1, "boneweights"); gl.bindattriblocation(shaderprogram, 2, "boneindices"); <scri
pt id="shader-vs" type="x-shader/x-vertex">#version 300 es uniform mat4 mvmatrix; uniform mat4 bones[120]; in vec3 position; in vec4 boneweights; in uvec4 boneindices;//read as 4-component unsigned integer void main() { vec4 skinnedposition = bones[boneindices.s] * vec4(position, 1.0) * boneweights.s + bones[boneindices.t] * vec4(position, 1.0) * boneweights.t + bones[...
...boneindices.p] * vec4(position, 1.0) * boneweights.p + bones[boneindices.q] * vec4(position, 1.0) * boneweights.q; gl_position = mvmatrix * skinnedposition; } </scri
pt> specifications specification status comment webgl 2.0the definition of 'vertexattribipointer' in that specification.
WebGLRenderingContext.bufferSubData() - Web APIs
dstbyteoffset a glint
ptr specifying an offset in bytes where the data replacement will start.
... srcdata o
ptional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data store.
... length o
ptional a gluint defaulting to 0.
... exce
ptions a gl.invalid_value error is thrown if the data would be written past the end of the buffer or if data is null.
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
possible values: gl.framebuffer: collection buffer data storage of color, alpha, de
pth and stencil buffers used to render an image.
... gl.de
pth_attachment: de
pth buffer.
... gl.de
pth_stencil_attachment: de
pth and stencil buffer.
... exce
ptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer.
WebGLRenderingContext.polygonOffset() - Web APIs
the webglrenderingcontext.polygonoffset() method of the webgl api specifies the scale factors and units to calculate de
pth values.
... the offset is added before the de
pth test is performed and before the value is written into the de
pth buffer.
... syntax void gl.polygonoffset(factor, units); parameters factor a glfloat which sets the scale factor for the variable de
pth offset for each polygon.
... units a glfloat which sets the multiplier by which an implementation-specific value is multiplied with to create a constant de
pth offset.
Data in WebGL - Web APIs
each kind of variable is accessible by one or both types of shader program (depending on the data store type) and possibly by the site's javascri
pt code, depending on the specific type of variable.
... attributes attributes are glsl variables which are only available to the vertex shader (as variables) and the javascri
pt code.
... attributes are typically used to store color information, texture coordinates, and any other data calculated or retrieved that needs to be shared between the javascri
pt code and the vertex shader.
... <<how to use>> uniforms uniforms are set by the javascri
pt code and are available to both the vertex and fragment shaders.
Getting started with WebGL - Web APIs
webgl programs consist of control code written in javascri
pt and shader code (glsl) that is executed on a computer's graphics processing unit (gpu).
...it's assumed that you already have an understanding of the mathematics involved in 3d graphics, and this article doesn't pretend to try to teach you 3d graphics conce
pts itself.
... <body> <canvas id="glcanvas" width="640" height="480"></canvas> </body> preparing the webgl context the main() function in our javascri
pt code, is called when our scri
pt is loaded.
... at this point, you have enough code that the webgl context should successfully initialize, and you should wind up with a big black, em
pty box, ready and waiting to receive content.
Introduction to WebRTC protocols - Web APIs
this means the router will only acce
pt connections from peers you’ve previously connected to.
... sdp session descri
ption protocol (sdp) is a standard for describing the multimedia content of the connection such as resolution, formats, codecs, encry
ption, etc.
... structure sdp consists of one or more lines of utf-8 text, each beginning with a one-character type, followed by an equals sign ("="), followed by structured text comprising a value or descri
ption, whose format depends on the type.
...for example, lines providing media descri
ptions have the type "m", so those lines are referred to as "m-lines." for more information to learn more about sdp, see the following useful resources: specification: rfc 4566: sdp: session descri
ption protocol iana registry of sdp parameters ...
Lifetime of a WebRTC session - Web APIs
descri
ptions, candidates, etc.
...this is a process by which the network connection is renegotiated, exactly the same way the initial ice negotiation is performed, with one exce
ption: media continues to flow across the original network connection until the new one is up and running.
... to explicitly trigger ice restart, simply start the renegotiation process by calling rtcpeerconnection.createoffer(), specifying the icerestart o
ption with a value of true.
... transmission rece
ption ...
WebSocket.close() - Web APIs
the websocket.close() method closes the websocket connection or connection attem
pt, if any.
... syntax websocket.close(); parameters code o
ptional a numeric value indicating the status code explaining why the connection is being closed.
... reason o
ptional a human-readable string explaining why the connection is closing.
... exce
ptions thrown invalid_access_err an invalid code was specified.
Writing a WebSocket server in Java - Web APIs
here's an implementation split into parts: import java.io.ioexce
ption; import java.io.inputstream; import java.io.outputstream; import java.net.serversocket; import java.net.socket; import java.security.messagedigest; import java.security.nosuchalgorithmexce
ption; 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 ioexce
ption, ...
...nosuchalgorithmexce
ption { 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.acce
pt(); system.out.println("a client connected."); socket methods: java.net.socket getinputstream() returns an input stream for this socket.
... you must, obtain the value of sec-websocket-key request header without any leading and trailing whitespace link it with "258eafa5-e914-47da-95ca-c5ab0dc85b11" compute sha-1 and base64 code of it write it back as value of sec-websocket-acce
pt response header as part of a http response.
... 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-acce
pt: " + base64.getencoder().encodetostring(messagedigest.getinstance("sha-1").digest((match.group(1) + "258eafa5-e914-47da-95ca-c5ab0dc85b11").getbytes("utf-8"))) + "\r\n\r\n").getbytes("utf-8"); out.write(response, 0, response.length); decoding messages after a successful handshake, client can send messages to the server, but now these are encoded.
WebXR permissions and security - Web APIs
otherwise, an appropriate exce
ption is thrown, such as securityerror if the document doesn't have permission to enter immersive mode.
... if the document making the request isn't the one which is responsible for the scri
pt, the request is denied.
... note: additional requirements may be put into effect due to the specific features requested by the o
ptions object when calling requestsession().
... user intent user intent is the conce
pt of whether or not an action being performed by code is being performed because of something the user intends to do or not.
Keyframe Formats - Web APIs
element.animate(), keyframeeffect.keyframeeffect(), and keyframeeffect.setkeyframes() all acce
pt objects formatted to represent a set of keyframes.
... there are several o
ptions to this format, which are explained below.
...any easing value specified on the o
ptions argument, however, applies across a single iteration of the animation — for the entire duration.
... two exce
ptional css properties are: float, which must be written as cssfloat since "float" is a reserved word in javascri
pt.
Web Animations API - Web APIs
conce
pts and usage the web animations api provides a common language for browsers and developers to describe animations on dom elements.
... to get more information on the conce
pts behind the api and how to use it, read using the web animations api.
... keyframeeffect describes sets of animatable properties and values, called keyframes and their timing o
ptions.
... effecttiming element.animate(), keyframeeffectreadonly.keyframeeffectreadonly(), and keyframeeffect.keyframeeffect() all acce
pt an o
ptional dictionary object of timing properties.
Migrating from webkitAudioContext - Web APIs
this article attem
pts to summarize the areas where developers are likely to encounter these problems and provide examples on how to port such code to standards based audiocontext, which will work across different browser engines.
... createjavascri
ptnode() has been renamed to createscri
ptprocessor.
... if your code uses either of these names, like in the example below : // old method names var gain = context.creategainnode(); var delay = context.createdelaynode(); var js = context.createjavascri
ptnode(1024); you can simply rename the methods to look like this: // new method names var gain = context.creategain(); var delay = context.createdelay(); var js = context.createscri
ptprocessor(1024); the semantics of these methods remain the same in the renamed versions.
...ff(2); you can simply change it like this in order to port it to the standard audiocontext api: var osc = context.createoscillator(); osc.start(1); osc.stop(1.5); var src = context.createbuffersource(); src.start(1, 0.25); src.stop(2); remove synchronous buffer creation in the old webkit implementation of web audio, there were two versions of createbuffer(), one which created an initially em
pty buffer, and one which took an existing arraybuffer containing encoded audio, decoded it and returned the result in the form of an audiobuffer.
Window.getComputedStyle() - Web APIs
pseudoelto
ptional a string specifying the pseudo-element to match.
... html <p>hello</p> css p { width: 400px; margin: 0 auto; padding: 20px; font: 2rem/2 sans-serif; text-align: center; background: purple; color: white; } javascri
pt let para = document.queryselector('p'); let compstyles = window.getcomputedstyle(para); para.textcontent = 'my computed font-size is ' + compstyles.getpropertyvalue('font-size') + ',\nand my computed line-height is ' + compstyles.getpropertyvalue('line-height') + '.'; result descri
ption the returned object is the same cssstyledeclaration type as the object returned from the ...
... the element.style object should be used to set styles on that element, or inspect styles directly added to it from javascri
pt manipulation or the global style attribute.
... <style> h3::after { content: ' rocks!'; } </style> <h3>generated content</h3> <scri
pt> var h3 = document.queryselector('h3'); var result = getcomputedstyle(h3, ':after').content; console.log('the generated content is: ', result); // returns ' rocks!' </scri
pt> notes the returned cssstyledeclaration object contains active values for css property longhand names.
Window.scroll() - Web APIs
syntax window.scroll(x-coord, y-coord) window.scroll(o
ptions) parameters x-coord is the pixel along the horizontal axis of the document that you want displayed in the upper left.
... - or - o
ptions is a scrolltoo
ptions dictionary.
... examples <!-- put the 100th vertical pixel at the top of the window --> <button onclick="scroll(0, 100);">click to scroll down 100 pixels</button> using o
ptions: window.scroll({ top: 100, left: 100, behavior: 'smooth' }); notes window.scrollto() is effectively the same as this method.
... 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0scrolltoo
ptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full support 32safari no support ...
Window.scrollBy() - Web APIs
syntax window.scrollby(x-coord, y-coord); window.scrollby(o
ptions) parameters x-coord is the horizontal pixel value that you want to scroll by.
... - or - o
ptions is a scrolltoo
ptions dictionary.
... examples to scroll down one page: window.scrollby(0, window.innerheight); to scroll up: window.scrollby(0, -window.innerheight); using o
ptions: window.scrollby({ top: 100, left: 100, behavior: 'smooth' }); notes window.scrollby() scrolls by a particular amount, whereas window.scroll() scrolls to an absolute position in the document.
... 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0scrolltoo
ptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full support 32safari no support ...
Window.showModalDialog() - Web APIs
syntax returnval = window.showmodaldialog(uri[, arguments][, o
ptions]); returnval holds the returnvalue property as set by the document specified by uri.
... arguments is an o
ptional variant containing values passed to the dialog; these are made available in the window object's window.dialogarguments property.
... o
ptions is an o
ptional string specifying window ornamentation for the dialog, using one or more semicolon delimited values: syntax descri
ption center: {on | off | yes | no | 1 | 0 } if on, yes, or 1, the dialog window is centered on the desktop; otherwise it's hidden.
...the third argument for additional o
ptions was not present in the html5 version.
Window.sidebar - Web APIs
methods the sidebar object returned has the following methods: method descri
ption (seamonkey) descri
ption (firefox) addpanel(title, contenturl, "") adds a sidebar panel.
... end users can use the "load this bookmark in the sidebar" o
ption instead.
... addsearchprovider(descri
ptionurl) dummy function; does nothing.
... issearchproviderinstalled(descri
ptionurl) indicates if a specific search provider (opensearch) is installed.
Window.window - Web APIs
this means: global variables of your scri
pt are in fact properties of window: var global = {data: 0}; alert(global === window.global); // displays "true" you can access built-in properties of the window object without having to type window.
...otherwise, you'd have to do a manual var window = this; assignment at the top of your scri
pt.
... yet another reason to use this property, is for libraries which wish to offer oop-versions, and non-oop versions (especially javascri
pt modules).
... for example, if we refer to "this.window.location.href", a javascri
pt module could define a property called "window" inside of a class it defined (since no global "window" variable exists for it by default) which could be created after passing in a window object to the module class' constructor.
Synchronous and asynchronous requests - Web APIs
function xhrsuccess() { this.callback.apply(this, this.arguments); } function xhrerror() { console.error(this.statustext); } function loadfile(url, callback /*, o
pt_arg1, o
pt_arg2, ...
... example.html (the main page): <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>mdn example</title> <scri
pt type="text/javascri
pt"> var worker = new worker("mytask.js"); worker.onmessage = function(event) { alert("worker said: " + event.data); }; worker.postmessage("hello"); </scri
pt> </head> <body></body> </html> myfile.txt (the target of the synchronous xmlhttprequest invocation): hello world!!
... ada
pting sync xhr use cases to the beacon api there are some cases in which the synchronous usage of xmlhttprequest is not replaceable, like during the unload, beforeunload, and pagehide events.
... the following example shows theoretical analytics code that attem
pts to submit data to a server by using a synchronous xmlhttprequest in an unload handler.
init() - Web APIs
warning: this method must not be called from javascri
pt.
... [noscri
pt] void init( in nsiprincipal principal, in nsiscri
ptcontext scri
ptcontext, in nsiglobalobject globalobject, in nsiuri baseuri, [o
ptional] in nsiloadgroup loadgroup ); parameters principal the principal to use for the request; this must not be null.
... scri
ptcontext the scri
pt context to use for the request; this must not be null.
... loadgroup o
ptional an o
ptional load group used when performing the request.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
if a network error happened, an em
pty string is returned.
... return value a bytestring representing all of the response's headers (exce
pt those whose field name is set-cookie or set-cookie2) separated by crlf, or null if no response has been received.
... if a network error happened, an em
pty string is returned.
... an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-o
ptions: nosniff\r\n server: meinheld/0.6.1\r\n x-frame-o
ptions: deny\r\n content-type: text/html; charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie, acce
pt-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n).
XMLHttpRequest.send() - Web APIs
send() acce
pts an o
ptional parameter which lets you specify the request's body; this is primarily used for requests such as put.
... if no acce
pt header has been set using the setrequestheader(), an acce
pt header with the type "*/*" (any type) is sent.
... syntax xmlhttprequest.send(body) parameters body o
ptional a body of data to be sent in the xhr request.
... exce
ptions exce
ption descri
ption invalidstateerror send() has already been invoked for the request, and/or the request is complete.
XPathEvaluator.createExpression() - Web APIs
resolver o
ptional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris.
... exce
ptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexce
ption of type invalid_expression_err is raised.
... namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexce
ption of type namespace_error is raised.
... html <div>xpath example</div> <div>number of <div>s: <output></output></div> javascri
pt var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.createexpression()' in that specification.
XRInputSourceArray.forEach() - Web APIs
the callback acce
pts up to three parameters: currentvalue a xrinputsource object which is the value of the item from within the xrinputsourcearray which is currently being processed.
... currentindex o
ptional an integer value providing the index into the array at which the element given by currentvalue is located.
... sourcelist o
ptional the xrinputsourcearray object which is being processed.
... thisarg o
ptional the value to be used for this while executing the callback.
XRPermissionStatus.granted - Web APIs
xrreferencespacetype descri
ption interface bounded-floor similar to the local type, exce
pt the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object.
...the user isn't expected to move much if at all beyond their starting position, and tracking is o
ptimized for this use case.
... xrreferencespace local-floor similar to the local type, exce
pt the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
...the viewer isn't tracked at all; tracking is o
ptimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need.
Using the alert role - Accessibility
descri
ption this technique demonstrates how to use the alert role and describes the effect it has on browsers and assistive technology.
... assistive technology products should listen for such an event and notify the user accordingly: screen readers may interru
pt current output (whether it's speech or braille) and immediately announce or display the alert message.
... let myalert = document.createelement("p"); myalert.setattribute("role", "alert"); let myalerttext = document.createtextnode("you must agree with our terms of service to create an account."); myalert.appendchild(myalerttext); document.body.appendchild(myalert); note: the same result can be achieved with less code when using a scri
pt library like jquery: $("<p role='alert'>you must agree with our terms of service to create an account.</p>").appendto(document.body); example 3: adding alert role to an existing element sometimes it's useful to add an alert role to an element that is already visible on the page rather than creating a new element.
...the pseudo code snippet below illustrates this approach: <p id="forminstruction">you must select at least 3 o
ptions</p> // when the user tries to submit the form with less than 3 checkboxes selected: document.getelementbyid("forminstruction").setattribute("role", "alert"); example 4: making an element with an alert role visible if an element already has role="alert" and is initially hidden using css, making it visible will cause the alert to fire as if it was just added to the page.
ARIA: banner role - Accessibility
descri
ption a banner landmark role converts the container element upon which it is applied into a header.
... associated aria roles, states, and properties none keyboard interactions none required javascri
pt features none examples here's a fake simple banner with a skip to navigation link, a logo, a title and a subtitle.
... <div role="banner"> <a href="#nav" id="ski
ptomenu" class="ski
ptocontent">skip to keyboard navigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy navigation</p> </div> we could also have written the above with the html header element: <header> <a href="#nav" id="ski
ptomenu" class="ski
ptocontent">skip to keyboard navigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy navigation</p> </header> best practices while it is best to use the header element and ensure it is not a descendant of any subsection of the page, sometimes you don't have a...
...if this is the case, you can add the role of banner to the main header of the page with javascri
pt.
ARIA: document role - Accessibility
descri
ption by default, web pages are treated as documents; assistive technologies (at) enter browse or read mode when entering a new web page.
... because ats with reading mode default to that mode for all elements exce
pt for those with a widget or application role set, document role is only useful for focusable elements within a widget or application that should be read as static rich text.
... assistive technologies should switch context back to document mode, possibly interce
pting from controls rewired for the parent's dynamic context, re-enabling the standard input events, such as up or down arrow keyboard events, to control the reading cursor.
... required javascri
pt features none, exce
pt as required by any attributes.
ARIA: form role - Accessibility
descri
ption a form landmark identifies a region of content that contains a collection of items and objects that, as a whole, combine to create a form when no other named landmark is appropriate (e.g.
... keyboard interactions no role specific keyboard interactions required javascri
pt features onsubmit the onsubmit event handler handles the event raised when the form is submitted.
... anything that is not a <form> cannot be submitted, therefore you would have to use javascri
pt to build an alternative data submission mechanism, for example with xmlhttprequest.
... using role="form" <div role="form" id="gift-cards" aria-label="purchase a gift card"> <!-- form content --> </div> redundant descri
ptions screen readers will announce the type of role the landmark is.
ARIA: Navigation Role - Accessibility
descri
ption the navigation role is a landmark role.
... associated wai-aria roles, states, and properties aria-label a brief descri
ption of the purpose of the navigation, omitting the term "navigation", as the screen reader will read both the role and the contents of the label.
... required javascri
pt features none.
... <footer> <nav id="footer-nav" aria-label="main"> <!-- list of links to main website locations --> </nav> </footer> redundant descri
ptions screen readers will announce the type of role the landmark is.
Accessibility
css and javascri
pt accessibility best practices css and javascri
pt, when used properly, also have the potential to allow for accessible web experiences ...
...this article outlines some css and javascri
pt best practices that should be considered to ensure even complex content is as accessible as possible.
... wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascri
pt-updated content can be difficult.
... keyboard-navigable javascri
pt widgets until now, web developers who want to make their styled <div> and <span> based widgets accessible have lacked the proper techniques.
:disabled - CSS: Cascading Style Sheets
an element is disabled if it can't be activated (selected, clicked on, typed into, etc.) or acce
pt focus.
... the element also has an enabled state, in which it can be activated or acce
pt focus.
...it uses the javascri
pt change event to let the user enable/disable the billing fields.
...s</legend> <label for="billing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-checkbox" checked> <br> <input type="text" placeholder="name" disabled> <input type="text" placeholder="address" disabled> <input type="text" placeholder="zip code" disabled> </fieldset> </form> css input[type="text"]:disabled { background: #ccc; } javascri
pt // wait for the page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing ...
:target - CSS: Cascading Style Sheets
s p:target { background-color: gold; } /* add a pseudo-element inside the target element */ p:target::before { font: 70% sans-serif; content: "►"; color: limegreen; margin-right: .25em; } /* style italic elements within the target element */ p:target i { color: red; } result pure-css lightbox you can use the :target pseudo-class to create a lightbox without using any javascri
pt.
... html <ul> <li><a href="#example1">open example #1</a></li> <li><a href="#example2">open example #2</a></li> </ul> <div class="lightbox" id="example1"> <figure> <a href="#" class="close"></a> <figca
ption>lorem ipsum dolor sit amet, consectetur adipiscing elit.
... donec felis enim, placerat id eleifend eu, semper vel sem.</figca
ption> </figure> </div> <div class="lightbox" id="example2"> <figure> <a href="#" class="close"></a> <figca
ption>cras risus odio, pharetra nec ultricies et, mollis ac augue.
... quisque quis neque arcu, nec gravida magna.</figca
ption> </figure> </div> css /* unopened lightbox */ .lightbox { display: none; } /* opened lightbox */ .lightbox:target { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } /* lightbox content */ .lightbox figca
ption { width: 25rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1rem; top: -1rem; width: 2rem; height: 2rem; position: absolute; display: flex; z-index: 1; align-items: center; justify-content: center; background-color: bl...
:valid - CSS: Cascading Style Sheets
this allows to easily make valid fields ado
pt an appearance that helps the user confirm that their data is formatted properly.
... you can try it below: notice how the required text inputs are invalid when em
pty, but valid when they have something filled in.
... the email input on the other hand is valid when em
pty, as it is not required, but invalid when it contains something that is not a proper email address.
...typically, descri
ptive text and/or an icon are used.
suffix - CSS: Cascading Style Sheets
the suffix descri
ptor of the@counter-style rule specifies content that will be appended to the marker representation.
...)<image-set()> = image-set( <image-set-o
ption># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<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-o
ption> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
...-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples setting a suffix for a counter html <ul class="choices"> <li>one</li> <li>two</li> <li>three</li> <li>none of the above</li> </ul> css @counter-style o
ptions { system: fixed; symbols: a b c d; suffix: ") "; } .choices { list-style: o
ptions; } result specifications specification status comment css counter styles level 3the definition of 'suffix' in that specification.
font-style - CSS: Cascading Style Sheets
the font-style css descri
ptor allows authors to specify font styles for the fonts specified in the @font-face rule.
... for a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-style descri
ptor to explicitly specify the font face's style.
... the values for the css descri
ptor is same as that of its corresponding font property.
... on the other hand, if a true italicized version of the font family exists, we can include it in the src descri
ptor and specify the font style as italic, so that it is clear that the font is italicized.
src - CSS: Cascading Style Sheets
the src css descri
ptor of the @font-face rule specifies the resource containing font data.
... specifies an external reference consisting of a <url>, followed by an o
ptional hint using the format() function to describe the format of the font resource referenced by that url.
...the name can o
ptionally be enclosed in quotes.
... descri
ption the value of this descri
ptor is a prioritized, comma-separated list of external references or locally-installed font face names.
viewport-fit - CSS: Cascading Style Sheets
the viewport-fit css @viewport descri
ptor controls how a document's viewport fills the screen.
... this descri
ptor hasn't been added to https://github.com/mdn/data/blob/master/css/at-rules.json yet.
... accessibility concerns when using the viewport-fit descri
ptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables.
... formal definition related at-rule@viewportinitial valueautocomputed valueas specified formal syntax auto | contain | cover examples scaling viewport to fit device display @viewport { viewport-fit: cover; } specifications specification status comment css round display level 1the definition of '"viewport-fit" descri
ptor' in that specification.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
the "box" class is the basic descri
ption of the box's appearance, without any animation information included.
... javascri
pt content next we'll look at the javascri
pt that does the work.
... use javascri
pt and clear the animation being used when the animationiteration event fires.
... the following demo shows how you'd achieve the aforementioned javascri
pt technique: .slidein { animation-duration: 5s; animation-name: slidein; animation-iteration-count: infinite; } .stopped { animation-name: none; } @keyframes slidein { 0% { margin-left: 0%; } 50% { margin-left: 50%; } 100% { margin-left: 0%; } } <h1 id="watchme">click me to stop</h1> let watchme = document.getelementbyid('watchme') watchme.classname = 'slidein' const listener = (e) => { watchme.classname = 'slidein stopped' } watchme.addeventlistener('click', () => watchme.addeventlistener('animationiteration', listener, false) ) demo https://jsfiddle.net/morenoh149/5ty5a4oy/ ...
Border-radius generator - CSS: Cascading Style Sheets
=== */ .group:before, .group:after { content: ""; display: table; } .group:after { clear:both; } .group { zoom: 1; /* for ie 6/7 (trigger haslayout) */ } /* grid column setup * ========================================================================== */ .col { display: block; float:left; margin: 1% 0 1% 1.6%; } .col:first-child { margin-left: 0; } /* all browsers exce
pt ie6 and lower */ /* * ui component */ .ui-input-slider-container { height: 20px; margin: 10px 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-input-slider-container * { float: left; height: 100%; line-height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; ...
...lign: center; position: relative; top: 40%; } #unit-selection .dropdown { width: 50px; height: 20px; margin: 10px; padding: 0; border-radius: 3px; position: absolute; overflow: hidden; } #unit-selection select { width: 50px; height: 20px; marign: 0; padding: 0 0 0 10px; background: #555; border: 1px solid #555; border: none; color: #fff; float: left; } #unit-selection select o
ption { background: #fff; color: #333; } #unit-selection select:hover { cursor: pointer; } #unit-selection .dropdown:before { content: ""; width: 18px; height: 20px; display: block; background-color: #555; background-image: url("https://mdn.mozillademos.org/files/5675/dropdown.png"); background-position: center center; background-repeat: no-repeat; top: 0px; right: 0px; position: abs...
...: 200px; color: #444; float:left; } #dimensions input { background: #555; color: #fff; border: none; border-radius: 3px; } #output { width: 500px; padding: 10px 0; margin: 10px 0; color: #555; text-align: center; border: 1px dashed #999; border-radius: 3px; -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; float: right; } javascri
pt content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('...
...i in subscribers) subscribers[i](deltax, deltay); } return { init : init, subscribe : subscribe, unsubscribe : unsubscribe } })(); var subject; var units = ['px', '%']; var output = null; var unitselector = function unitselector(topic) { this.container = document.createelement("div"); this.select = document.createelement("select"); for (var i in units) { var o
ption = document.createelement("o
ption"); o
ption.value = i; o
ption.textcontent = units[i]; this.select.appendchild(o
ption); } this.container.classname = 'dropdown ' + 'unit-' + topic; this.container.appendchild(this.select); } unitselector.prototype.setvalue = function setvalue(value) { this.salect.value = value; } var radiuscontainer = function radiuscontainer(node) { var...
CSS Box Alignment - CSS: Cascading Style Sheets
this document details the general conce
pts found in the specification.
... key conce
pts and terminology the specification details some alignment terminology to make it easier to discuss these alignment properties outside of their implementation within a particular layout method.
... there are also some key conce
pts which are common to all layout methods.
...ut box alignment for block, absolutely positioned and table layout reference css properties justify-content align-content place-content justify-items align-items place-items justify-self align-self place-self row-gap column-gap gap glossary entries cross axis main axis alignment container alignment subject fallback alignment guides css flexbox guide: basic conce
pts of flexbox css flexbox guide: aligning items in a flex container css grid guide: box alignment in css grid layouts external resources box alignment cheatsheet css grid, flexbox and box alignment thoughts on partial implementations of box alignment ...
Handling content breaks in multicol - CSS: Cascading Style Sheets
for example, we would generally prefer that the figca
ption of an image not be separated into a new column away from the image it refers to and ending a column with a heading looks strange.
...this property takes values of: auto avoid avoid-page avoid-column avoid-region in the example below, we have applied break-inside to the figure element to prevent the ca
ption from becoming separated from the image.
...if the block has fewer lines in it than the number that you specify as a value, all lines will be ke
pt together.
...in most cases, the fallback to breaks not being controlled is something you can live with, with subo
ptimal breaking being untidy rather than a disaster to your layout.
CSS Containment - CSS: Cascading Style Sheets
if the browser knows that a part of the page is independent, rendering can be o
ptimized and performance improved.
...therefore this property gives you a nice way to explain to the browser this fact, and allow it to make performance o
ptimizations based on that knowledge.
... key conce
pts and terminology this specification defines only one property, the contain property.
... size containment article { contain: size; } size containment does not offer much in the way of performance o
ptimizations when used on its own.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
grid and the danger of markup flattening another issue to be aware of in css grid layout and to a lesser extent in css flexbox, is the tem
ptation to flatten markup.
... given that interoperable support for display: contents is limited and we do not yet have subgrids, there is a definite tem
ptation when developing a site using css grid layout to flatten out the markup, to remove semantic elements in order to make it simpler to create a layout.
...be aware of this tem
ptation and find ways to develop your design without stripping out the markup.
... the conce
pt of visual display following document source order is detailed in the wcag techniques for success criteria – technique c27.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
in the article covering the basic conce
pts of grid layout, we started to look at how to position items on a grid using line numbers.
...we will take a proper look at how these work in a later guide but you can see as you work that grid is laying out un-placed items into em
pty cells of the grid.
...note that we can leave cells em
pty if we wish.
...we will explore how grids work with writing modes in a later article however we have the conce
pt of four flow-relative directions: block-start block-end inline-start inline-end we are working in english, a left-to-right language.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
this means that at-rules containing entities other than declarations, such as a @font-face rule containing descri
ptors, don't participate in the cascade.
... in these cases, only the at-rule as a whole participates in the cascade: here, the @font-face identified by its font-family descri
ptor.
... if several @font-face rules with the same descri
ptor are defined, only the most appropriate @font-face, as a whole, is considered.
... all lets you o
pt to immediately restore all properties to any of their initial (default) state, the state inherited from the previous level of the cascade, a specific origin (the user-agent stylesheet, the author stylesheet, or the user stylesheet), or even to clear the values of the properties entirely.
Specificity - CSS: Cascading Style Sheets
the !important exce
ption when an important rule is used on a style declaration, this declaration overrides any other declarations.
... <div class="foo" style="color: red;">what color am i?</div> .foo[style*="color: red"] { color: firebrick !important; } many javascri
pt frameworks and libraries add inline styles.
...lications-of-using-important-in-css https://stackoverflow.com/questions/9245353/what-does-important-in-css-mean https://stackoverflow.com/questions/5701149/when-to-use-important-property-in-css https://stackoverflow.com/questions/11178673/how-to-override-important https://stackoverflow.com/questions/2042497/when-to-use-important-to-save-the-day-when-working-with-css the :is() and :not() exce
ptions the matches-any pseudo-class :is() and the negation pseudo-class :not() are not considered a pseudo-class in the specificity calculation.
...appears on the screen like this: the :where() exce
ption the specificity-adjustment pseudo-class :where() always has its specificity replaced with zero.
Linear-gradient Generator - CSS: Cascading Style Sheets
-webkit-user-select: text; -ms-user-select: text; user-select: text; } #output .css-property { width: 90%; margin: 5px 5%; color: #777; position: relative; float: left; } #output .property { height: 100%; width: 12%; position: absolute; left: 0; } #output .value { width: 88%; position: absolute; white-space: pre; word-wrap: break-word; display: block; right: 0; } javascri
pt content var uicolorpicker = (function uicolorpicker() { 'use strict'; function getelembyid(id) { return document.getelementbyid(id); } var subscribers = []; var pickers = []; /** * rgba color class * * hsv/hsb and hsl (hue, saturation, value / brightness, lightness) * @param hue 0-360 * @param saturation 0-100 * @param value 0-100 * @param lightness 0-100 */ fun...
... { a = 'a'; v = ', ' + x; } var value = 'hsl' + a + hsl + v + ')'; return value; }; color.prototype.getcolor = function getcolor() { if (this.a | 0 === 1) return this.gethexa(); return this.getrgba(); }; /*=======================================================================*/ /*=======================================================================*/ /*========== ca
pture mouse movement ==========*/ var setmousetracking = function setmousetracking(elem, callback) { elem.addeventlistener('mousedown', function(e) { callback(e); document.addeventlistener('mousemove', callback); }); document.addeventlistener('mouseup', function(e) { document.removeeventlistener('mousemove', callback); }); }; /*====================*/ // color picker class /*...
...ers = {}; var dropdowns = []; var active = null; var visbility = ["hidden", "visible"]; var dropdown = function dropdown(node) { var topic = node.getattribute('data-topic'); var label = node.getattribute('data-label'); var selected = node.getattribute('data-selected') | 0; var select = document.createelement('div'); var list = document.createelement('div'); var uval = 0; var o
ption = null; var o
ption_value = null; list.classname = 'ui-dropdown-list'; select.classname = 'ui-dropdown-select'; while (node.firstelementchild !== null) { o
ption = node.firstelementchild; o
ption_value = o
ption.getattribute('data-value'); if (o
ption_value === null) o
ption.setattribute('data-value', uval); list.appendchild(node.firstelementchild); uval++; } node...
...e'); this.select.textcontent = node.textcontent; this.select.setattribute('data-value', this.value['value']); if (send_notify !== false) notify.call(this); }; var clickout = function clickout(e) { if (active.state === 0 || e.target === active.dropmenu || e.target === active.select) return; active.toggle(false); }; var createdropdown = function createdropdown(topic, o
ptions) { var dropdown = document.createelement('div'); dropdown.setattribute('data-topic', topic); dropdown.classname = 'ui-dropdown'; for (var i in o
ptions) { var x = document.createelement('div'); x.setattribute('data-value', i); x.textcontent = o
ptions[i]; dropdown.appendchild(x); } new dropdown(dropdown); return dropdown; }; var setvalue = function setvalue(topi...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
the function only acce
pts two parameters, assigning everything following the first comma as the second parameter.
... validity and values the classical css conce
pt of validity, tied to each property, is not very useful in regard to custom properties.
...properties and custom variables can lead to invalid css statements, leading to the new conce
pt of valid at computed time.
... values in javascri
pt to use the values of custom properties in javascri
pt, it is just like standard properties.
align-content - CSS: Cascading Style Sheets
the em
pty space before the first and after the last item equals half of the space between each pair of adjacent items.
...f; min-height: 50px; font-size: 30px; } select { font-size: 16px; } .row { margin-top: 10px; } html <div id="container" class="flex"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> </div> <div class="row"> <label for="display">display: </label> <select id="display"> <o
ption value="flex">flex</o
ption> <o
ption value="grid">grid</o
ption> </select> </div> <div class="row"> <label for="values">align-content: </label> <select id="values"> <o
ption value="normal">normal</o
ption> <o
ption value="stretch">stretch</o
ption> <o
ption value="flex-start">flex-start</o
ption> <o
ption value="flex-end">flex-end</o
ption> <o
ption value="center" selected>c...
...enter</o
ption> <o
ption value="space-between">space-between</o
ption> <o
ption value="space-around">space-around</o
ption> <o
ption value="space-evenly">space-evenly</o
ption> <o
ption value="start">start</o
ption> <o
ption value="end">end</o
ption> <o
ption value="left">left</o
ption> <o
ption value="right">right</o
ption> <o
ption value="baseline">baseline</o
ption> <o
ption value="first baseline">first baseline</o
ption> <o
ption value="last baseline">last baseline</o
ption> <o
ption value="safe center">safe center</o
ption> <o
ption value="unsafe center">unsafe center</o
ption> <o
ption value="safe right">safe right</o
ption> <o
ption value="unsafe right">unsafe right</o
ption> <o
ption value="safe end">safe end</o
ption> <o
ption value="unsafe end">un...
...safe end</o
ption> <o
ption value="safe flex-end">safe flex-end</o
ption> <o
ption value="unsafe flex-end">unsafe flex-end</o
ption> </select> </div> javascri
pt var values = document.getelementbyid('values'); var display = document.getelementbyid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.aligncontent = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); result specifications specification status comment css box alignment module level 3the definition of 'align-content' in that specification.
align-items - CSS: Cascading Style Sheets
for grid items, this keyword leads to a behavior similar to the one of stretch, exce
pt for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...ff; min-height: 50px; font-size: 30px; } select { font-size: 16px; } .row { margin-top: 10px; } html <div id="container" class="flex"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> </div> <div class="row"> <label for="display">display: </label> <select id="display"> <o
ption value="flex">flex</o
ption> <o
ption value="grid">grid</o
ption> </select> </div> <div class="row"> <label for="values">align-items: </label> <select id="values"> <o
ption value="normal">normal</o
ption> <o
ption value="flex-start">flex-start</o
ption> <o
ption value="flex-end">flex-end</o
ption> <o
ption value="center" selected>center</o
ption> <o
ption value="baseline">bas...
...eline</o
ption> <o
ption value="stretch">stretch</o
ption> <o
ption value="start">start</o
ption> <o
ption value="end">end</o
ption> <o
ption value="self-start">self-start</o
ption> <o
ption value="self-end">self-end</o
ption> <o
ption value="left">left</o
ption> <o
ption value="right">right</o
ption> <o
ption value="first baseline">first baseline</o
ption> <o
ption value="last baseline">last baseline</o
ption> <o
ption value="safe center">safe center</o
ption> <o
ption value="unsafe center">unsafe center</o
ption> <o
ption value="safe right">safe right</o
ption> <o
ption value="unsafe right">unsafe right</o
ption> <o
ption value="safe end">safe end</o
ption> <o
ption value="unsafe end">unsafe end</o
ption> <o
ption value="safe self-end">safe self-end</o
pti...
...on> <o
ption value="unsafe self-end">unsafe self-end</o
ption> <o
ption value="safe flex-end">safe flex-end</o
ption> <o
ption value="unsafe flex-end">unsafe flex-end</o
ption> </select> </div> javascri
pt var values = document.getelementbyid('values'); var display = document.getelementbyid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.alignitems = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); result specifications specification status comment css box alignment module level 3the definition of 'align-items' in that specification.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
rance: listbox; appearance: meter; appearance: progress-bar; /* partial list of available values in gecko */ -moz-appearance: scrollbarbutton-up; -moz-appearance: button-bevel; /* partial list of available values in webkit/blink (as well as gecko and edge) */ -webkit-appearance: media-mute-button; -webkit-appearance: caret; values standard keywords value demo browser descri
ption none div{ color: black; -moz-appearance:none; -webkit-appearance:none; appearance:none; } <div>lorem</div> firefox chrome safari edge no special styling is applied.
... value demo browser descri
ption attachment div{ color: black; -moz-appearance: attachment; -webkit-appearance: attachment; } <div>lorem</div> safari borderless-attachment div{ color: black; -moz-appearance: borderless-attachment; -webkit-appearance: borderless-attachment; } <div>lorem</div> safari button-bevel d...
...v{ color: black; -moz-appearance: media-seek-back-button; -webkit-appearance: media-seek-back-button; } <div>lorem</div> safari edge media-seek-forward-button div{ color: black; -moz-appearance: media-seek-forward-button; -webkit-appearance: media-seek-forward-button; } <div>lorem</div> safari edge media-toggle-closed-ca
ptions-button div{ color: black; -webkit-appearance: media-toggle-closed-ca
ptions-button; } <div>lorem</div> chrome safari media-slider div{ color: black; -webkit-appearance: media-slider; } <div>lorem</div> chrome safari edge media-sliderthumb div{ color: black; -webkit-appearance: media-slider...
... value browser descri
ption button-arrow-down firefox removed in firefox 64 button-arrow-next firefox removed in firefox 64 button-arrow-previous firefox removed in firefox 64 button-arrow-up firefox removed in firefox 64 button-focus firefox removed in firefox 64 dualbutton firefox removed in firefox 64 ...
<basic-shape> - CSS: Cascading Style Sheets
the o
ptional <border-radius> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax.
...for this specification, this results in an em
pty float area.
...<string>) the o
ptional <fill-rule> represents the filling rule used to determine the interior of the path.
... descri
ption computed values of basic shapes the values in a <basic-shape> function are computed as specified, with these exce
ptions: omitted values are included and compute to their defaults.
border - CSS: Cascading Style Sheets
descri
ption as with all shorthand properties, any omitted sub-values will be set to their initial value.
...to make them different from each other, however, you can use the longhand border-width, border-style, and border-color properties, which acce
pt different values for each side.
... recommendation acce
pts the inherit keyword.
... also acce
pts transparent as a valid color.
break-inside - CSS: Cascading Style Sheets
we also have a <figure> containing an image and a ca
ption.
... by default, it is possible for you to get a break between the image and its ca
ption, which is not what we want.
...fusce iaculis urna id neque dapibus, eu lacinia lectus dictum.</p> <figure> <img src="https://udn.realityripple.com/samples/fe/4508d88f78.png"> <figca
ption>the firefox logo — fox wrapped around the world</figca
ption> </figure> <p>praesent condimentum dui dui, sit amet rutrum diam tincidunt eu.
...t faucibus dui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } body { width: 80%; margin: 0 auto; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h1 + p { margin-top: 0; } p { line-height: 1.5; break-after: column; } figure { break-inside: avoid; } img { max-width: 70%; display: block; margin: 0 auto; } figca
ption { font-style: italic; font-size: 0.8rem; width: 70%; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-inside' in that specification.
conic-gradient() - CSS: Cascading Style Sheets
<angular-color-stop> a color-stop's <color> value, followed by one or two o
ptional stop positions, (an <angle> along the gradient's circumference axis).
... descri
ption as with any gradient, a conic gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio.
...browsers supporting conic gradients also acce
pt percent values, with 100% equaling 360 degrees, but this is not in the specification.
...the colors of the gradient are determined by the angled color stops, their starting points, ending points, and, in between, and o
ptional angled color-stop points.
float - CSS: Cascading Style Sheets
f the block layout, it modifies the computed value of the display values, in some cases: specified value computed value inline block inline-block block inline-table table table-row block table-row-group block table-column block table-column-group block table-cell block table-ca
ption block table-header-group block table-footer-group block inline-flex flex inline-grid grid other unchanged note: if you're referring to this property from javascri
pt as a member of the htmlelement.style object, modern browsers support float, but in older browsers you have to spell it as cssfloat, with internet explorer versio...
...this was an exce
ption to the rule, that the name of the dom member is the camel-case name of the dash-separated css name (due to the fact that "float" is a reserved word in javascri
pt, as seen in the need to escape "class" as "classname" and escape <label>'s "for" as "htmlfor").
...that is the left side with ltr scri
pts, and the right side with rtl scri
pts.
...that is the right side with ltr scri
pts, and the left side with rtl scri
pts.
font-size - CSS: Cascading Style Sheets
descri
ption there are several ways to specify the font size, including with keywords or numerical values for pixels or ems.
... the em is a very useful unit in css, since it automatically ada
pts its length relative to the font that the reader chooses to use.
...the only exce
ption is that the unit has been changed to rem.
...nimation typea length formal syntax <absolute-size> | <relative-size> | <length-percentage>where <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large<relative-size> = larger | smaller<length-percentage> = <length> | <percentage> examples setting font sizes css .small { font-size: xx-small; } .larger { font-size: larger; } .point { font-size: 24
pt; } .percent { font-size: 200%; } html <h1 class="small">small h1</h1> <h1 class="larger">larger h1</h1> <h1 class="point">24 point h1</h1> <h1 class="percent">200% h1</h1> result specifications specification status comment css fonts module level 4the definition of 'font-size' in that specification.
font-stretch - CSS: Cascading Style Sheets
in earlier versions of the font-stretch specification, the property acce
pts only the nine keyword values.
... css fonts level 4 extends the syntax to acce
pt a <percentage> value as well.
...table below shows the mapping between keyword values and numeric percentages: keyword percentage ultra-condensed 50% extra-condensed 62.5% condensed 75% semi-condensed 87.5% normal 100% semi-expanded 112.5% expanded 125% extra-expanded 150% ultra-expanded 200% descri
ption some font families offer additional faces in which the characters are narrower than the normal face (condensed faces) or wider than the normal face (expanded faces).
... html <div class="container"> <p class="condensed">an elephantine lizard</p> <p class="normal">an elephantine lizard</p> <p class="expanded">an elephantine lizard</p> </div> css /* this example uses the league mono variable font, developed by tyler finck (https://www.tylerfinck.com/) and used here under the terms of the sil open font license, version 1.1: http://scri
pts.sil.org/cms/scri
pts/page.php?item_id=ofl_web */ @font-face { src: url('https://mdn.mozillademos.org/files/16014/leaguemonovariable.ttf'); font-family:'leaguemonovariable'; font-style: normal; font-stretch: 1% 500%; /* required by chrome */ } .container { border: 10px solid #f5f9fa; padding: 0 1rem; font: 1.5rem 'leaguemonovariable', sans-serif; } .condensed { font-stretch: 50%...
font-weight - CSS: Cascading Style Sheets
in earlier versions of the font-weight specification, the property acce
pts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g.
... css fonts level 4 extends the syntax to acce
pt any number between 1 and 1000 and introduces variable fonts, which can make use of this much finer-grained range of font weights.
...r { max-height: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascri
pt let weightlabel = document.queryselector('label[for="weight"]'); let weightinput = document.queryselector('#weight'); let sampletext = document.queryselector('.sample'); function update() { weightlabel.textcontent = `font-weight: ${weightinput.value};`; sampletext.style.fontweight = weightinput.value; } weightinput.addeventlistener('input', update); update(); accessibility concerns pe...
... working draft defines font-weight to acce
pt any numbers between 1 and 1000.
image-set() - CSS: Cascading Style Sheets
the image-set() function delivers the most appropriate image resolution for a user’s device, providing a set of image o
ptions — each with an associated resolution declaration — from which the browser picks the most appropriate for the device and settings.
... image-set() allows the author to provide o
ptions rather than determining what each individual user needs.
... syntax image-set() = image-set( <image-set-o
ption># ) where <image-set-o
ption> = [ <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 exce
pt for an image set.
... examples background-image: image-set( "cat.png" 1x, "cat-2x.png" 2x, "cat-print.png" 600dpi); this example shows how to use image-set() to provide two alternative background-image o
ptions, chosen depending on the resolution needed: a normal version and a high-resolution version.
image() - CSS: Cascading Style Sheets
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> where: image-tagso
ptional the directionality of the image, either ltr for left-to-right or rtl for right-to-left.
... image-src o
ptional zero or more <url>s or <string>s specifying the image sources, with o
ptional image fragment identifiers.
... coloro
ptional a color, specifying a solid background color to use as a fallback if no image-src is found, supported, or declared.
... bi-directional awareness the first, o
ptional parameter of the image() notation is the directionality of the image.
margin-left - CSS: Cascading Style Sheets
this table summarizes the different cases: value of display value of float value of position computed value of auto comment inline, inline-block, inline-table any static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-ca
ption any static or relative 0, exce
pt if both margin-left and margin-right are set to auto.
... block layout mode block, inline, inline-block, block, table, inline-table, list-item, table-ca
ption left or right static or relative 0 block layout mode (floating element) any table-*, exce
pt table-ca
ption any any 0 internal table-* elements don't have margins, use border-spacing instead any, exce
pt flex, inline-flex, or table-* any fixed or absolute 0, exce
pt if both margin-left and margin-right are set to auto.
... absolutely positioned layout mode flex, inline-flex any any 0, exce
pt if there is any positive horizontal free space.
... flexbox layout mode formal definition initial value0applies toall elements, exce
pt elements with table display types other than table-ca
ption, table and inline-table.
margin-right - CSS: Cascading Style Sheets
this table summarizes the different cases: value of display value of float value of position computed value of auto comment inline, inline-block, inline-table any static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-ca
ption any static or relative 0, exce
pt if both margin-left and margin-right are set to auto.
... block layout mode block, inline, inline-block, block, table, inline-table, list-item, table-ca
ption left or right static or relative 0 block layout mode (floating element) any table-*, exce
pt table-ca
ption any any 0 internal table-* elements don't have margins, use border-spacing instead any, exce
pt flex, inline-flex, or table-* any fixed or absolute 0, exce
pt if both margin-left and margin-right are set to auto.
... absolutely positioned layout mode flex, inline-flex any any 0, exce
pt if there is any positive horizontal free space.
... flexbox layout mode formal definition initial value0applies toall elements, exce
pt elements with table display types other than table-ca
ption, table and inline-table.
Guide to scroll anchoring - CSS: Cascading Style Sheets
it's essentially a way to o
pt out of the new behavior.
... none means that you have explicitly o
pted the document, or part of the document, out of scroll anchoring.
... to o
pt out the entire document, you can set it on the <body> element: body { overflow-anchor: none; } to o
pt out a certain part of the document use overflow-anchor: none on its container element: .container { overflow-anchor: none; } note: the specification details that once scroll anchoring has been o
pted out of, you cannot o
pt back into it from a child element.
... for example, if you o
pt out for the entire document, you will not be able to set overflow-anchor: auto elsewhere in the document to turn it back on for a subsection.
place-content - CSS: Cascading Style Sheets
the em
pty space before the first and after the last item equals half of the space between each pair of adjacent items.
... examples placing content in a flex container html <div id="container"> <div class="small">lorem</div> <div class="small">lorem<br/>ipsum</div> <div class="large">lorem</div> <div class="large">lorem<br/>impsum</div> <div class="large"></div> <div class="large"></div> </div> <code>writing-mode:</code><select id="writingmode"> <o
ption value="horizontal-tb" selected>horizontal-tb</o
ption> <o
ption value="vertical-rl">vertical-rl</o
ption> <o
ption value="vertical-lr">vertical-lr</o
ption> <o
ption value="sideways-rl">sideways-rl</o
ption> <o
ption value="sideways-lr">sideways-lr</o
ption> </select><code>;</code><br/> <code>direction:</code><select id="direction"> <o
ption value="ltr" selected>ltr</o
ption> <o
ption value="r...
...tl">rtl</o
ption> </select><code>;</code><br/> <code>place-content:</code><select id="aligncontentalignment"> <o
ption value="normal">normal</o
ption> <o
ption value="first baseline">first baseline</o
ption> <o
ption value="last baseline">last baseline</o
ption> <o
ption value="baseline">baseline</o
ption> <o
ption value="space-between">space-between</o
ption> <o
ption value="space-around">space-around</o
ption> <o
ption value="space-evenly" selected>space-evenly</o
ption> <o
ption value="stretch">stretch</o
ption> <o
ption value="center">center</o
ption> <o
ption value="start">start</o
ption> <o
ption value="end">end</o
ption> <o
ption value="flex-start">flex-start</o
ption> <o
ption value="flex-end">flex-end</o
ption> <o
ption value="safe">safe</o
ption> <o
ption value="unsafe">unsafe</o
pt...
...ion> </select> <select id="justifycontentalignment"> <o
ption value="normal">normal</o
ption> <o
ption value="space-between">space-between</o
ption> <o
ption value="space-around">space-around</o
ption> <o
ption value="space-evenly">space-evenly</o
ption> <o
ption value="stretch">stretch</o
ption> <o
ption value="center" selected>center</o
ption> <o
ption value="start">start</o
ption> <o
ption value="end">end</o
ption> <o
ption value="flex-start">flex-start</o
ption> <o
ption value="flex-end">flex-end</o
ption> <o
ption value="left">left</o
ption> <o
ption value="right">right</o
ption> <o
ption value="safe">safe</o
ption> <o
ption value="unsafe">unsafe</o
ption> </select><code>;</code> var update = function () { document.getelementbyid("container").style.placecontent = document.getele...
place-items - CSS: Cascading Style Sheets
in grid layouts, this keyword leads to a behavior similar to the one of stretch, exce
pt for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...ff; min-height: 50px; font-size: 30px; } select { font-size: 16px; } .row { margin-top: 10px; } html <div id="container" class="flex"> <div id="item1">1</div> <div id="item2">2</div> <div id="item3">3</div> <div id="item4">4</div> <div id="item5">5</div> <div id="item6">6</div> </div> <div class="row"> <label for="display">display: </label> <select id="display"> <o
ption value="flex">flex</o
ption> <o
ption value="grid">grid</o
ption> </select> </div> <div class="row"> <label for="values">place-items: </label> <select id="values"> <o
ption value="start">start</o
ption> <o
ption value="center">center</o
ption> <o
ption value="end">end</o
ption> <o
ption value="left">left</o
ption> <o
ption value="right">right</o
ption> <o
ption value="auto ...
...center">auto center</o
ption> <o
ption value="normal start">normal start</o
ption> <o
ption value="center normal">center normal</o
ption> <o
ption value="start auto">start auto</o
ption> <o
ption value="end normal">end normal</o
ption> <o
ption value="self-start auto">self-start auto</o
ption> <o
ption value="self-end normal">self-end normal</o
ption> <o
ption value="flex-start auto">flex-start auto</o
ption> <o
ption value="flex-end normal">flex-end normal</o
ption> <o
ption value="left auto">left auto</o
ption> <o
ption value="right normal">right normal</o
ption> <o
ption value="baseline normal">baseline normal</o
ption> <o
ption value="first baseline auto">first baseline auto</o
ption> <o
ption value="last baseline normal">last baseline normal</o
ption> <o
ptio...
...n value="stretch auto">stretch auto</o
ption> </select> </div> javascri
pt var values = document.getelementbyid('values'); var display = document.getelementbyid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.placeitems = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); css #container { height:200px; width: 240px; place-items: center; /* you can change this value by selecting another o
ption in the list */ background-color: #8c8c8c; } .flex { display: flex; flex-wrap: wrap; } .grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); } result specifications specification status ...
radial-gradient() - CSS: Cascading Style Sheets
the possible values are: keyword descri
ption closest-side the gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the vertical and horizontal sides closest to the center (for ellipses).
... farthest-side similar to closest-side, exce
pt the ending shape is sized to meet the side of the box farthest from its center (or vertical and horizontal sides).
... <linear-color-stop> a color-stop's <color> value, followed by an one or two o
ptional stop positions (either a <percentage> or a <length> along the gradient's axis).
... descri
ption as with any gradient, a radial gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio.
repeating-conic-gradient() - CSS: Cascading Style Sheets
<angular-color-stop> a color-stop's <color> value, followed by one or two o
ptional stop positions, (an <angle> along the gradient's circumference axis).
... descri
ption example repeating conic gradients include starbursts.
...browsers supporting repeating conic gradients also acce
pt percent values, with 100% equaling 360 degrees, but this is not in the specification.
...the colors of the gradient are determined by the angled color stops, their starting points, ending points, and, in between, and o
ptional angled color-stop points.
ruby-position - CSS: Cascading Style Sheets
/* keyword values */ ruby-position: over; ruby-position: under; ruby-position: inter-character; /* global values */ ruby-position: inherit; ruby-position: initial; ruby-position: unset; syntax values over is a keyword indicating that the ruby has to be placed over the main text for horizontal scri
pts and right to it for vertical scri
pts.
... under is a keyword indicating that the ruby has to be placed under the main text for horizontal scri
pts and left to it for vertical scri
pts.
...ym of the modern over).opera no support nosafari no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scri
pts to the standard over value used with ruby-align: start).webview android no support nochrome android no support nofirefox android full support 38opera android no support nosafari ios no support ...
... nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scri
pts to the standard over value used with ruby-align: start).samsung internet android no support nointer-character experimentalchrome no support noedge no support nofirefox no support noie no support noopera no support nosafari no support ...
text-decoration-skip-ink - CSS: Cascading Style Sheets
auto the default — the browser may interru
pt underlines and overlines so that they do not touch or closely approach a glyph.
... that is, they are interru
pted where they would otherwise cross over a glyph.
... all the browser must interru
pt underlines and overlines so that they do not touch or closely approach a glyph.
... this can be helpful with certain chinese, japanese, or korean (cjk) fonts, where the auto behavior might not create interru
ptions.
text-transform - CSS: Cascading Style Sheets
in greek (el), vowels lose their accent when the whole word is in uppercase (ά/Α), exce
pt for the disjunctive eta (ή/Ή).
... full-width is a keyword that forces the writing of a character — mainly ideograms and latin scri
pts — inside a square, allowing them to be aligned in the usual east asian scri
pts (like chinese or japanese).
... uppercase (greek vowels) <p>initial string <strong>Θα πάμε στο "Θεϊκό φαΐ" ή στη "Νεράιδα"</strong> </p> <p>text-transform: uppercase <strong><span>Θα πάμε στο "Θεϊκό φαΐ" ή στη "Νεράιδα"</span></strong> </p> span { text-transform: uppercase; } strong { float: right; } this demonstrates how greek vowels exce
pt disjunctive eta should have no accent, and the accent on the first vowel of a vowel pair becomes a diaeresis on the second vowel.
... recommendation from css level 1the definition of 'text-transform' in that specification., extends letters to non-latin bi-cameral scri
pts css level 1the definition of 'text-transform' in that specification.
<transform-function> - CSS: Cascading Style Sheets
descri
ption various coordinate models can be used to describe an html element's size and shape, as well as any transformations applied to it.
... html <main> <section id="example-element"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </section> <div class="select-form"> <label>select a transform function</label> <select> <o
ption selected>choose a function</o
ption> <o
ption>rotate(360deg)</o
ption> <o
ption>rotatex(360deg)</o
ption> <o
ption>rotatey(360deg)</o
ption> <o
ption>rotatez(360deg)</o
ption> <o
ption>rotate3d(1, 1, 1, 90deg)</o
ption> <o
ption>scale(1.5)</o
ption> <o
ption>scalex(1.5)</o
ption> <o
ption>scaley(1.5)</o
ption> <o
ption>scalez(1.5)</o
ption> <o
ption>scal...
...e3d(1, 1.5, 1.5)</o
ption> <o
ption>skew(17deg, 13deg)</o
ption> <o
ption>skewx(17deg)</o
ption> <o
ption>skewy(17deg)</o
ption> <o
ption>translate(100px, 100px)</o
ption> <o
ption>translatex(100px)</o
ption> <o
ption>translatey(100px)</o
ption> <o
ption>translatez(100px)</o
ption> <o
ption>translate3d(50px, 50px, 50px)</o
ption> <o
ption>perspective(200px)</o
ption> <o
ption>matrix(1, 2, -1, 1, 80, 80)</o
ption> <o
ption>matrix3d(1,0,0,0,0,1,3,0,0,0,1,0,50,100,0,1.1)</o
ption> </select> </div> </main> css main { width: 400px; height: 200px; padding: 50px; background-image: linear-gradient(135deg, white, cyan, white); } #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; ...
... background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: rotatey(-90deg) translatez(50px); } .top { background: rgba(210,210,0,.7); transform: rotatex(90deg) translatez(50px); } .bottom { background: rgba(210,0,210,.7); transform: rotatex(-90deg) translatez(50px); } .select-form { margin-top: 50px; } javascri
pt const selectelem = document.queryselector('select'); const example = document.queryselector('#example-element'); selectelem.addeventlistener('change', () => { if(selectelem.value === 'choose a function') { return; } else { example.style.transform = `rotate3d(1, 1, 1, 30deg) ${selectelem.value}`; settimeout(function() { example.style.transform = 'rotate3d(1, 1, 1, 30deg)'; ...
Media events - Developer guides
event name descri
ption abort sent when playback is aborted; for example, if the media is playing and is restarted from the beginning, this event is sent.
... canplaythrough sent when the readystate changes to have_enough_data, indicating that the entire media can be played without interru
ption, assuming the download rate remains at least at the current level.
... em
ptied the media has become em
pty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
... encry
pted the user agent has encountered initialization data in the media data.
HTML attribute: required - HTML: Hypertext Markup Language
if the attribute is not included, the :o
ptional pseudo class will match.
...conversely, inputs that support the required attribute but don't have the attribute set match the :o
ptional pseudo-class.
... note: setting aria-required="true" tells a screen reader that an element (any element) is required, but has no bearing on the o
ptionality of the element.
... constraint validation if the element is required and the element's value is the em
pty string, then the element is suffering from valuemissing and the element will match the :invalid pseudo class.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
a tainted canvas is one which is no longer considered secure, and any attem
pts to retrieve image data back from the canvas will cause an exce
ption to be thrown.
... if the source of the foreign content is an html <img> or svg <svg> element, attem
pting to retrieve the contents of the canvas isn't allowed.
... if the foreign content comes from an image obtained from either as htmlcanvaselement or imagebitmap, and the image source doesn't meet the same origin rules, attem
pts to read the canvas's contents are blocked.
... calling any of the following on a tainted canvas will result in an error: calling getimagedata() on the canvas's context calling toblob() on the <canvas> element itself calling todataurl() on the canvas attem
pting any of these when the canvas is tainted will cause a securityerror to be thrown.
Content-Type - HTTP
browsers will do mime sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header x-content-type-o
ptions can be set to nosniff.
... header type entity header forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (exce
pt 0x08 (tab)), "():<>?@[\]{}, and 0x7f (delete).
... <form action="/" method="post" enctype="multipart/form-data"> <input type="text" name="descri
ption" value="some text"> <input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: multipart/form-data; boundary=---------------------------974767299852498929531610575 -----------------------------974767299852498929531610575 content-...
...disposition: form-data; name="descri
ption" some text -----------------------------974767299852498929531610575 content-disposition: form-data; name="myfile"; filename="foo.txt" content-type: text/plain (content of the uploaded file foo.txt) -----------------------------974767299852498929531610575-- specifications specification title rfc 7233, section 4.1: content-type in multipart hypertext transfer protocol (http/1.1): range requests rfc 7231, section 3.1.1.5: content-type hypertext transfer protocol (http/1.1): semantics and content ...
Expect-CT - HTTP
the expect-ct header lets sites o
pt in to reporting and/or enforcement of certificate transparency requirements, to prevent the use of misissued certificates for that site from going unnoticed.
... header type response header forbidden header name yes syntax expect-ct: report-uri="<uri>", enforce, max-age=<age> directives max-age the number of seconds after rece
ption of the expect-ct header field during which the user agent should regard the host of the received message as a known expect-ct host.
... report-uri="<uri>" o
ptional the uri where the user agent should report expect-ct failures.
... enforce o
ptional signals to the user agent that compliance with the certificate transparency policy should be enforced (rather than only reporting compliance) and that the user agent should refuse future connections that violate its certificate transparency policy.
Network Error Logging - HTTP
this experimental header allows web sites and applications to o
pt-in to receive reports about failed (and, if desired, successful) network fetches from supporting browsers.
... usage web applications o
pt in to this behaviour with the nel header, which is a json-encoded object: nel: { "report_to": "nel", "max_age": 31556952 } an origin considered secure by the browser is required.
...the reporting group should also be set to include subdomains, if this o
ption is to be enabled.
....address_invalid the ip address is invalid tcp.address_unreachable the ip address is unreachable tcp.failed the tcp connection failed due to reasons not covered by previous errors http.error the user agent successfully received a response, but it had a 4xx or 5xx status code http.protocol.error the connection was aborted due to an http protocol error http.response.invalid response is em
pty, has a content-length mismatch, has improper encoding, and/or other conditions that prevent user agent from processing the response http.response.redirect_loop the request was aborted due to a detected redirect loop http.failed the connection failed due to errors in http protocol not covered by previous errors specifications specification network error logging ...
HTTP
web pages today very commonly load cross-site resources, including css stylesheets, images, scri
pts, and other resources.
... evolution of http a brief descri
ption of the changes between the early versions of http, to the modern http/2, the emergent http/3 and beyond.
... http request methods the different operations that can be done with http: get, post, and also less common requests like o
ptions, delete, or trace.
...with a few exce
ptions, policies mostly involve specifying server origins and scri
pt endpoints.
Values - MathML
lengths several mathml presentation elements have attributes that acce
pt length values used for size or spacing.
... mathml acce
pts different units and constants for specifying lengths.
... units unit descri
ption em font-relative unit ex font-relative unit.
... (the "x"-height of the element, 1ex ≈ 0.5em in many fonts) px pixels in inches (1 inch = 2.54 centimeters) cm centimeters mm millimeters
pt points (1 point = 1/72 inch) pc picas (1 pica = 12 points) % percentage of the default value.
<msubsup> - MathML
the mathml <msubsup> element is used to attach both a subscri
pt and a superscri
pt, together, to an expression.
... it uses the following syntax: <msubsup> base subscri
pt superscri
pt </msubsup>.
... subscri
ptshift the minimum space by which to shift the subscri
pt below the baseline of the expression, as a length value.
... superscri
ptshift the minimum space by which to shift the superscri
pt above the baseline of the expression, as a length value.
MathML element reference - MathML
if you want to learn more about content markup you should consider cha
pter 4 in the mathml 3 specification.
...expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscri
pts> (prescri
pts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscri
pt) 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> (subscri
pt) <msup> (superscri
pt) <msubsup> (subscri
pt-superscri
pt pair) t <mtable> (table or matrix) <mtd> (cell in a table or a matrix) <mtext> (text) <mtr> (row in a table or a matrix) u <munder> (underscri
pt) <munderover> (underscri
pt-overscri
pt pair) other elements <semantics> (container for semantic annotations) <annotation> (data annotations) <annotation-xml> (xml annotations) mathml presentation elements by category top-level elements <math> token elements <mglyph> <mi> <mn> <m...
...o> <ms> <mspace> <mtext> general layout <menclose> <merror> <mfenced> <mfrac> <mpadded> <mphantom> <mroot> <mrow> <msqrt> <mstyle> scri
pt and limit elements <mmultiscri
pts> <mover> <mprescri
pts> <msub> <msubsup> <msup> <munder> <munderover> <none> tabular math <maligngroup> <malignmark> <mlabeledtr> <mtable> <mtd> <mtr> elementary math <mlongdiv> <mscarries> <mscarry> <msgroup> <msline> <msrow> <mstack> uncategorized elements <maction> semantic annotations <annotation> <annotation-xml> <semantics> ...
Handling media support issues in web content - Web media technologies
a similar conce
pt can be applied to still images; if an image you wish to present is very large and may take time to download (especially for slower devices or connections), you can offer a lower-resolution or alternate version that will be displayed until the full-quality version is available to be displayed.
... poster frames for video progressive images images—whether embedded using <img> or <picture>—don't support a conce
pt similar to poster frames.
... specifying multiple sources checking compatibility in javascri
pt htmlmediaelement.canplaytype and mediasource.istypesupported...
... detecting playback errors ada
pting presentation with css memory management ...
Guide to streaming audio and video - Web media technologies
in this guide, we'll examine the techniques used to stream audio and/or video media on the web, and how you can o
ptimize your code, your media, your server, and the o
ptions you use while performing the streaming to bring out the best quality and performance possible.
... <<<...xxxxxx...>>> protocols in addition to the configuration of the server and the streaming code, there are sometimes special protocols which can be used to o
ptimize performance.
... for example, because many web sites' mobile-specific content assume that mobile browsers support hls, firefox for android does as well, in order to avoid strange compatibility errors from occurring due to this assum
ption being incorrect.
...additionally, forms of the stream can be provided which are o
ptimized for different network conditions.
Lazy loading - Web Performance
general code splitting javascri
pt, css and html can be split into smaller chunks.
... entry point splitting: separates code by entry point(s) in the app dynamic splitting: separates code where dynamic import() statements are used javascri
pt scri
pt type module any scri
pt tag with type="module" is treated like a javascri
pt module and is deferred by default.
... <link href="style.css" rel="stylesheet" media="all"> <link href="portrait.css" rel="stylesheet" media="orientation:portrait"> <link href="print.css" rel="stylesheet" media="print"> it is possible to perform some css o
ptimizations to achieve that.
... event handlers when browser compatibility is crucial, there are a few o
ptions: polyfill intersection observer fallback to scroll, resize or orientation change event handlers to determine if a specific element is in viewport specifications specification status comment html living standard living standard ...
Understanding latency - Web Performance
in terms of performance o
ptimization, it's important to o
ptimize to reduce causes of lacency and to test site performance emulating high latency to o
ptimizer for users with lousy connections.
...but websites generally involve multiple requests: the html includes requests for multiple css, scri
pts, and media files.
... in the developer tools, under the network table, you can switch the throttling o
ption to 2g, 3g, etc.
... different browser developer tools have different preset o
ptions, the characteristics emulated include download speed, upload speed, and minimum latency, or the minimum amount of type it takes to send a packet of data.
How to make PWAs installable - Progressive web apps (PWAs)
the content of the file looks like this: { "name": "js13kgames progressive web app", "short_name": "js13kpwa", "descri
ption": "progressive web app that lists games submitted to the a-frame category in the js13kgames 2017 competition.", "icons": [ { "src": "icons/icon-32.png", "sizes": "32x32", "type": "image/png" }, // ...
... descri
ption: a sentence or two explaining what your app does.
...beyond that, everything is o
ptional, though the descri
ption, short_name, and start_url fields are recommended.
...for instance, the prom
pt includes the app's name and icon.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
they run on a separate thread from the main javascri
pt code of our page, and don't have any access to the dom structure.
...this is very useful, as it allows us to interce
pt requests and respond to them with custom responses.
... here is a simple usage example: self.addeventlistener('fetch', (e) => { console.log('[service worker] fetched resource '+e.request.url); }); the response can be anything we want: the requested file, its cached copy, or a piece of javascri
pt code that will do something specific — the possibilities are endless.
...be sure to check out our further documentation if you want to learn more about the conce
pts behind the service worker api and how to use it in more detail.
clip-rule - SVG: Scalable Vector Graphics
the clip-rule attribute basically works as the fill-rule attribute, exce
pt that it applies to <clippath> definitions.
.../> </g> as a presentation attribute, it also can be used as a property directly inside a css stylesheet usage context categories presentation attribute value nonzero | evenodd | inherit animatable yes normative document svg 1.1 (2nd edition) nonzero see descri
ption of fill-rule property.
... evenodd see descri
ption of fill-rule property.
... example <svg width="100" viewbox="0 0 100 90" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- define star path --> <defs> <path d="m50,0 21,90 98,35 2,35 79,90z" id="star" /> </defs> <!-- left: evenodd --> <clippath id="em
ptystar"> <use xlink:href="#star" clip-rule="evenodd" /> </clippath> <rect clip-path="url(#em
ptystar)" width="50" height="90" fill="blue" /> <!-- right: nonzero --> <clippath id="filledstar"> <use xlink:href="#star" clip-rule="nonzero" /> </clippath> <rect clip-path="url(#filledstar)" width="50" height="90" x="50" fill="red" /> </svg> elements the following elements can use the clip-rule attribute, but only if they are inside a <clippath> element.
preserveAspectRatio - SVG: Scalable Vector Graphics
because the aspect ratio of an svg image is defined by the viewbox attribute, if this attribute isn't set, the preserveaspectratio attribute has no effect (with one exce
ption, the <image> element, as described below).
...ratio="none" x="0" y="30"> <use href="#smiley" /> </svg> </svg> path { fill: yellow; stroke: black; stroke-width: 8px; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; } rect:hover, rect:active { outline: 1px solid red; } syntax preserveaspectratio="<align> [<meetorslice>]" its value is made of one or two keywords: a required alignment value and an o
ptional "meet or slice" reference as described below: alignment value the alignment value indicates whether to force uniform scaling and, if so, the alignment method to use in case the aspect ratio of the viewbox doesn't match the aspect ratio of the viewport.
...note that if <align> is none, then the o
ptional <meetorslice> value is ignored.
... meet or slice reference the meet or slice reference is o
ptional and, if provided, must be one of the following keywords: meet (the default) - scale the graphic such that: aspect ratio is preserved the entire viewbox is visible within the viewport the viewbox is scaled up as much as possible, while still meeting the other criteria in this case, if the aspect ratio of the graphic does not match the viewport, some of the viewport ...
shape-rendering - SVG: Scalable Vector Graphics
on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" shape-rendering="geometricprecision"/> <circle cx="320" cy="100" r="100" shape-rendering="crispedges"/> </svg> usage notes value auto | o
ptimizespeed | crispedges | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, crisp edges and geometric precision, but with geometric precision given more importance than speed and crisp edges.
... o
ptimizespeed this value indicates that the user agent shall emphasize rendering speed over geometric precision and crisp edges.
... this o
ption will sometimes cause the user agent to turn off shape anti-aliasing.
... crispedges this value indicates that the user agent shall attem
pt to emphasize the contrast between clean edges of artwork over rendering speed and geometric precision.
SVG Attribute reference - SVG: Scalable Vector Graphics
umulate additive alignment-baseline allowreorder alphabetic amplitude arabic-form ascent attributename attributetype autoreverse azimuth b basefrequency baseline-shift baseprofile bbox begin bias by c calcmode cap-height class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentscri
pttype contentstyletype cursor cx cy d d decelerate descent diffuseconstant direction display divisor dominant-baseline dur dx dy e edgemode elevation enable-background end exponent externalresourcesrequired f fill fill-opacity fill-rule filter filterres filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style ...
... font-variant font-weight format from fr fx fy g g1 g2 glyph-name glyph-orientation-horizontal glyph-orientation-vertical glyphref gradienttransform gradientunits h hanging height href hreflang horiz-adv-x horiz-origin-x i id ideographic image-rendering in in2 interce
pt k k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes l lang lengthadjust letter-spacing lighting-color limitingconeangle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p ...
...ke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, text-decoration, text-rendering, transform, transform-origin, unicode-bidi, vector-effect, visibility, word-spacing, writing-mode filters attributes filter primitive attributes height, result, width, x, y transfer function attributes type, tablevalues, slope, interce
pt, amplitude, exponent, offset animation attributes animation attribute target attributes attributetype, attributename animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by, autoreverse, accelerate, decelerate animation addition attributes additive, accumulate event attri...
...butes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onem
ptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, ...
<svg> - SVG: Scalable Vector Graphics
value type: <string> ; default value: none; animatable: no contentscri
pttype deprecated since svg 2 the default scri
pting language used by the svg fragment.
... value type: <string> ; default value: application/ecmascri
pt; animatable: no contentstyletype deprecated since svg 2 the default style sheet language used by the svg fragment.
...etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippa...
...th>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <scri
pt>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<svg>' in that specification.
SVG element reference - SVG: Scalable Vector Graphics
orphology> <feoffset> <fepointlight> <fespecularlighting> <fespotlight> <fetile> <feturbulence> <filter> <foreignobject> g <g> h <hatch> <hatchpath> i <image> l <line> <lineargradient> m <marker> <mask> <mesh> <meshgradient> <meshpatch> <meshrow> <metadata> <mpath> p <path> <pattern> <polygon> <polyline> r <radialgradient> <rect> s <scri
pt> <set> <solidcolor> <stop> <style> <svg> <switch> <symbol> t <text> <textpath> <title> <tspan> u <unknown> <use> v <view> svg elements by category animation elements <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, <mpath>, <set> basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> container elements <a>, <defs>, <g>,...
... <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> descri
ptive elements <desc>, <metadata>, <title> filter primitive elements <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>,<fefunca>, <fefuncb>, <fefuncg>, <fefuncr>,<fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence> font elements <font>, <font-face>, <font-face-format>, <font-face-name>, <font-face-src>, <font-face-uri>, <hkern>, <vkern> gradient elements <lineargradient>, <meshgradient>, <radialgradient>, <stop> graphics elements <circle>, <ellipse>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <t...
...ext>, <use> graphics referencing elements <mesh>, <use> light source elements <fedistantlight>, <fepointlight>, <fespotlight> never-rendered elements <clippath>, <defs>, <hatch>, <lineargradient>, <marker>, <mask>, <meshgradient>, <metadata>, <pattern>, <radialgradient>, <scri
pt>, <style>, <symbol>, <title> paint server elements <hatch>, <lineargradient>, <meshgradient>, <pattern>, <radialgradient>, <solidcolor> renderable elements <a>, <circle>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <unknown>, <use> shape elements <circle>, <ellipse>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect> structural elements <defs>, <g>, <svg>, <symbol>, <use> text content element...
...s <altglyph>, <altglyphdef>, <altglyphitem>, <glyph>, <glyphref>, <textpath>, <text>, <tref>, <tspan> text content child elements <altglyph>, <textpath>, <tref>, <tspan> uncategorized elements <clippath>, <color-profile>, <cursor>, <filter>, <foreignobject>, <hatchpath>, <meshpatch>, <meshrow>, <scri
pt>, <style>, <view> obsolete and deprecated elements warning: these are old svg elements which are deprecated and should not be used.
Getting started - SVG: Scalable Vector Graphics
finally, svg can be created dynamically with javascri
pt and injected into the html dom.
... see this dedicated article which deals with the topic in-de
pth.
...avoid gzip-compressed svg exce
pt when you are publishing to a webserver that you know will serve it correctly (see below).
...for normal svg files, servers should send the http headers: content-type: image/svg+xml vary: acce
pt-encoding for gzip-compressed svg files, servers should send the http headers: content-type: image/svg+xml content-encoding: gzip vary: acce
pt-encoding you can check that your server is sending the correct http headers with your svg files by using the network monitor panel or a site such as websniffer.cc.
XPath snippets - XPath
this article provides some xpath code snippets—simple examples of how to a few simple utility functions based on standard interfaces from the dom level 3 xpath specification that expose xpath functionality to javascri
pt code.
...scri
pts in a web document which might be accessed by edge or internet explorer users should replace the call to new xpathevaluator() with the following fragment: // xpathevaluator is implemented on objects that implement document var xpe = anode.ownerdocument || anode; in that case the creation of the xpathnsresolver can be simplified as: var nsresolver = xpe.creatensresolver(xpe.documenteleme...
... example: javascri
pt code with the custom evaluatexpath() utility function // display the last names of all people in the doc var results = evaluatexpath(people, "//person/@last-name"); for (var i in results) alert("person #" + i + " has the last name " + results[i].value); // get the 2nd person node results = evaluatexpath(people, "/people/person[2]"); // get all the person nodes that have addresses in denver ...
...i()='"+(el.namespaceuri===null?'':el.namespaceuri)+"']["+pos+']'+'/'+xpath; el = el.parentnode; } xpath = '/*'+"[name()='"+xml.documentelement.nodename+"' and namespace-uri()='"+(el.namespaceuri===null?'':el.namespaceuri)+"']"+'/'+xpath; xpath = xpath.replace(/\/$/, ''); return xpath; } resources xpath forum discussion on this topic see also introduction to using xpath in javascri
pt ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
o
ptional attributes count specifies what in the source tree should be numbered sequentially.
...the processor goes to the first node in the ancestor-or-self axis that matches the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the count attribute.if no match is found, the sequence will be an em
pty list.
...if no match is found, the sequence will be an em
pty list.
...if no match to the count attribute is found, the sequence will be an em
pty list.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
the javascri
pt loads the .xsl file only on the first sort and sets the xslloaded variable to true once it has finished loading the file.
...it defaults to ascending if the parameter is em
pty (the first time the sorting happens, as there is no value for it in the xslt file).
... the xslt file has a parameter called myorder that javascri
pt sets to change the sorting method.
... figure 7: sorting based on div contentview example // xhtml fragment: <div id="example"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> </div> // javascri
pt var xslref; var xslloaded = false; var xsltprocessor = new xsltprocessor(); var mydom; var xmlref = document.implementation.createdocument("", "", null); function sort() { if (!xslloaded){ p = new xmlhttprequest(); p.open("get", "example2.xsl", false); p.send(null); xslref = p.responsexml; xsltprocessor.importstylesheet(xslref); xslloaded = true; } // create a n...
Introduction - XSLT: Extensible Stylesheet Language Transformations
introduction with modern browsers supporting xslt, developers can now use javascri
pt to access the power that xslt provides.
... javascri
pt can enable a web application to load xml data, process it via xslt into a presentable form and then add it into an existing document.
... as of mozilla 1.2, gecko enables javascri
pt to create xslt processors.
... this article covers xslt/javascri
pt bindings in gecko.
Setting Parameters - XSLT: Extensible Stylesheet Language Transformations
setting parameters while running transformations using precoded .xsl and .xml files is quite useful, configuring the .xsl file from javascri
pt may be even more useful.
... for example, javascri
pt and xslt could be used to sort xml data and then display it.
...xsltprocessor provides three javascri
pt methods to interact with these parameters: xsltprocessor.setparameter(), xsltprocessor.getparameter() and xsltprocessor.removeparameter().
... figure 7 : parameters /* xslt: <xsl:param name="myorder" /> */ // javascri
pt: var sortval = xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending") xsltprocessor.setparameter(null, "myorder", "ascending"); else xsltprocessor.setparameter(null, "myorder", "descending"); ...
Caching compiled WebAssembly modules - WebAssembly
this includes compiled wasm modules (webassembly.module javascri
pt objects).
... in our wasm-utils.js library scri
pt, you'll find instantiatecachedurl() — this function fetches the wasm module at url with a version of dbversion, instantiates it with the given importobject, and returns a promise resolving to the finished wasm instance.
... additionally, it handles creating a database to cache the compiled wasm modules in, attem
pts to store new modules in the database, and retrieves previously cached modules from the database, saving you from having to download them again.
...(results => { storeindatabase(db, results.module); return results.instance; }); }) }, note: it is for this kind of usage that webassembly.instantiate() returns both a module and an instance: the module represents the compiled code and can be stored/retrieved in idb or shared between workers via postmessage(); the instance is stateful and contains the callable javascri
pt functions, therefore it cannot be stored/shared.
SDK API Lifecycle - Archive of obsolete content
at the same time, developers maintaining and extending the sdk's apis need to be able to introduce new apis that aren't yet fully proven, and to retire old apis when they're no longer o
ptimal or supported by the underlying platform.
... stability index the stability index is ado
pted from node.js.
... attem
pts to use a deprecated module at runtime will log an error to the error console.
SDK and XUL Comparison - Archive of obsolete content
advantages of the sdk simplicity the sdk provides high-level javascri
pt apis to simplify many common tasks in add-on development, and tool support which greatly simplifies the process of developing, testing, and packaging an add-on.
... advantages of xul-based add-ons user interface flexibility xul overlays offer a great deal of o
ptions for building a ui and integrating it into the browser.
... using only the sdk's supported apis you have much more limited o
ptions for your ui.
clipboard - Archive of obsolete content
usage you can o
ptionally specify the type of the data to set and retrieve.
...o
ptional.
... parameters datatype : string retrieve the clipboard contents only if matching this type (o
ptional).
hotkeys - Archive of obsolete content
globals constructors hotkey(o
ptions) creates a hotkey whose onpress listener method is invoked when key combination defined by hotkey is pressed.
... parameters o
ptions : object required o
ptions: name type combo string any function key: "f1, f2, ..., f24" or key combination in the format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys require at least one modifier as well as the key.
...on the macintosh, this is the o
ption key.
More Button Features - Archive of obsolete content
for example, the following will create a button where two of the words are red: example 4 : source view <button> <descri
ption value="this is a"/> <descri
ption value="rather strange" style="color: red;"/> <descri
ption value="button"/> </button> any xul element may be placed inside the button.
... html elements will be ignored, so you need to wrap them inside a descri
ption element.
...this type of button is intended to be used like a menu, with scri
pts attached to each item to perform a task.
More Wizards - Archive of obsolete content
a scri
pt will adjust the next attributes as necessary to go to the page with the page id color when needed.
... wizard functions the wizard works much like a tabbed panel, exce
pt that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom.
... wizard example source <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <scri
pt> function checkcode(){ document.getelementbyid('thewizard').canadvance = (document.getelementbyid('secretcode').value == "cabbage"); } </scri
pt> <wizardpage onpageshow="checkcode(); return true;"> <label value="enter the secret code:"/> <textbox id="secretcode" onkeyup="checkcode();"/> </wizardpage> <wizardpage> <label value="that is the correct secret code."/> </...
Simple Menu Bars - Archive of obsolete content
the menu bar can o
ptionally be placed inside a toolbox and the menu would work just like any other toolbar.
... you can customize the menus on the menubar to have whatever you want on them on all platforms exce
pt the macintosh.
...it acce
pts some of the same attributes plus some additional ones: id the unique identifier of the menu title button.
Stack Positioning - Archive of obsolete content
you can use a scri
pt to adjust the value of the left and top attributes and thus make the elements move around.
... when responding to mouse events, the elements on top will ca
pture the events first.
... that means that if two buttons overlap, the top button will ca
pture a mouse click where it covers the other one.
Using Spacers - Archive of obsolete content
it works much the same way as a button exce
pt it does not draw on screen.
...instead, it specifies how em
pty space it divided among the children of a container box.
...once the default sizes of the children of a box are determined, the flexibility values are used to divide up the remaining em
pty space in the box.
XBL Attribute Inheritance - Archive of obsolete content
in addition, changing the value of the attributes on the searchbox with a scri
pt will update the textbox and button also.
...for example, to create a labeled textbox (a textbox with a text descri
ption beside it) out of a label and a textbox element, the label will need to inherit its text from the value attribute and the textbox will also need to inherit its default value from the value attribute as well.
...if you need to map an attribute to the text content of the node, use "xbl:text" as the inner attribute, eg: <xul:descri
ption xbl:inherits="xbl:text=value"/> in the next section, we look at adding properties, methods and events to a binding.
Using nsIXULAppInfo - Archive of obsolete content
this is not useful for scri
pts on webpages, which should continue using the navigator object when it's not possible to rely on feature-detection.
...the following sections provide a few examples of using nsixulappinfo from javascri
pt.
...for complete list of nsixulappinfo's properties, please see nsixulappinfo interface descri
ption.
arrowscrollbox - Archive of obsolete content
tton label="silver"/> <button label="lavender"/> <button label="gold"/> <button label="turquoise"/> <button label="peach"/> <button label="maroon"/> <button label="black"/> </arrowscrollbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width clicktoscroll...
... visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... 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, toolti
ptext, top, width disabled type: boolean gets and sets the value of the disabled attribute.
bindings - Archive of obsolete content
this element is o
ptional in firefox 3/mozilla 1.9 and later; instead binding elements may be placed directly inside the rule element.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width object type: string the object of the element.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
colorpicker - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...a change event is fired in different ways for different xul input elements as listed below: onchange type: scri
pt code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the scri
pt context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <scri
pt type="text/javascri
pt"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </scri
pt> <textbox id="find-text" onchange="return myfunction(event);"/> </window> preference type: id connects the element to a corresponding preference.
deck - Archive of obsolete content
attributes selectedindex properties selectedindex, selectedpanel examples <deck selectedindex="2"> <descri
ption value="this is the first page"/> <button label="this is the second page"/> <box> <descri
ption value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selectedindex type: integer gets and sets the index of the currently selected panel.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties selectedindex type: integer returns the index of the currently selected item.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
grid - Archive of obsolete content
the second column is twice as big as the first column --> <groupbox> <ca
ption label="details"/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="user name"/> <textbox id="user"/> </row> <row> <label value="group"/> <menulist> <menupopup> <menuitem label="accounts"/> <menuitem label="sales" selected="true"/> ...
... <menuitem label="support"/> </menupopup> </menulist> </row> </rows> </grid> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), inse...
hbox - Archive of obsolete content
this is equivalent to the box element, exce
pt it defaults to horizontal orientation.
... example <!-- two button on the right --> <hbox> <spacer flex="1"/> <button label="connect"/> <button label="ping"/> </hbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties inherited propertie...
...s 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasatt...
keyset - Archive of obsolete content
attributes disabled examples <keyset> <key id="sample-key" modifiers="shift" key="r"/> </keyset> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width disabled typ...
... visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytag...
listcell - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...if this attribute is em
pty or left out, no image appears.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
listhead - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
listheader - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
listitem - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...if this attribute is em
pty or left out, no image appears.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
menuseparator - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...if this attribute is em
pty or left out, no image appears.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
page - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] similar to a window, exce
pt it should be used for xul files that are to be loaded into an iframe.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hi...
...dden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceur...
popupset - Archive of obsolete content
this element is o
ptional; the given elements need not appear in a popupset container.
...t> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> <label value="right click for popup" context="clipmenu"/> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
preferences - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element.
...see also the descri
ption of change event of <preference>.
progressmeter - Archive of obsolete content
for instance, if no maximum value has been set, setting the value to "0" shows an em
pty bar, "100" shows a bar at full length and "25" shows the first quarter of the bar.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
query - Archive of obsolete content
for xml datasources, the query should have an expr attribute and may o
ptionally contain assign elements.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
radio - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...if this attribute is em
pty or left out, no image appears.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
separator - Archive of obsolete content
it is functionally equivalent to a spacer exce
pt it defaults to a small size (usually 1.5 ems).
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
tabbox - Archive of obsolete content
parent keyboard navigation is ca
ptured at the parent of the tabbox.
... window keyboard navigation is ca
ptured at the window level.
... document keyboard navigation is ca
ptured at the document level.
tabpanel - Archive of obsolete content
this element is o
ptional and you may just use any other container in place of it.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controlle...
...rs, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequ...
treecols - Archive of obsolete content
attributes pickertoolti
ptext properties accessibletype examples (example needed) attributes pickertoolti
ptext type: string the text for the tooltip on the column picker.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
... inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfe...
treeitem - Archive of obsolete content
attributes container, em
pty, label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements.
... em
pty type: boolean set to true if the element is a container that contains no children.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
triple - Archive of obsolete content
in an rdf file this would usually be an rdf descri
ption element.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
vbox - Archive of obsolete content
this is equivalent to the box element, exce
pt it defaults to vertical orientation.
... example <!-- two labels at bottom --> <vbox> <spacer flex="1"/> <label value="one"/> <label value="two"/> </vbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute()...
Deploying XULRunner - Archive of obsolete content
registration and app installation are performed with command line switches as outlined in the xulrunner section of article command line o
ptions.
... it may turn out to be easier to create a self contained portable application, as described here, and deploy it with a generic installer that would create shortcuts to scri
pts that launch your application in the unregistered bundled xulrunner.
...other executables and libraries the core changes to xul and gecko that require this new file layout were implemented in gecko 34, exce
pt that the xulrunner application was not updated to know about the change, so it will report an error: "unable to load xpcom." xulrunner was fixed in gecko 39.
How to enable locale switching in a XULRunner application - Archive of obsolete content
normally the application locale is inherited from the os environment of the host system, however there are situations when you might want to give users the o
ption to override the default setting and choose a different locale.
...here is a code snippet showing how this is done: the definition of the xul control: <listbox id="locale-listbox"> <!-- generated list items go in here --> </listbox> <button label="&switchlocale.button;" oncommand="changelocale()"/> the javascri
pt code to populate the control: try { // query available and selected locales var chromeregservice = components.classes["@mozilla.org/chrome/chrome-registry;1"].getservice(); var xulchromereg = chromeregservice.queryinterface(components.interfaces.nsixulchromeregistry); var toolkitchromereg = chromeregservice.queryinterface(components.interfaces.nsitoolkitchromeregistry); var selectedloca...
...components.interfaces.nsiprefbranch); prefs.setcharpref("general.useragent.locale", newlocale); // restart application var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); appstartup.quit(components.interfaces.nsiappstartup.erestart | components.interfaces.nsiappstartup.eattem
ptquit); } catch(err) { alert("couldn't change locale: " + err); } } * * * here i include a complete xulrunner application example that demonstrates the locale switching.
MacFAQ - Archive of obsolete content
to enable the mac "about" menu make sure that you use "aboutname" as the id for your menu item to enable the mac "preferences" menu make sure that you use "menu_preferences" as the id for your o
ptions/preferences menu item toolbars mac windows have a small "jelly bean" button in the top right corner.
...debug function and nsicommandline try/catch can be removed, all you need is the window.arguments[0]) <?xml version="1.0"?> <window 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 --> <scri
pt type="application/javascri
pt" src="chrome://global/content/nsusersettings.js" /> <scri
pt><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.logstringmessage("myxul: " + alogstring + "\n"); } function checkothe...
...ces.nsicommandline); for (var i = 0; i < cmdline.length; ++i) { debug(cmdline.getargument(i)) } } catch(ex) { debug(window.arguments[0]) // do something with window.arguments[0] //nspreferences.setunicharpref("myxul.cmdlinevalue", window.arguments[0]) } window.addeventlistener("load", checkotherwindows , false); } ]]></scri
pt> </window> ...
calICalendarViewController - Archive of obsolete content
calendar/base/public/calicalendarviewcontroller.idlscri
ptable please add a summary to this article.
... interface code [scri
ptable, uuid(1f783898-f4c2-4b2d-972e-360e0de38237)] interface calicalendarviewcontroller : nsisupports { void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); void modifyoccurrence (in caliitemoccurrence aoccurrence, in calidatetime anewstarttime, in calidatetime anewendtime); void deleteoccurrence (in caliitemoccurrence aoccurrence); }; methods createnewevent void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); the createnewevent method is used for creating a new calievent in the calicalendar specified by the acalendar parameter.
...the calidatetime parameters are o
ptional, but aendtime cannot be included without astarttime.
reftest opportunities files - Archive of obsolete content
if you can look at the html in one of these pages, and can see a way to get the same visual ou
ptut, then that is an obvious reftest opportunity.
...ser/htmlparser/tests/html/pre007.html parser/htmlparser/tests/html/pre006.html parser/htmlparser/tests/html/pre005.html parser/htmlparser/tests/html/pre004.html parser/htmlparser/tests/html/pre003.html parser/htmlparser/tests/html/pre002.html parser/htmlparser/tests/html/pre001.html parser/htmlparser/tests/html/param002.html parser/htmlparser/tests/html/param001.html parser/htmlparser/tests/html/o
ption.html parser/htmlparser/tests/html/obj003.html parser/htmlparser/tests/html/obj002.html parser/htmlparser/tests/html/obj001.html parser/htmlparser/tests/html/nulltest.html parser/htmlparser/tests/html/newlines.html parser/htmlparser/tests/html/list003.html parser/htmlparser/tests/html/list002.html parser/htmlparser/tests/html/list001.html parser/htmlparser/tests/html/layer01.html parser/htmlpar...
.../tests/html/bug1259.html parser/htmlparser/tests/html/bug12468.html parser/htmlparser/tests/html/bug12269.html parser/htmlparser/tests/html/bug12118.html parser/htmlparser/tests/html/bug11381.html parser/htmlparser/tests/html/bug10324.html parser/htmlparser/tests/html/bug10049.html parser/htmlparser/tests/html/br001.html parser/htmlparser/tests/html/bigtxt.html parser/htmlparser/tests/html/bigscri
pt.html parser/htmlparser/tests/html/bdo001.html parser/htmlparser/tests/html/badscri
pt.html parser/htmlparser/tests/html/attribute_quote_bug1.html parser/htmlparser/tests/html/atoi01.html parser/htmlparser/tests/html/aname01.html parser/htmlparser/tests/html/acronym1.html parser/htmlparser/tests/html/table_illegal_2.html parser/htmlparser/tests/html/table_illegal_1.html parser/htmlparser/tests/html...
2006-11-10 - Archive of obsolete content
building xulrunner application with mozilla november 8th: kirans is trying to build mozilla with xulrunner o
ption on a windows machine.
... november 9th: jonathan watt responded to his posting stating that he must have the wrong line endings in his mozconfig or some other scri
pt fill that he is probably using to run.
... build problem firefox 2.0 on fc3 november 10th: vin downloaded the latest firefox 2 rc3 and tried to build it on fc3 with the following o
ptions: ./configure --enable-application=browser --prefix=$prefix --enable-extensions=default,spatialnavigation then he tried running "make" and received the following error: /usr/bin/ld: testtarray.o(.text+0x2237): unresolvable relocation against symbol `nstarray_base::sem
ptyhdr' /usr/bin/ld: final link failed: nonrepresentable section on output collect2: ld returned 1 exit status gmake[3]: *** [testtarray] error 1 gmake[3]: leaving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: leaving directory `/usr/mozilla2/...
2006-12-08 - Archive of obsolete content
discussions xpcom cpp to js callback engaging discussion on a problem with trying to call back from c++ to a javascri
pt object using an interface the developer created with an idl.
... however, the c++ call that's supposed to be invoking the method on the javascri
pt object is returning with 0x80004005 (ns_error_failure).
... saving binary data from nsixmlhttprequest a discussion on how to use nsixmlhttprequest object to query data from a url in an extension implemented in javascri
pt meetings none during this week.
NPAPI plugin developer guide - Archive of obsolete content
to make your plugin scri
ptable from web pages, use npruntime.
... embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scri
ptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shutdown initialize and shutdown example dra...
...lug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can acce
pt writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http server uploading files to an ftp server sending...
NPN_Invoke - Archive of obsolete content
« gecko plugin api reference « scri
pting plugins summary invokes a method on the given npobject.
...descri
ption the method arguments are passed as an array of npvariants, and the number of arguments is passed in.
...note: early on in the development of the scri
ptability api this method used to be called npn_call() but was renamed for consistency.
NPN_PostURL - Archive of obsolete content
descri
ption npn_posturl works similarly to npn_geturl, but in reverse.
...the file-type url prefix "file://" is o
ptional.
...plug-ins can use this function to post form data to cgi scri
pts using http or upload files to a remote server using ftp.
NPN_SetValue - Archive of obsolete content
variable values the function can set: nppvpluginwindowbool: sets windowed/windowless mode for plugin display; true=windowed, false=windowless nppvplugintransparentbool: sets transparent mode for display of a plugin; true=transparent, false=opaque nppvjavaclass nppvpluginwindowsize nppvplugintimerinterval nppvpluginscri
ptableinstance nppvpluginscri
ptableiid nppvjavascri
ptpushcallerbool: specifies whether you are pushing or popping the jscontext off the stack nppvpluginkeeplibraryinmemory: tells browser that the plugin dll should live longer than usual nppvpluginneedsxembed nppvpluginscri
ptablenpobject nppvformvalue nppvplugindrawingmodel value the value of the specified variable to be set.
... descri
ption a good place to set plugin operation mode such as windowless mode is npp_new, so the browser knows right away what mode the plugin is designed to operate in.
... nppvjavascri
ptpushcallerbool sets whether you are pushing or popping the appropriate jscontext off the stack (see the two-way scri
ptability article on the mozilla plugins project page for more details).
NPP_New - Archive of obsolete content
descri
ption npp_new creates a new instance of a plug-in.
...this gives developers a chance to use private attributes to communicate instance-specific o
ptions or other information to the plug-in.
... place private o
ptions at the end of the list of standard attributes in the embed tag.
Browser API
browser api conce
pts and usage the browser api consists of two major parts: custom <iframe> attributes: by adding a mozbrowser attribute to the <iframe> element we can make it appear like a top-level browser window to the embedded content.
... htmliframeelement.executescri
pt() allows a specified scri
pt to be executed against a page loaded in the browser <iframe>.
... mozbrowsershowmodalprom
pt sent when alert(), confirm(), or prom
pt() are called within a browser <iframe>.
MozBeforePaint
gecko 2.0 adds a new method for performing javascri
pt controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.
... <!doctype html> <html> <body> <div id="d" style="width:100px; height:100px; background:lime; position:relative;"></div> <scri
pt> var d = document.getelementbyid("d"); var start = window.mozanimationstarttime; function step(event) { var progress = event.timestamp - start; d.style.left = math.min(progress/10, 200) + "px"; if (progress < 2000) { window.mozrequestanimationframe(); } else { window.removeeventlistener("mozbeforepaint", step, false); } } window.addeventlistener("mozbeforepaint", step, false); w...
...indow.mozrequestanimationframe(); </scri
pt> </body> </html> as you can see, each time the mozbeforepaint event fires, our step() method is called.
How to add a build-time test
in <tt>yourmoduledir/tests_type/makefile.in</tt> change de
pth, module, and xpcshell_tests appropriately: de
pth should be a relative path pointing to <tt>mozilla/</tt>, e.g.
... if you're in <tt>netwerk/test</tt>, set de
pth = ../..
... reference the test dir in a parent makefile (<tt>yourmoduledir/makefile.in</tt>): ifdef enable_tests dirs += tests_type endif (o
ptional, but recommended) add the new makefile to allmakefiles.sh (todo: need more details about this) reconfigure (e.g.
How to Report a Hung Firefox
the tool also has command-line o
ptions to kill processes with other names or by process id.
... another way to trigger a crash in a hung tab is to run the following scri
pt in the browser console (opened after selecting the hung tab): let wm = cc["@mozilla.org/appshell/window-mediator;1"].
... getservice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("navigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescri
pt('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getservice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_type_default) {components.utils.import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.int
ptr_t(8);var bad
ptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t));var crash = bad
ptr.contents;}', true); } other techniques on os x if you use a nightly build (>= firefox 16), you can use activity monitor's "sample process" feature to generate a sample.
AddonUpdateChecker
dates[], 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 descri
ption error_timeout the update check timed out.
... 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 o
ptional parameter to get the first compatibility update that is compatible with any version of the application or toolkit 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 getnewestcompatibleupdate() returns the newest available update from a list of update objects.
... 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 o
ptional update key for the add-on url the url of the add-on's update manifest listener an observer to notify of results ...
Geometry.jsm
the geometry.jsm javascri
pt code module provides routines for performing common geometry operations on points and rectangles.
...to use these routines, you first need to import the code module into your javascri
pt scope: components.utils.import("resource://gre/modules/geometry.jsm"); once you've imported the module, you can then use the point and rect classes.
... note: although this module is usable from mobile, and is present in firefox 4, it's currently not used in firefox 4 and attem
pting to use it may produce unreliable results there.
Interfacing with the Add-on Repository
the add-on repository javascri
pt code module makes it easy for your extension to interface with the amo repository.
...archsucceeded: function(addons, addoncount, totalresults) { var num = math.floor(math.random() * addoncount); this.shownotification("would you like to try the " + addons[num].name + " addon?", "install", addons[num].install); }, this routine randomly selects one of the returned add-ons, then calls the previously mentioned shownotification() routine, passing in as parameters a prom
pt including the name of the returned add-on, a label for the button to show in the notification ("install"), and the addoninstall object that can be used with the add-on manager api to install the add-on.
... installing the add-on the shownotification() routine displays a notification box offering to install the recommended add-on, if one was found, or reports an error if the search failed: shownotification: function(prom
pt, button, installobj) { this.install = installobj; var box = popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", prom
pt, null, /* anchor id */ { label: button, accesskey: "i", callback: function() { if (popupnotifications.install) { popupnotifications.install.install(); } else { popupnotifications.remove(box); } } }, null /* secondary action */ ); } the code here starts by s...
OS.File.Info
before deprecation, this used to be the date at which the file was created on windows and mac os x, as a javascri
pt date object.
...on older unix filesystems it is not possible to get a creation date as it was never stored, on new unix filesystems creation date is stored but the method to obtain this date differs per filesystem, bugzilla :: bug 1167143 explores implementing solutions for all these different filesystems) lastaccessdate the date at which the file was last accessed, as a javascri
pt date object.
... lastmodificationdate the date at which the file was last modified, as a javascri
pt date object.
openLocationLastURL.jsm
(bug 953124) the openlocationlasturl.jsm javascri
pt code module lets you set and retrieve the url most recently opened using the "open location" o
ption in the file menu.
... to use this, you first need to import the code module into your javascri
pt scope: components.utils.import("resource:///modules/openlocationlasturl.jsm"); once you've imported the module, you can then use the openlocationlasturl object it exports.
...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 em
pty 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 em
pty string.
Bootstrapping a new locale
descri
ption of phases.
... set up for building the next step is to create a .mozconfig file with the compile o
ptions for the localized build of firefox, and to set up the object directory for the localized build.
... cd mozilla-1.9.1 echo "mk_add_o
ptions moz_objdir=@topsrcdir@/../fx-ab-dc" > .mozconfig echo "ac_add_o
ptions --with-l10n-base=../" >> .mozconfig echo "ac_add_o
ptions --disable-compile-environment" >> .mozconfig echo "ac_add_o
ptions --enable-application=browser" >> .mozconfig make -f client.mk configure create a language pack first, we'll create a build directory.
Encodings for localization files
there are a few exce
ptions, though.
...for most western scri
pts, ‘ms sans serif’ and ‘8’ are good defaults for the font settings.
... eastern scri
pts will need to choose appropriate fonts that are shipped with windows.
L10n Checks
l10n checks is a python scri
pt and library similar to compare-locales.
...you pass the path to the xpi file (o
ptionally) followed by the locale codes of the locales you want to compare.
...o
ptions reference locale in the source and xpi modes you can change the default reference locale (en-us) by setting the -r parameter, e.g.: check-l10n-completeness -r pl browser/locales/l10n.ini ../l10n/ de output mode you can change the look and feel of the output by setting the -o parameter to 0 (tree; default), 1 (full tree) or 2 (full relative paths), e.g.: check-l10n-completeness -o 2 browser/l...
Localizing extension metadata on addons.mozilla.org
the localizable data fields of an extension are: name homepage summary descri
ption eula privacy policy version notes developer comments when you submit a new extension to amo, the process is divided into several steps.
...remember, all fields are o
ptional when localizing.
...here is a list of the codes: arabic (ar), catalan (ca), czech (cs), danish (da), german (de), greek (el), basque (eu), spanish (es-es), farsi (fa), finnish (fi), french (fr), gaeilge (ga-ie), hebrew (he), hungarian (hu), indonesian (id), italian (it), japanese (ja), korean (ko), mongolian (mn), dutch (nl), polish (pl), brazilian portuguese (
pt-br), european portuguese (
pt-
pt), romanian (ro), russian (ru), slovakian (sk), albanian (sq), swedish (sv-se), ukrainian (uk), vietnamese (vi), chinese (zh-cn) and taiwanese (zh-tw).
Localizing with Mercurial
# debian/ubuntu $ a
pt-get install mercurial # fedora $ yum install mercurial # gentoo $ emerge mercurial # arch linux $ pacman -s mercurial # opensolaris $ pkg install sunwmercurial if you prefer a graphical interface, you can download and install mercurialeclipse here.
... mercurial on windows with windows, you have a couple of install o
ptions: for a command line interface, download and install mozillabuild package.
...if you don't see path among the o
ptions, you'll have to click add and edit it within the add dialog.
Initial setup
compare-locales compare-locales is a python scri
pt that helps you check your work without needing to run firefox or another application.
... l10n checks l10n checks is another python scri
pt that helps you check your work without running an application.
... python python is a programming language in which many of our l10n testing scri
pts are written.
wrappedJSObject
when available, it lets you access the javascri
pt object hidden by the wrapper.
...see how to build an xpcom component in javascri
pt for details on creating one.
...etservice(); if we try to call the hello() method we defined in our component implementation, we get: > comp.hello(); typeerror on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is not the helloworld js object itself, but an xpconnect wrapper around it: > dump(comp); [xpconnect wrapped nsisupports] the idea of these wrappers is to make the javascri
pt-implemented xpcom components look just like any other xpcom component to the user.
XPIDL Syntax
string_literal = 1*(%x22 *(any char exce
pt %x22 or %x0a) (%x22 / %x0a)) ; same as above, but s/"/'/g char_literal = 1*(%x27 *(any char exce
pt %x27 or %x0a) (%x27 / %x0a)) type_spec = "float" / "double" / "string" / "wstring" type_spec /= ["unsigned"] ("short" / "long" / "long" "long") type_spec /= "char" / "wchar" / "boolean" / "octet" type_spec /= scoped_name prop_list = "[" *(property ",") property "]" property = ident [pare...
...ns] 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 exce
pt ")") ")" functionality not used in xpidl the libidl parser we use is more powerful than xpidl itself can understand.
... 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) exce
ption 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.
xpidl
xpidl is a tool for generating xpcom interface information, based on xpidl interface descri
ption files.
... it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface xpconnect typelib files (.x
pt), with runtime type information to dynamically call xpcom objects through xpconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk.
...``/tmp/nsithing) for output -e use explicit output filename -d write dependencies (requires -e) -m specify output mode: header generate c++ header (.h) typelib generate xpconnect typelib (.x
pt) doc generate html documentation (.html) java generate java interface (.java) ...
Mozilla technologies
the module is structured as a drop-in component and exposes its xml-as-data features both to javascri
pt and c++/xpcom users.
...it has multiple language bindings, allowing xpcom components to be used and implemented in javascri
pt, java, and python in addition to c++.xpidlxpidl is an interface descri
ption language used to specify xpcom interface classes.xray visiongecko runs javascri
pt from a variety of different sources and at a variety of different privilege levels.xslt 2.0although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascri
pt) to perform xslt 2.0.xtfthe extensible tag framework (xtf) allows adding support for new namespa...
...ces using xpcom components to mozilla (written in javascri
pt or c++).
Mail composition back end
this will change in the coming weeks and allow for developers to write javascri
pt to take advantage of the back end services.
...i will try to make comments for these exce
ptions.
... ns_imethod onstopsending( nsresult astatus, - the resulting status for the send operation const prunichar *amsg, - a status message pruint32 atotaltried, - the total messages that were attem
pted pruint32 asuccessful) = 0; - the number of successful messages quoting quoting a mail message is made possible via the nsimsgquote interface.
Main Windows
the rest is loaded from overlays: mailwindowoverlay.xul this is the red sections shown in the interface above (where?), including the toolbars, notification bars, and the status bar, but also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascri
pt.
... mailoverlay.xul a really small overlay that only adds a few “new message” and “new card” commands to the menus, along with their associated javascri
pt.
... mailwindowoverlay.xul this is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.it also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascri
pt.
Adding items to the Folder Pane
the result is a javascri
pt file that will add a "numbers" container to the end of thunderbird's "all folders" mode.
...[]; for (var i = 1; i <= this._numbers; i++) this._children.push(new numberrow(i)); } return this._children; }, getproperties: function gne_getprops() { // put your css attributes here }, command: function gne_command() { // just going to alert, to do something here components.classes["@mozilla.org/embedcomp/prom
pt-service;1"] .getservice(components.interfaces.nsiprom
ptservice) .alert(window, null, this.text); } }; second, our child items (the numbers 1, 2, and 3) are copies of the following prototype: function numberrow(anumber) { this._number = anumber; } numberrow.prototype = { get id() { return "numbers-child-row-" + this._number; }...
..., get text() { return this._number; }, level: 1, open: false, children: [], getproperties: function gne_kid_getprops() {}, // no-op command: function gne_kid_command() { // just going to alert, to do something here components.classes["@mozilla.org/embedcomp/prom
pt-service;1"] .getservice(components.interfaces.nsiprom
ptservice) .alert(window, null, this.text); } }; putting it all together all that is left at this point is to actually add these newly defined folder-tree-items to the folder pane's _rowmap at the appropriate time.
Thunderbird extensions
gloda provides conce
pts such as conversations, messages, identities, contacts.
... all these conce
pts are related : a conversation contains messages which are linked to identities (from field, to field) which are themselves part of a contact: indeed, a contact has multiple identities.
...erbird community / communications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird communication channels add-on developers forum/mailing list #maildev irc channel more general : mozillazine extension development forum general developer channels related topics xul, javascri
pt, xpcom, themes, developing mozilla categori ...
Using Mozilla code in other projects
various components of the platform, such as the spidermonkey javascri
pt engine, can be used in your own projects without the rest of the platform.
... there are also modules that aren't used in firefox but are available for use by other applications; an example of this is rhino, the javascri
pt engine written in java.
... using mozilla components spidermonkey spidermonkey is the javascri
pt runtime engine used by mozilla projects.
Examples
js-macosx an extension that demonstrates javascri
pt-cocoa bridge for mac os x.
... lightweight bridge for calling cocoa frameworks from javascri
pt, js-macosx transparently handles definition of cocoa api, both c and objective-c, and provides automatic declarations for framework functions, structures, constants and enumerations, as well as allows creating and subclassing cocoa classes.
... the js-macosx bridge has dependency on bridgesupport metadata: whenever a cocoa class, function, struct or const is encountered in the javascri
pt code, js-macosx will replace it with the corresponding js-ctypes declaration based on the bridgesupport file from the framework that object belongs to.
Debugging Tips
= components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p); let pp = p.address(); console.log(pp); the result will be as following: cdata { value: 10 } cdata { x: 10, y: 20 } cdata { contents: cdata } to see more descri
ptive information, you can use .tosource().
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.tosource()); let pp = p.address(); console.log(pp.tosource()); the result will be : ctypes.int32_t(10) point(10, 20) point.
ptr(ctypes.uint64("0x15fdafb08")) to see the complete type information, you can use .constructor.tosource(), to print the source of ctype.
...e("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.constructor.tosource()); let pp = p.address(); console.log(pp.constructor.tosource()); the result will be as per the following: ctypes.int32_t ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]) ctypes.structtype("point", [{ "x": ctypes.int32_t }, { "y": ctypes.int32_t }]).
ptr ...
js-ctypes reference
these include ctypes.pointertype(type) and the .
ptr property, which creates a new type describing a pointer to an existing type.
... callbacks you can pass regular javascri
pt functions as callbacks to native functions.
... 64-bit integer handling because javascri
pt number objects can't directly represent every possible 64-bit integer value, js-ctypes provides new types for these.
Plugin Roadmap for Firefox - Plugins
this change will be rolled out progressively during august and se
ptember 2017.
... se
ptember 2017 starting with firefox 56 in se
ptember 2017, firefox for android will remove all support for plugins (bug 1381916).
... 2019 in se
ptember 2019, firefox 69 will remove the "always activate" flash o
ption so we always ask for user permission before activating flash on a website.
Color vision simulation - Firefox Developer Tools
"color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perce
ption across the color spectrum, not only of specific colors like red or green.
...in the firefox configuration editor, make sure the gfx.webrender.all o
ption is set to true.
... in the simulate menu, you can choose one o
ption at a time from the following list: none — choose this to return to normal display protanomaly (low red) deuteranomaly (low green) tritanomaly (low blue) protanopia (no red) deuteranopia (no green) tritanopia (no blue) contrast loss these simulations are not completely medically accurate.
DOM Inspector FAQ - Firefox Developer Tools
i see a lot of em
pty #text nodes that i don't see in the original document.
...note that not all em
pty text nodes will be hidden.
...the dom inspector's search uses javascri
pt regexps to find nodes for tag and attribute searches, and will do partial matching.
HTMLMediaElement.setMediaKeys() - Web APIs
the setmediakeys() property of the htmlmediaelement interface returns a promise that resolves to the passed mediakeys, which are those used to decry
pt media during playback.
... syntax var promise = htmlmediaelement.setmediakeys(mediakeys); parameters mediakeys a reference to a mediakeys object that the htmlmediaelement can use for decry
ption of media data during playback.
... specifications specification status comment encry
pted media extensionsthe definition of 'setmediakeys()' in that specification.
HTMLSelectElement.remove() - Web APIs
the htmlselectelement.remove() method removes the element at the specified index from the o
ptions collection for this select element.
... syntax collection.remove(index); parameters index is a long for the index of the htmlo
ptionelement to remove from the collection.
... example var sel = document.getelementbyid("existinglist"); sel.remove(1); /* takes the existing following select object: <select id="existinglist" name="existinglist"> <o
ption value="1">o
ption: value 1</o
ption> <o
ption value="2">o
ption: value 2</o
ption> <o
ption value="3">o
ption: value 3</o
ption> </select> and changes it to: <select id="existinglist" name="existinglist"> <o
ption value="1">o
ption: value 1</o
ption> <o
ption value="3">o
ption: value 3</o
ption> </select> */ specifications specification status comment html living standardthe definition of 'htmlselectelement.remove()' in that specification.
HTMLSlotElement.assignedElements() - Web APIs
if the flatten o
ption is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
... syntax var assignedelements = htmlslotelement.assignedelements(o
ptions) parameters o
ptions o
ptional an object that sets o
ptions for the nodes to be returned.
... the available o
ptions are: flatten: a boolean indicating whether to return the assigned elements of any available child <slot> elements (true) or not (false).
HTMLSlotElement.assignedNodes() - Web APIs
the assignednodes() property of the htmlslotelement interface returns a sequence of the nodes assigned to this slot, and if the flatten o
ption is set to true, the assigned nodes of any other slots that are descendants of this slot.
... syntax var assignednodes = htmlslotelement.assignednodes(o
ptions) parameters o
ptions o
ptional an object that sets o
ptions for the nodes to be returned.
... the available o
ptions are: flatten: a boolean indicating whether to return the assigned nodes of any available child <slot> elements (true) or not (false).
HTMLTableElement.deleteRow() - Web APIs
return value no return value errors thrown if the number of the row to delete, specified by the parameter, is greater or equal to the number of available rows, or if it is negative and not equal to the special index -1, representing the last row of the table, the exce
ption index_size_err is thrown.
... example this example uses javascri
pt to delete a table's second row.
... html <table> <tr><td>cell 1.1</td><td>cell 1.2</td><td>cell 1.3</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td><td>cell 2.3</td></tr> <tr><td>cell 3.1</td><td>cell 3.2</td><td>cell 3.3</td></tr> </table> javascri
pt let table = document.queryselector('table'); // delete second row table.deleterow(1); result specifications specification status comment html living standardthe definition of 'htmltableelement: deleterow' in that specification.
HTMLTableElement.insertRow() - Web APIs
parameters index o
ptional the row index of the new row.
...if index is greater than the number of rows, an indexsizeerror exce
ption will result.
... html <table id="my-table"> <tr><td>row 1</td></tr> <tr><td>row 2</td></tr> <tr><td>row 3</td></tr> </table> javascri
pt function addrow(tableid) { // get a reference to the table let tableref = document.getelementbyid(tableid); // insert a row at the end of the table let newrow = tableref.insertrow(-1); // insert a cell in the row at index 0 let newcell = newrow.insertcell(0); // append a text node to the cell let newtext = document.createtextnode('new bottom row'); newcell.appendchild(newtex...
HTMLTableRowElement.insertCell() - Web APIs
parameters index o
ptional index is the cell index of the new cell.
...if index is greater than the number of cells, an indexsizeerror exce
ption will result.
... html <table id="my-table"> <tr><td>row 1</td></tr> <tr><td>row 2</td></tr> <tr><td>row 3</td></tr> </table> javascri
pt function addrow(tableid) { // get a reference to the table let tableref = document.getelementbyid(tableid); // insert a row at the end of the table let newrow = tableref.insertrow(-1); // insert a cell in the row at index 0 let newcell = newrow.insertcell(0); // append a text node to the cell let newtext = document.createtextnode('new bottom row'); newcell.appendchild(newtex...
Dragging and Dropping Multiple Items - Web APIs
if you use getdata(), you will receive an em
pty string as the data is not a string.
... <html> <head> <scri
pt> function dodrop(event) { var dt = event.datatransfer; var count = dt.mozitemcount; output("items: " + count + "\n"); for (var i = 0; i < count; i++) { output(" item " + i + ":\n"); var types = dt.moztypesat(i); for (var t = 0; t < types.length; t++) { output(" " + types[t] + ": "); try { var data = dt.mozgetdataat(types[t], i); output("(" + (typeof data) + ") : <" + data + " >\n"); } catch (ex) { output("<<error>>\n"); dump(ex); } } } } function...
... output(text) { document.getelementbyid("output").textcontent += text; dump(text); } </scri
pt> </head> <body> <div id="output" style="min-height: 100px; white-space: pre; border: 1px solid black;" ondragenter="document.getelementbyid('output').textcontent = ''; event.stoppropagation(); event.preventdefault();" ondragover="event.stoppropagation(); event.preventdefault();" ondrop="event.stoppropagation(); event.preventdefault(); dodrop(event);"> <div> fix</div> </div> </body> </html> this example cancels both the dragenter and dragover events by calling the preventdefault().
HashChangeEvent - Web APIs
examples syntax o
ptions for a hash change you can listen for the hashchange event using any of the following o
ptions: window.onhashchange = funcref; or <body onhashchange="funcref();"> or window.addeventlistener("hashchange", funcref, false); basic example function locationhashchanged() { if (location.hash === '#somecoolfeature') { somecoolfeature(); } } window.addeventlistener('hashchange', loca...
...tionhashchanged); polyfill there are several fallback scri
pts listed on the modernizr github page.
... basically, those scri
pts check the location.hash at a regular interval.
Headers() - Web APIs
syntax var myheaders = new headers(init); parameters init o
ptional an object containing any http headers that you want to pre-populate your headers object with.
... example creating an em
pty headers object is simple: var myheaders = new headers(); // currently em
pty you could add a header to this using headers.append: myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' or you can add the headers you want as the headers object is created.
... in the following snippet we create a new headers object, adding some headers by passing the constructor an init object as an argument: var httpheaders = { 'content-type' : 'image/jpeg', 'acce
pt-charset' : 'utf-8', 'x-my-custom-header' : 'zeke are cool' }; var myheaders = new headers(httpheaders); you can now create another headers object, passing it the first headers object as its init object: var secondheadersobj = new headers(myheaders); secondheadersobj.get('content-type'); // would return 'image/jpeg' — it inherits it from the first headers object specifications specification status comment fetchthe definition of 'headers()' in that specification.
Headers.append() - Web APIs
the difference between set() and append() is that if the specified header already exists and acce
pts multiple values, set() will overwrite the existing value with the new one, whereas append() will append the new value onto the end of the set of values.
... example creating an em
pty headers object is simple: var myheaders = new headers(); // currently em
pty you could add a header to this using append(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' if the specified header already exists, append() will change its value to the specified value.
... if the specified header already exists and acce
pts multiple values, append() will append the new value to the end of the value set: myheaders.append('acce
pt-encoding', 'deflate'); myheaders.append('acce
pt-encoding', 'gzip'); myheaders.get('acce
pt-encoding'); // returns 'deflate, gzip' to overwrite the old value with a new one, use headers.set.
Headers.getAll() - Web APIs
if the requested header doesn't exist in the headers object, it returns an em
pty array.
... example creating an em
pty headers object is simple: var myheaders = new headers(); // currently em
pty you could add a header to this using headers.append, then retrieve it using getall(): myheaders.append('content-type', 'image/jpeg'); myheaders.getall('content-type'); // returns [ "image/jpeg" ] if the header has multiple values associated with it, the array will contain all the values, in the order they were added...
... to the headers object: myheaders.append('acce
pt-encoding', 'deflate'); myheaders.append('acce
pt-encoding', 'gzip'); myheaders.getall('acce
pt-encoding'); // returns [ "deflate", "gzip" ] note: use headers.get to return only the first value added to the headers object.
Headers.set() - Web APIs
the difference between set() and headers.append is that if the specified header already exists and acce
pts multiple values, set() overwrites the existing value with the new one, whereas headers.append appends the new value to the end of the set of values.
... example creating an em
pty headers object is simple: var myheaders = new headers(); // currently em
pty you could add a header to this using headers.append, then set a new value for this header using set(): myheaders.append('content-type', 'image/jpeg'); myheaders.set('content-type', 'text/html'); if the specified header does not already exist, set() will create it and set its value to the specified value.
... if the specified header does already exist and does acce
pt multiple values, set() will overwrite the existing value with the new one: myheaders.set('acce
pt-encoding', 'deflate'); myheaders.set('acce
pt-encoding', 'gzip'); myheaders.get('acce
pt-encoding'); // returns 'gzip' you'd need headers.append to append the new value onto the values, not overwrite it.
Ajax navigation example - Web APIs
s.</p> include/before_content.php: <p> [ <a class="ajax-nav" href="first_page.php">first example</a> | <a class="ajax-nav" href="second_page.php">second example</a> | <a class="ajax-nav" href="third_page.php">third example</a> | <a class="ajax-nav" href="unexisting.php">unexisting page</a> ] </p> include/header.php: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <scri
pt type="text/javascri
pt" src="js/ajax_nav.js"></scri
pt> <link rel="stylesheet" href="css/style.css" /> js/ajax_nav.js: "use strict"; const ajaxrequest = new (function () { function closereq () { oloadingbox.parentnode && document.body.removechild(oloadingbox); bisloading = false; } function abortreq () { if (!bisloading) { return; } oreq.abort(); ...
...eelement("div"), oloadingimg = new image(), opageinfo = { title: null, url: location.href }, ohttpstatus = /* http://www.iana.org/assignments/http-status-codes/http-status-codes.xml */ { 100: "continue", 101: "switching protocols", 102: "processing", 200: "ok", 201: "created", 202: "acce
pted", 203: "non-authoritative information", 204: "no content", 205: "reset content", 206: "partial content", 207: "multi-status", 208: "already reported", 226: "im used", 300: "multiple choices", 301: "moved permanently", 302: "found", 303: "see other", 304...
...: "not modified", 305: "use proxy", 306: "reserved", 307: "temporary redirect", 308: "permanent redirect", 400: "bad request", 401: "unauthorized", 402: "payment required", 403: "forbidden", 404: "not found", 405: "method not allowed", 406: "not acce
ptable", 407: "proxy authentication required", 408: "request timeout", 409: "conflict", 410: "gone", 411: "length required", 412: "precondition failed", 413: "request entity too large", 414: "request-uri too long", 415: "unsupported media type", 416: "requested range not satisfiable", 41...
IDBCursor.continue() - Web APIs
the continue() method of the idbcursor interface advances the cursor to the next position along its direction, to the item whose key matches the o
ptional key parameter.
... syntax cursor.continue(key); parameters key o
ptional the key to position the cursor at.
... exce
ptions this method may raise a domexce
ption of one of the following types: exce
ption descri
ption transactioninactiveerror this idbcursor's transaction is inactive.
<msub> - MathML
the mathml <msub> element is used to attach a subscri
pt to an expression.
... it uses the following syntax: <msub> base subscri
pt </msub>.
... subscri
ptshift the minimum space by which to shift the subscri
pt below the baseline of the expression, as a length value.
<msup> - MathML
the mathml <msup> element is used to attach a superscri
pt to an expression.
... it uses the following syntax: <msup> base superscri
pt </msup>.
... superscri
ptshift the minimum space by which to shift the superscri
pt up from the baseline of the expression, as a length value.
MathML
mathematical markup language (mathml) is a dialect of xml for describing mathematical notation and ca
pturing both its structure and content.
... mailing list newsgroup rss feed matrix chat room wiki used by mozilla contributors w3c math home www-math w3.org mail archive tools w3c validator mathzilla firefox add-on collection texzilla — javascri
pt latex to mathml converter (live demo, firefox os webapp, firefox add-on, using in a web page, js program etc) latexml - convert latex documents into html+mathml web pages web equation - turn handwritten equations into mathml or latex mathjax - cross-browser javascri
pt display engine for mathematics.
... to force mathjax to use native mathml, try this mozilla add-on, this safari extension or this greasemonkey scri
pt.
Media type and format guide: image, audio, and video content - Web media technologies
guides conce
pts digital audio conce
pts an introduction to how audio is converted into digital form and stored for use by computers.
... it explains basic conce
pts about how audio is sampled, as well as conce
pts such as sample rate, audio frames, and audio compression.
... digital video conce
pts a guide to fundamental conce
pts involved with digital video as used on the web, including basics about color formats, chroma subsampling, how human perce
ption influences video coding, and so forth.
Responsive Navigation Patterns - Progressive web apps (PWAs)
top and left navigation menus are common on larger screens, but are often not the o
ptimal way to present information on small screens because of the reduced screen real estate.
...f navigation items is maintained with adequate spacing, by automatically hiding items that don't fit cons: one more step is needed to access the navigation items that are hidden navigation items might be less discoverable because some items are hidden less space for content in the smallest screen size pattern 3: left hidden menu the main navigation is always on the left exce
pt in the smallest screen size, where the navigation menu is hidden in a button by default.
... pros: potentially displays more navigation items in a left navigation compared to a top navigation most items are always visible exce
pt in the smallest screen size one button in header maximizes space for content on a small screen cons: navigation items might be less discoverable because some items are hidden in the drop-down or toggle menu users may not notice the button contains a navigation menu in the smallest screen size one more step is needed to access the navigation items that are hidden ...
baseline-shift - SVG: Scalable Vector Graphics
the shifted object might be a sub- or superscri
pt.
... as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscri
pts.
... super the dominant-baseline is shifted to the default position for superscri
pts.
d - SVG: Scalable Vector Graphics
svg defines 6 types of path commands, for a total of 20 commands: moveto: m, m lineto: l, l, h, h, v, v cubic bézier curve: c, c, s, s quadratic bézier curve: q, q, t, t elli
ptical arc curve: a, a closepath: z, z note: commands are case-sensitive.
...up"> <polyline points="70,50 85,25 100,50" stroke="rgba(0,0,0,.2)" stroke-dasharray="2" fill="none" /> <circle cx="85" cy="25" r="1.5" fill="lightgrey" /> <circle cx="100" cy="50" r="1.5" /> </g> <use xlink:href="#smoothquadraticdown" x="60" /> <use xlink:href="#smoothquadraticup" x="60" /> <use xlink:href="#smoothquadraticdown" x="120" /> </g> </svg> elli
ptical arc curve elli
ptical arc curves are curves defined as a portion of an ellipse.
... it is sometimes easier to draw highly regular curves with an elli
ptical arc than with a bézier curve.
dominant-baseline - SVG: Scalable Vector Graphics
use-scri
pt the dominant-baseline and the baseline-table components are set by determining the predominant scri
pt of the character data content.
... candidate recommendation refers to the specification in working draft and explicitly mentions the removal of the values use-scri
pt, no-change, and reset-size.
... working draft removed the values use-scri
pt, no-change, and reset-size and introduced the text-top value.
image-rendering - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following element: <image> usage notes value auto | o
ptimizespeed | o
ptimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more importance than speed.
... o
ptimizespeed indicates that the user agent shall emphasize rendering speed over quality.
... o
ptimizequality indicates that the user agent shall emphasize quality over rendering speed.
kernelUnitLength - SVG: Scalable Vector Graphics
value <number-o
ptional-number> default value pixel in offscreen bitmap animatable yes <number-o
ptional-number> the first number is the x value.
... value <number-o
ptional-number> default value pixel in offscreen bitmap animatable yes fespecularlighting for the <fespecularlighting>, kernelunitlength indicates the intended distance in current filter units (i.e., units as determined by the value of attribute primitiveunits) for the x and y coordinate, respectively, in the surface normal calculation formulas.
... value <number-o
ptional-number> default value pixel in offscreen bitmap animatable yes specifications specification status comment filter effects module level 1the definition of 'kernelunitlength for <fespecularlighting>' in that specification.
name - SVG: Scalable Vector Graphics
note: if no name is provided, it will be impossible to reference the given color profile descri
ption.
... the name "srgb" is predefined; any color profile descri
ptions with <name> set to "srgb" (case-insensitively) will be ignored.
...unlike the syntax allowed between the parentheses of the local(…) clause in an @font-face rule src descri
ptor, the font name specified in this attribute is not surrounded in single or double quotes.
requiredExtensions - SVG: Scalable Vector Graphics
it is thus recommended to include a "catch-all" choice at the end of such a <switch> which is acce
ptable in all cases.
...if a null string or em
pty string value is given, the attribute evaluates to "false".
... the iri names for the extension should include versioning information, such as "http://example.org/svgextensionxyz/1.0", so that scri
pt writers can distinguish between different versions of a given extension.
<a> - SVG: Scalable Vector Graphics
attributes download instructs browsers to download a url instead of navigating to it, so the user will be prom
pted to save it as a local file.
...etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>...
..., <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <scri
pt>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<a>' in that specification.
<clipPath> - SVG: Scalable Vector Graphics
conce
ptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
...*/ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping path is conce
ptually equivalent to a custom viewport for the referencing element.
...ably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elements<text>, <use> specifications specification status comment css masking module level 1the definition of '<clippath>' in that specification.
<desc> - SVG: Scalable Vector Graphics
the <desc> element provides an accessible, long-text descri
ption of any svg container element or graphics element.
... html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <circle cx="5" cy="5" r="4"> <desc> i'm a circle and that descri
ption is here to demonstrate how i can be described, but is it really necessary to describe a simple circle like me?
... </desc> </circle> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescri
ptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<desc>' in that specification.
Using Multiple Queries to Generate More Results - Archive of obsolete content
if we add the following data about people to the neighbourhood datasource: <rdf:descri
ption rdf:about="http://www.xulplanet.com/rdf/myneighbourhood"> <r:people> <rdf:seq> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/1"/> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/2"/> </rdf:seq> </r:people> </rdf:descri
ption> <rdf:descri
ption rdf:about="http://www.xulplanet.com/rdf/person/1" dc:title="nathan"/> ...
... <rdf:descri
ption rdf:about="http://www.xulplanet.com/rdf/person/2" dc:title="karen"/> we can then use two queries to generate results from different parts of the datasource.
Template Guide - Archive of obsolete content
ion tests multiple queries using multiple queries to generate more results building trees with templates building trees building hierarchical trees template modifications template builder interface template and tree listeners rdf modifications additional topics sorting results additional template attributes template logging xml namespaces alternative approaches javascri
pt templates xuljsdatasource: a component for extensions, which bring a "javascri
pt template syntax".
... it allows to use javascri
pt objects as a data source for xul templates.
Things I've tried to do with XUL - Archive of obsolete content
tten is to use a div instead of a box container: <html:div style="-moz-box-flex: 1; width: 100%; height: 100%;"> <box style="height: 30%" flex="1" style="background: green;"/> <box style="height: 20%" flex="1" style="background: green;"/> <box style="height: 50%" flex="1" style="background: green;"/> </html:div> using flex="3" flex="2" flex="5" would give the right display visually for the em
pty boxes; however, flex only applies to how em
pty space is allocated.
... so, as soon as you add a label or some other element inside, there will be a different amount of "em
pty space" to allocate in different boxes.
Code Samples - Archive of obsolete content
the samples here are designed to work in firefox, thunderbird, sunbird and seamonkey, exce
pt where the text says otherwise.
...f writing, sunbird's passwords window is broken close the current window to close the window containing the button, possibly leaving other windows open: close() exit the application to exit the application, first closing all its windows: components .classes['@mozilla.org/toolkit/app-startup;1'] .getservice(components.interfaces.nsiappstartup) .quit(components.interfaces.nsiappstartup.eattem
ptquit) ...
Accesskey display rules - Archive of obsolete content
because macos x doesn't have the conce
ption of accesskey function on its native widgets/applications.
...for this issue, we recommend the following format if you use .properties: <command-name>.label=cancel <command-name>.accesskey=c note that apis of nsiprom
ptservice are using the bad way.
Element Positioning - Archive of obsolete content
examples of setting widths and heights <button label="1" style="width: 100px;"/> <button label="2" style="width: 100em; height: 10px;"/> <button label="3" flex="1" style="min-width: 50px;"/> <button label="4" flex="1" style="min-height: 2ex; max-width: 100px"/> <textbox flex="1" style="max-width: 10em;"/> <descri
ption style="max-width: 50px">this is some boring but simple wrapping text.</descri
ption> example 1 the first button will be displayed with a width of 100 pixels (px means pixels).
... example 6 the descri
ption element is constrained to have a maximum width of 50 pixels.
Persistent Data - Archive of obsolete content
one possibility would be to write a scri
pt to collect information about what you would like to save and then save it to a file.
...you might use unusual values if you adjust attributes using a scri
pt.
Styling a Tree - Archive of obsolete content
however, css has a conce
pt to access parts of elements considering them to be pseudo-elements.
... setting properties for the custom view for trees with a custom view scri
pt, you can set properties by supplying the functions getrowproperties(), getcolumnproperties() and getcellproperties() in the view.
XUL Tutorial - Archive of obsolete content
ss meters adding html elements using spacers more button features the box model the box model element positioning box model details groupboxes adding more elements more layout elements stacks and decks stack positioning tabboxes grids content panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scri
pts adding event handlers more event handlers keyboard shortcuts focus and selection commands updating commands broadcasters and observers document object model document object model modifying a xul interface manipulating lists box objects xpcom interfaces xpcom examples trees trees more tree features tree selection custom tree views tree view details tree box objects ...
...n to xbl anonymous content xbl attribute inheritance adding properties adding methods adding event handlers xbl inheritance creating reusable content using css and xbl xbl example specialized window types features of a window creating dialogs open and save dialogs creating a wizard more wizards overlays cross package overlays installation creating an installer install scri
pts additional install features this xul tutorial was originally created by neil deakin.
action - Archive of obsolete content
examples example needed attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties in...
...herited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, get...
assign - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
bbox - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
binding - Archive of obsolete content
properties object, predicate, subject examples fixme: (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties obj...
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelement...
box - Archive of obsolete content
label value="zero"/> <box orient="vertical"> <label value="one"/> <label value="two"/> </box> <box orient="horizontal"> <label value="three"/> <label value="four"/> </box> </box> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
broadcaster - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
broadcasterset - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
browser - Archive of obsolete content
it is similar to an iframe exce
pt that it holds a page history and contains additional methods to manipulate the currently displayed page.
...arsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <ca
ption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
checkbox - Archive of obsolete content
attributes accesskey, checked, command, crop, disabled, src, label, preference, tabindex properties accesskey, accessibletype, checked, command, crop, disabled, src, label, tabindex examples <checkbox label="enable javascri
pt" checked="true"/> <checkbox label="enable java" checked="false"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
column - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
columns - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
commandset - Archive of obsolete content
oncommandupdate type: scri
pt code this event occurs when a command update occurs.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
conditions - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
datepicker - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...however, the value may still be modified by a scri
pt.
dropmarker - Archive of obsolete content
examples properties accessibletype attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
grippy - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
iframe - Archive of obsolete content
rame"/> selecting an url from a menu <menulist oncommand="donav(this);"> <menupopup> <menuitem label="mozilla" value="http://mozilla.org" /> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <scri
pt> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </scri
pt> attributes showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
...this can be used to workaround things like bug 540911 inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties ...
listcol - Archive of obsolete content
/> </listcols> <listitem> <listcell label="buck"/> <listcell label="rogers"/> </listitem> <listitem> <listcell label="john"/> <listcell label="painter"/> </listitem> </listbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
listcols - Archive of obsolete content
/> </listcols> <listitem> <listcell label="buck"/> <listcell label="rogers"/> </listitem> <listitem> <listcell label="john"/> <listcell label="painter"/> </listitem> </listbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
member - Archive of obsolete content
properties child, container examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
observes - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
queryset - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
resizer - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
richlistitem - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
row - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
rows - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
scale - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
scrollbox - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
scrollcorner - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
spacer - Archive of obsolete content
examples <box> <button label="left"/> <spacer flex="1"/> <button label="right"/> </box> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
spinbuttons - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
splitter - Archive of obsolete content
the vbox is used to hold the .png image that a user clicks on to resize the search bar.--> <splitter toolti
ptext="resize the search box" oncommand="alert('the splitter was dragged')"> <vbox id="example_vbox" /> </splitter> attributes collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
stack - Archive of obsolete content
--> </hbox> </stack> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
statusbar - Archive of obsolete content
ies accessibletype examples <statusbar> <statusbarpanel label="left panel"/> <spacer flex="1"/> <progressmeter mode="determined" value="82"/> <statusbarpanel label="right panel"/> </statusbar> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelement...
<statusbarpanel> - Archive of obsolete content
if this attribute is em
pty or left out, no image appears.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
stringbundle - Archive of obsolete content
the "src" attribute acce
pts only absolute chrome:// urls (see bugs 133698, 26291) attributes src properties applocale , src, stringbundle, strings methods getformattedstring, getstring examples (example needed) attributes src type: uri the uri of the property file that contains the localized strings.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the user's locale.
stringbundleset - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties inherited properties align, , allowe...
...vents, , 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattri...
textnode - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
timepicker - Archive of obsolete content
visible controls have a disabled property which, exce
pt for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...however, the value may still be modified by a scri
pt.
titlebar - Archive of obsolete content
gba(0, 0, 0, 0.8); margin: 8px 12px 16px;"/> </window> it can be opened from the error console like this: open("file:///users/markus/sites/hudwindow.xul", "", "chrome=1, titlebar=0") attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width note: the allowev...
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
toolbargrippy - Archive of obsolete content
properties accessible examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
toolbaritem - Archive of obsolete content
tton-unified"> <toolbarbutton id="myext-button1" class="toolbarbutton-1" label="label1" /> <toolbarbutton id="myext-button2" class="toolbarbutton-1" label="labe2l" /> </toolbaritem> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
toolbarpalette - Archive of obsolete content
examples <toolbarpalette id="browsertoolbarpalette"> <toolbarbutton id="toolbarpalette-button" class="toolbarbutton-class" label="&mylabel;" toolti
ptext="&myti
ptext;" oncommand="somefunction()"/> </toolbarpalette> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, m...
...inwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatcheven...
toolbarseparator - Archive of obsolete content
properties accessibletype examples <toolbox> <toolbar> <toolbarbutton label="button 1"/> <toolbarseparator /> <toolbarbutton label="button 2"/> </toolbar> </toolbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelement...
toolbarset - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties inh...
...erited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getus...
toolbarspacer - Archive of obsolete content
properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
toolbarspring - Archive of obsolete content
properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelement...
treecell - Archive of obsolete content
it is not used for any specific purpose, but you can access it with a scri
pt for your own use.
... 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
treechildren - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
treerow - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
treeseparator - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
where - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties i...
...nherited 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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, g...
XUL - Archive of obsolete content
e live editor (copy & paste snippets from here and run them) xul explorer (a lightweight xul ide) xulexplorer (patched version of xul explorer) extension developer's extension (featuring a live xul editor) xulref sidebar firebug dom inspector spket ide, ide for xul/xbl ample sdk, (cross-browser xul renderer in javascri
pt/html) view all...
... related topics javascri
pt, xbl , css, rdf, extensions, xulrunner ...
Components - Archive of obsolete content
put both .dll/.js file and the .x
pt(s) in there.
...alternatively, you can delete compreg.dat and x
pti.dat in the user profile directory - that of your xulrunner app, not that of firefox/mozilla.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
several alternatives were considered: soapclient 2.4 - this library contains a few javascri
pt mistakes but nevertheless seems (fairly) widely used, mature and tested.
...xulrunner 1.8.* - using an old xulrunner is certainly an o
ption but brings up a host of speed, stability and memory issues.
xulauncher - Archive of obsolete content
#!/bin/bash -e # a simple bash scri
pt to create a minimal xulrunner dir structure and # needed meta files in /tmp, copy the xul-file over and start it # usage: # xulauncher xulfile.xul [o
ptions] ############################################################################## # check if theres atleast one parameter ############################################################################## if [ $# -lt 1 ] then echo "you need to give the xul file as first parameter" exit fi # check if 1st parameter is a file ############################################################################## if [ !
...######################################################################### echo " content $xulname file:$xulname/ ">$xulmanifest # create prefs.js file ############################################################################## echo " pref(\"toolkit.defaultchromeuri\", \"chrome://$xulname/content/$xulfile\"); /* debugging prefs */ pref(\"browser.dom.window.dump.enabled\", true); pref(\"javascri
pt.o
ptions.showinconsole\", true); pref(\"javascri
pt.o
ptions.strict\", true); pref(\"nglayout.debug.disable_xul_cache\", true); pref(\"nglayout.debug.disable_xul_fastload\", true); ">$xulprefs # copy xul file to right location and run it ############################################################################## cp $xulfile $xuldir xulrunner $xulappini $@ ...
application/http-index-format specification - Archive of obsolete content
the application/http-index-format file format is an attem
pt to provide a generic, extensible file listing format that is principly machine readable.
... do not present to the end-user 100: 101: the files in this directory are put forth for public 101: consum
ption and the provider make no guarentee as 101: as to the functionality of the data or programs 101: presented.
calIFileType - Archive of obsolete content
defined in calendar/base/public/caliimportexport.idl interface code [scri
ptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring descri
ption; }; attributes defaultextension the default extension that should be associated with files of this type.
...descri
ption the descri
ption to show to the user in the filter list.
xbDesignMode.js - Archive of obsolete content
/* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file exce
pt in compliance with * the license.
... * * contributor(s): doron rosenberg <doron@netscape.com> (original author) * * * * ***** end license block ***** */ /* xbdesignmode a javascri
pt 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") ...
2006-10-13 - Archive of obsolete content
(user feels print belongs on the context menu along with back, reload, etc.) questions about programming for firefox a student questions how to create an extension that changes fonts, and how to ca
pture website content before it is displayed.
... firefox 2.0 should re-implement modal window.open to support web 2.0 user would like the o
ption to show pop-up windows, using window.open(), from inside untrusted scri
pt, to be re-implemented.
2006-11-10 - Archive of obsolete content
quesiton about why a user using firefox 2 rc3 didn't get a prom
pt for updating to firefox 2 after the release date.
... improving the ue for content control suggestion about how to improve user experience with o
ptions controlling the appearance of web content.
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.apps.thunderbird - se
ptember 30-october 06, 2006 announcements mac user needed scott macgregor announced that .mac support and a dynamically add isp account feature has been added to the thunderbird account manager, however, testing is required before release can be issued.
... david bienvenu suggests a top down architectural descri
ption of tb's data structures along with documentation about extracting them.
2006-11-17 - Archive of obsolete content
solution is provided by jay lee should there be an additional o
ptions for account configuration that just delete the messages from the server whenever they are deleted in tb?
...however, david bienvenu stated that the o
ptions already exist in tb 2.0, just that it is a hidden.
2006-11-24 - Archive of obsolete content
he is receiving the following error: error: uncaught exce
ption: [exce
ption...
... the build is working properly with the default toolkit, but when he tries to add ac_add_o
ptions --enable-default-toolkit=gtk2 to his .mozconfig file he gets an error.
descent - SVG: Scalable Vector Graphics
the descent attribute defines the maximum unaccented de
pth of the font.
... note: it was specified to share the syntax and semantics of the obsolete descent descri
ptor of the @font-face at-rule defined in an early version of css 2.
font-weight - SVG: Scalable Vector Graphics
ref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-weight="normal">normal text</text> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animatable yes for a descri
ption of the values, please refer to the css font-weight property.
... working draft defines font-weight to acce
pt any numbers between 1 and 1000.
glyph-orientation-vertical - SVG: Scalable Vector Graphics
note: text set in this "rotated" manner may contain ligatures or other glyph combining and reordering common to the language and scri
pt.
...the determination is based on a complex interaction between country, language, scri
pt, character properties, font, and character context.
in - SVG: Scalable Vector Graphics
sourcealpha has all of the same rules as sourcegraphic exce
pt that only the alpha channel is used.
... backgroundalpha same as backgroundimage exce
pt only the alpha channel is used.
keySplines - SVG: Scalable Vector Graphics
default value none animatable no the attribute value is a semicolon-separated list of control point descri
ptions.
... <control-point> each control point descri
ption is a set of four values: x1 y1 x2 y2, describing the bézier control points for one time segment.
onclick - SVG: Scalable Vector Graphics
the onclick attribute specifies some scri
pt to run when the element is clicked.
... thirty-seven elements are using this attribute: <a>, <altglyph>, <animate>, <animatemotion>, <animatetransform>, <circle>, <defs>, <desc>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <lineargradient>, <marker>, <metadata>, <mpath>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <scri
pt>, <set>, <stop>, <style>, <svg>, <switch>, <symbol>, <text>, <textpath>, <title>, <tref>, <tspan>, <use>, <view> html, body, svg { height: 100%; margin: 0; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none animatable no specifications specification stat...
systemLanguage - SVG: Scalable Vector Graphics
it is thus recommended to include a "catch-all" choice at the end of such a <switch> which is acce
ptable in all cases.
...if a null string or em
pty string value is given, the attribute evaluates to "false".
tableValues - SVG: Scalable Vector Graphics
0"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <list-of-numbers> default value em
pty list resulting in identity transfer animatable yes <list-of-numbers> this value holds a comma- and/or space-separated list of <number>s, which define a lookup table for the color component transfer function.
... an em
pty list results in an identity transfer function.
transform - SVG: Scalable Vector Graphics
if o
ptional parameters x and y are not supplied, the rotation is about the origin of the current user coordinate system.
... if o
ptional parameters x and y are supplied, the rotation is about the point (x, y).
type - SVG: Scalable Vector Graphics
for the <style> and <scri
pt> elements, it defines the content type of the element.
...ents categories none value identity | table | discrete | linear | gamma animatable yes normative document svg 1.1 (2nd edition) for the <feturbulence> element categories none value fractalnoise | turbulence animatable yes normative document svg 1.1 (2nd edition) for the <style> and <scri
pt> elements categories none value <content-type> animatable no normative document svg 1.1 (2nd edition) : scri
pt svg 1.1 (2nd edition) : style example elements the following elements can use the values attribute <animatetransform> <fecolormatrix> <fefunca> <fefuncb> <fefuncg> <fefuncr> <feturbulence> <scri
pt> <style> ...
xlink:title - SVG: Scalable Vector Graphics
these elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <scri
pt>, <set>, <textpath>, <tref>, and <use> usage context value <anything> default value none animatable no <anything> this value specifies the title used to describe the meaning of the link or resource.
... candidate recommendation deprecated the attribute and made it only apply to <a>, <image>, <lineargradient>, <pattern>, <radialgradient>, <scri
pt>, <textpath>, and <use> scalable vector graphics (svg) 1.1 (second edition)the definition of 'seed' in that specification.
<cursor> - SVG: Scalable Vector Graphics
if a different image format is used, this format should support the definition of a transparency mask (two o
ptions: provide an explicit alpha channel or use a particular pixel color to indicate transparency).
... usage context categoriesnonepermitted contentany number of the following elements, in any order:descri
ptive elements attributes global attributes conditional processing attributes core attributes xlink attributes externalresourcesrequired specific attributes x y xlink:href dom interface this element implements the svgcursorelement interface.
<g> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippa...
...th>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <scri
pt>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<g>' in that specification.
<image> - SVG: Scalable Vector Graphics
to include svg files and run scri
pts inside them, try <object> inside of <foreignobject>.
... usage context categoriesgraphics element, graphics referencing elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired transform specific attributes x: positions the image horizontally from the origin.
<marker> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>...
..., <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <scri
pt>, <style>, <switch>, <text>, <view> specifications specification status comment svg markersthe definition of '<marker>' in that specification.
elements - Archive of obsolete content
a action arrowscrollbox b bbox binding bindings box broadcaster broadcasterset button browser c checkbox ca
ption colorpicker column columns commandset command conditions content d deck descri
ption dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s scri
pt scrollbar scrollbox scrollcor...
menubar - Archive of obsolete content
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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
param - Archive of obsolete content
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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
scrollbar - Archive of obsolete content
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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
tabpanels - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties ...
toolbox - Archive of obsolete content
oolbarbutton label="stop"/> <toolbarbutton label="reload"/> </toolbar> </toolbox> <textbox multiline="true" value="we have two toolbars inside of one toolbox above." width="20"/> </window> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, em
pty, 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, toolti
ptext, top, uri, wait-cursor, width properties ...
treecol - Archive of obsolete content
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, toolti
ptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), geteleme...
wizard - Archive of obsolete content
rrentpage, onfirstpage, onlastpage, pagecount, pageindex, pagestep, title, wizardpages methods advance, cancel, extra1, extra2, getbutton, getpagebyid, goto, rewind examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <scri
pt> function checkcode(){ document.getelementbyid('thewizard').canadvance = (document.getelementbyid('secretcode').value == "cabbage"); } </scri
pt> <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> <...
Building XULRunner - Archive of obsolete content
a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_o
ptions moz_co_project=xulrunner mk_add_o
ptions moz_objdir=@topsrcdir@/obj-xulrunner ac_add_o
ptions --enable-application=xulrunner #uncomment the following line if you don't want to build javaxpcom: #ac_add_o
ptions --disable-javaxpcom cvs tags and xulrunner versions older xulrunner releases where tagged in cvs with (for instance xulrunner_1_8_0_5_release ) up to version 1.8.0.5 the cvs repositor...
CommandLine - Archive of obsolete content
application window to the observer: chrome/content/window.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="main" title="&window.title;" windowtype="xulmine" style="width: 300px; height: 350px;" persist="screenx screeny width height sizemode"> <scri
pt type="application/javascri
pt" src="cmdline.js" /> ...
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cry
ptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by x...
Mozprofile - Archive of obsolete content
if a profile is not specified, one will be created in a temporary directory which will be echoed to the terminal: (mozmill)> mozprofile /tmp/tmp4q1ieu.mozrunner (mozmill)> ls /tmp/tmp4q1ieu.mozrunner user.js to run mozprofile from the command line enter: mozprofile --help for a list of o
ptions.
<hatch> - SVG: Scalable Vector Graphics
usage context categoriesnever-rendered element, paint server elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements<hatchpath>, <scri
pt>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes x y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface.
<hatchpath> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements<scri
pt>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatchpathelement interface.
<hkern> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentem
pty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svghkernelement interface.
<line> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements specifications specification status comment ...
<linearGradient> - SVG: Scalable Vector Graphics
l-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descri
ptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<lineargradient>' in that specification.
<mask> - SVG: Scalable Vector Graphics
th, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <scri
pt>, <style>, <switch>, <text>, <view> specifications specification status comment css masking module level 1the definition of '<mask>' in that specification.
<missing-glyph> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <scri
pt>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface.
<mpath> - SVG: Scalable Vector Graphics
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descri
ptive elements attributes global attributes core attributes » xlink attributes » externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgmpathelement interface.
<path> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements specifications specification status comment svg path...
<polygon> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements specifications specification status comment ...
<polyline> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements specifications specification status comment ...
<radialGradient> - SVG: Scalable Vector Graphics
l-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descri
ptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<radialgradient>' in that specification.
<rect> - SVG: Scalable Vector Graphics
etails, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescri
ption, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elements specifications specification status comment ...
<set> - SVG: Scalable Vector Graphics
mation attributes most notably: attributename animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of the following elements, in any order:descri
ptive elements specifications specification status comment svg animations level 2the definition of '<set>' in that specification.
<switch> - SVG: Scalable Vector Graphics
usage context categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescri
ptive elementsshape elements<a>, <foreignobject>, <g>, <image>, <svg>, <switch>, <text>, <use> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes class style externalresourcesrequired transform dom interface this element implements the svgswitchelement interface.